View Single Post
Author Message
HowToRuski
Senior Member
Join Date: Feb 2019
Location: Hungary
Old 04-02-2023 , 02:50   native "get_user_weapon"
Reply With Quote #1

Im having errors on my console with this script... Am i doing something wrong?
Script itself compiles without errors or warnings, but in-game it does.
PHP Code:
public TakeDamagethis idinflictor idattacker Float:damage damagebits )
{
    if ( 
get_user_weaponidattacker ) == CSW_AWP//the run time error starts here (line 13)
    
{
        
SetHamParamFloatdamage )
    }
    else if ( 
get_user_weaponidattacker ) == CSW_KNIFE)
    {
        
SetHamParamFloatdamage 1.5)
    }
    else if (
get_user_weapon(idattacker) == CSW_HEGRENADE)
    {
        if( 
idattacker == idinflictor ){
            return 
HAM_IGNORED;
        }

        
SetHamParamFloatdamage 6)

    }
    else
    {
        
SetHamParamFloatdamage )
        return 
HAM_HANDLED;
    }
    return 
HAM_IGNORED;

PHP Code:
Run time error 10native error (native "get_user_weapon")
[
0dmgmultiplier.sma::TakeDamage (line 13
HowToRuski is offline