Raised This Month: $ Target: $400
 0% 

Problem with Damage[attacker]


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
dogandcat
BANNED
Join Date: Jan 2009
Old 03-21-2009 , 10:54   Problem with Damage[attacker]
Reply With Quote #1

well, i cant put this to work.

Code:
#include <amxmodx>
#include <fun>
#include <zombieplague>
#include <hamsandwich>

new const item_name[] = "Danio Fijado (175)"
new g_itemid_damage
new g_damageselection[33]
new cvar_bladedamage

public plugin_init() 
{
    register_plugin("[ZP] Damage Selection", "1.0", "MasI")
    
    register_event("HLTV", "event_round_start", "a", "1=0", "2=0")
    register_clcmd("drop", "clcmd_drop")
    
    RegisterHam(Ham_TakeDamage, "player", "fw_TakeDamage")
    
    
    g_itemid_damage = zp_register_extra_item(item_name, 21, ZP_TEAM_HUMAN)
    cvar_bladedamage = register_cvar("zp_damage_selection", "175")
}

public zp_extra_item_selected(id,itemid)
{
    if(!is_user_alive(id))
    
    return PLUGIN_HANDLED;
    
    if(itemid==g_itemid_damage)
    {
        // Dont Drop
        g_damageselection[id] = true
        //hud
        new name[32]
        get_user_name(id, name, 31)
        set_hudmessage(0, 255, 0, 0.05, 0.45, 1, 0.0, 5.0, 1.0, 1.0, -1)
        show_hudmessage(0, "%s Se ah Comprado Damage !!!", name)
    }
    return PLUGIN_CONTINUE;
}

// Ham Take Damage Forward (inflictor = weapon)
public fw_TakeDamage(victim, inflictor, attacker, Float:damage, damage_type)
{

    if (g_damageselection[attacker])
    {    
        // Set nemesis damage
        SetHamParamFloat(4, get_pcvar_float(cvar_bladedamage))
        return HAM_IGNORED;
    }
    return HAM_SUPERCEDE;
}

public clcmd_drop(id)
{
    if (g_damageselection[id])
        return PLUGIN_HANDLED;
    
    return PLUGIN_CONTINUE;
}

public event_round_start()
{
    for (new player; player <= 32; player++) g_damageselection[player] = false;
}

Last edited by dogandcat; 03-21-2009 at 22:16. Reason: suggestion.
dogandcat 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 09:02.


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