View Single Post
apocalyptic
Senior Member
Join Date: Feb 2013
Location: China
Old 02-21-2013 , 00:57   Re: [CS:GO] Altering weapon run speed values
Reply With Quote #6

Like speed, you can set a custom gravity too. 1.0 is normal. If you set an entity's gravity to 0.0, it will never fall.
But you don't need to make a custom function for this, SourceMod already had one.
PHP Code:
public OnWeaponSwitchPost(clientweapon
{
    new 
String:weapon[24
    
GetClientWeapon(client,weapon,24)
    if (
StrEqual(weapon,"weapon_knife"))
    {
        
SetClientSpeed(client,speed)
        
SetClientGravity(client,gravity)//<----set gravity here
    
}
    else
    {
        
SetClientSpeed(client,1.0)
        
SetClientGravity(client,1.0)//<----set to default too
    
}

apocalyptic is offline