Quote:
Originally Posted by instinctpt1
@Natsheh i see why u said to use hamItemMaxSpeed as its accurate and fast but due to its accuracy it makes player stop if player choose other weapon while having speed
I did this :
PHP Code:
RegisterHam(Ham_CS_Item_GetMaxSpeed, "weapon_knife", "handleKnifeSpeed", 0);
// Func : public handleKnifeSpeed() { new id = read_data(1); if(get_pcvar_float(csi_kkb_speed) > 250.0 && g_bHasSpeed[id]) set_user_maxspeed(id, get_pcvar_float(csi_kkb_speed)); }
So to fulfill my purpose i guess curweapon is good then :/ ?
( As i want player to have speed regardless of weapon in hand until speedTime goes off )
|
Its not about accuracy its about efficiency. If you want it for all weapons then hook it for all weapons using a loop.
Thats not how you change the speed as you can see in the api the return type is the speed(float).p
PHP Code:
/**
* Description: Gets the maximum speed for whenever a player has the item deployed.
* Forward params: function(this);
* Return type: Float (byref'd in ExecuteHam).
* Execute params: ExecuteHam(Ham_CS_Item_GetMaxSpeed, this, Float:output);
*/
Ham_CS_Item_GetMaxSpeed
You change the return type using SetHamReturnFloat native. And then block the return.
Also you are retrieving the player index incorrectly. 1st param is the weapon ent index.
__________________