Raised This Month: $ Target: $400
 0% 

Forward TakeDamage Doesn´t work


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
S34Qu4K3
Veteran Member
Join Date: Jan 2010
Location: Galicia
Old 08-19-2010 , 10:40   Forward TakeDamage Doesn´t work
Reply With Quote #1

I´m making an extra item for Zombie Plague, but when I buy the extra item nothing happens, only show me the first client print

Full Code:
PHP Code:
#include <amxmodx> 
#include <amxmisc>
#include <zombieplague> 
#include <hamsandwich>

new g_thief
new boolthief_active[33]

public 
plugin_init()
{
    
    
register_plugin("[ZP] Extra Item: Ammo Packs Thief""1.0""S34Qu4K3"
    
g_thief zp_register_extra_item("Ammo Packs Thief"10ZP_TEAM_HUMAN
    
register_dictionary("zp_extra_ap_thief.txt")
    
RegisterHam(Ham_TakeDamage"player""fw_TakeDamage"1)
    
}

public 
zp_extra_item_selected(iditemid
{
    if (
itemid == g_thief
    {

    
thief_active[id] = true
    client_print
(idprint_chat"In your next hit you will try to stole AmmoPacks from your victim")

    }
}  
public 
fw_TakeDamage(victiminflictorattackerFloat:damagedamage_type,id)
{
       
         if (
victim == attacker || ZP_TEAM_HUMAN)  
        return 
HAM_IGNORED
    
    
static damdam floatround(damage)
    
    new 
inflictorsap zp_get_user_ammo_packs(inflictor)
    new 
victimsap zp_get_user_ammo_packs(victim)
    
    
    if(
thief_active[id])
    {
        return 
HAM_IGNORED
    
}
    else
    {
        if(
dam <= 20)
        {
            if(
victimsap >= 1)
            {
                
zp_set_user_ammo_packs(victimvictimsap 1)
                
zp_set_user_ammo_packs(inflictorinflictorsap 1)
            }
            else
            {
                
client_print(idprint_chat"You haven't steal anything ")
            }
        }
        else if(
dam >= 40 && dam <= 59)
        {
            if(
victimsap >= 3)
            {
                
zp_set_user_ammo_packs(victimvictimsap 3)
                
zp_set_user_ammo_packs(inflictorinflictorsap 3)
            }
            else
            {
                
client_print(idprint_chat"You haven't steal anything ")
            }
        }
        else if(
dam >= 60 && dam <= 79)
        {
            if(
victimsap >= 5)
            {
                
zp_set_user_ammo_packs(victimvictimsap 5)
                
zp_set_user_ammo_packs(inflictorinflictorsap 5)
            }
            else
            {
                
client_print(idprint_chat"You haven't steal anything ")
            }
        }
        else if(
dam >= 80 && dam <= 99)
        {
            if(
victimsap >= 6)
            {
                
zp_set_user_ammo_packs(victimvictimsap 6)
                
zp_set_user_ammo_packs(inflictorinflictorsap 6)
            }
            else
            {
                
client_print(idprint_chat"You haven't steal anything ")
            }
        }
        else if(
dam >= 100 && dam <= 119)
        {
            if(
victimsap >= 8)
            {
                
zp_set_user_ammo_packs(victimvictimsap 8)
                
zp_set_user_ammo_packs(inflictorinflictorsap 8)
            }
            else
            {
                
client_print(idprint_chat"You haven't steal anything ")
            }
        }
        else if(
dam >= 120 && dam <= 149)
        {
            if(
victimsap >= 10)
            {
                
zp_set_user_ammo_packs(victimvictimsap 10)
                
zp_set_user_ammo_packs(inflictorinflictorsap 10)
            }
            else
            {
                
client_print(idprint_chat"You haven't steal anything ")
            }
        }
        else if(
dam >= 150 && dam <= 199)
        {
            if(
victimsap >= 10)
            {
                
zp_set_user_ammo_packs(victimvictimsap 12)
                
zp_set_user_ammo_packs(inflictorinflictorsap 12)
            }
            else
            {
                
client_print(idprint_chat"You haven't steal anything ")
            }
        }
        else if(
dam >= 200 && dam <= 499)
        {
            if(
victimsap >= 10)
            {
                
zp_set_user_ammo_packs(victimvictimsap 15)
                
zp_set_user_ammo_packs(inflictorinflictorsap 15)
            }
            else
            {
                
client_print(idprint_chat"You haven't steal anything ")
            }
        }
        
thief_active[id] = true
    
}
    return 
PLUGIN_CONTINUE
        

__________________

- ASM2SMA: Experimental AMXX Assembly encoder

- Defuse Bar Fix

Quote:
Originally Posted by Arkshine
I DON'T WANT TO SEE NOOOOOOOOOOOOOOO AHHHHH. MY EYES ARE ALREADY HURT.
S34Qu4K3 is offline
 



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 21:59.


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