AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   fw_TakeDamage (https://forums.alliedmods.net/showthread.php?t=204965)

Miljan9 01-05-2013 08:51

fw_TakeDamage
 
I have a problem with hamsandwich function (fw_TakeDamage).

This is a log:
Code:

L 01/05/2013 - 13:39:47: Invalid player id 0 L 01/05/2013 - 13:39:47: [AMXX] Displaying debug trace (plugin "zp_addon_gamemodes.amxx") L 01/05/2013 - 13:39:47: [AMXX] Run time error 10: native error (native "get_user_weapon") L 01/05/2013 - 13:39:47: [AMXX]    [0] zp_addon_gamemodes.sma::fw_TakeDamage (line 139)
I work in this way:


#include <hamsandwich> (in top)

in plugin_init:
RegisterHam(Ham_TakeDamage, "player", "fw_TakeDamage");

And down:

Code:

public fw_TakeDamage(victim, inflictor, attacker, Float:damage, damage_type) {
    if((get_user_weapon(attacker) == CSW_KNIFE && is_user_assassin[attacker]) || (get_user_weapon(attacker) == CSW_AWP && is_user_sniper[attacker])) {
        SetHamParamFloat(4, damage * 999)
    }
    return HAM_IGNORED;
}

(example)

Please help me

yokomo 01-05-2013 12:40

Re: fw_TakeDamage
 
PHP Code:

public fw_TakeDamage(victiminflictorattackerFloat:damagedamage_type)

    if(!
is_user_connected(attacker)) return HAM_IGNORED;
    if((
get_user_weapon(attacker) == CSW_KNIFE && is_user_assassin[attacker]) || (get_user_weapon(attacker) == CSW_AWP && is_user_sniper[attacker]))
    {
        
SetHamParamFloat(4damage 999)
    }
    return 
HAM_IGNORED;




All times are GMT -4. The time now is 13:41.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.