View Single Post
Natsheh
Veteran Member
Join Date: Sep 2012
Old 05-11-2018 , 16:54   Re: Knife It UP v3.0.4
Reply With Quote #18

Quote:
Originally Posted by instinctpt1 View Post
@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(idget_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.
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 05-22-2018 at 09:29.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh