Raised This Month: $ Target: $400
 0% 

fw_TakeDamage


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Miljan9
Member
Join Date: Dec 2011
Location: Belgrade / Serbia
Old 01-05-2013 , 08:51   fw_TakeDamage
Reply With Quote #1

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
__________________
Hi I'm from Serbian and i don't speak English good.

Last edited by Miljan9; 01-05-2013 at 08:51.
Miljan9 is offline
yokomo
Surprise Ascot!
Join Date: May 2010
Location: Malaysia
Old 01-05-2013 , 12:40   Re: fw_TakeDamage
Reply With Quote #2

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;

__________________
Team-MMG CS1.6 Servers:
✅ MultiMod -- 103.179.44.152:27016
✅ Zombie Plague -- 103.179.44.152:27015
✅ Zombie Escape -- 103.179.44.152:27017
✅ Klassik Kombat -- 103.179.44.152:27018
✅ Boss-Battle -- 103.179.44.152:27019
yokomo is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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