Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Request] Call function just like in Hamsandwich (ExecuteHam/ExecuteHamB). #9

Open
lespaul64 opened this issue Jun 2, 2016 · 10 comments

Comments

@lespaul64
Copy link

I see this module is awesome with useful functions, but where is the function that similar too ExecuteHam/ExecuteHamB?

In Hamsandwich module:

/**
 * Executes the virtual function on the entity.
 * Look at the Ham enum for parameter lists.
 *
 * @param function      The function to call.
 * @param id            The id of the entity to execute it on.
 */
native ExecuteHam(Ham:function, this, any:...);

/**
 * Executes the virtual function on the entity, this will trigger all hooks on that function.
 * Be very careful about recursion!
 * Look at the Ham enum for parameter lists.
 *
 * @param function      The function to call.
 * @param id            The id of the entity to execute it on.
 */
native ExecuteHamB(Ham:function, this, any:...);
@theAsmodai
Copy link
Collaborator

What functions do you need? We maked a set of useful rg_* natives for most things. They replace direct usage of the ExecuteHam(B) functions.

@lespaul64
Copy link
Author

Sad.. I thought we can completely replace ham module. At least make it for Ham_CS_RoundRespawn, Ham_TakeDamage and Ham_CS_Player_ResetMaxSpeed. I'm curious why dont you make that ExacuteHam similar native. It was useful by the way. Also it would be great if we can hook fire_bullet and fire_bullet3 too.

@theAsmodai
Copy link
Collaborator

theAsmodai commented Jun 5, 2016

It's not easy to implement and mostly will be unused. The FireBullets functions has a many arguments and will be quite slow. I think they can be replaced by another functions.

@souvikdas95
Copy link

souvikdas95 commented Jun 19, 2016

Ham_think, Ham_Weapon_RetireWeapon, Ham_Item_Kill, Ham_RemovePlayerItem, Ham_AddPlayerItem, Ham_Item_AttachToPlayer, Ham_Spawn

@Skumek
Copy link

Skumek commented Aug 12, 2016

I also like the idea of ExecuteHamB function:)

We could add ammo like ham.
ExecuteReHook(RG_CBasePlayer_GiveAmmo, i_Client, i_Amount, sz_Name, i_MaxCarry)

Ham Suggestions:
Ham_Weapon_PrimaryAttack, Ham_Weapon_SecondaryAttack, Ham_Item_Deploy, Ham_Item_AddToPlayer, Ham_Weapon_Reload, Ham_Weapon_WeaponIdle, Ham_Think, Ham_Touch.

But it would be nice with these too:

FM_PlaybackEvent(flags, invoker, eventid, Float:delay, Float:origin[3], Float:angles[3], Float:fparam1, Float:fparam2, iParam1, iParam2, bParam1, bParam2), // RG_PlaybackEvent
FM_SetModel(i_Ent, sz_Model[]), // RG_SetModel
FM_PrecacheEvent(i_Type, const sz_Name[]), // RG_PrecacheEvent
Event_RoundNew(), // RG_RoundNew
Event_RoundStart(), // RG_RoundStart
Event_StatusValue(i_Client), // RG_StatusValue

@ivanmaxlogiudice
Copy link
Contributor

ivanmaxlogiudice commented Oct 27, 2016

You can add Ham_CS_Player_ResetMaxSpeed and Ham_Item_Deploy?

@ish12321
Copy link

ish12321 commented Jan 4, 2017

Ham_Item_Deploy?

@ddelbasto
Copy link

ddelbasto commented Jul 16, 2021

Is there any progress with this request?

I'm trying to make a fake smoke and I need to call RG_ThrowSmokeGrenade.
This can be done with okapi.

new m_usCreateSmoke = get_pdata_int(gEntity, m_usEvent)
new Entity = okapi_call(CGrenade_ShootSmokeGrenade, pev(gEntity, pev_owner), gOrigin, Float:{0.0, 0.0, 0.0}, 0, m_usCreateSmoke)

But, it would be nice if reapi could do such calls.

cheers

@afwn90cj93201nixr2e1re
Copy link
Contributor

afwn90cj93201nixr2e1re commented Jul 17, 2021

Not that easy as you guys think. To implement it correctly with preserving current behavior we need think deeper than the direct solution.

@RauliTop
Copy link
Contributor

@gladiuskzcl
Use this: https://dev-cs.ru/threads/222/page-7#post-74228

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants