hello, can someone tell me why this doesnt work ?
should work like this: when you do headshot, get 15 hp (cvar)
and Kill should be 5 hp (cvar)
PHP Code:
#include <amxmodx>
#include <fun>
#define VERSION "1.0.1"
new cvar_hs;
new cvar_kill;
public plugin_init()
{
register_plugin("Headshot", VERSION, "afro-ankan")
register_event("DeathMsg", "eDeath", "a");
cvar_hs = register_cvar( "amx_hs", "15" )
cvar_kill = register_cvar( "amx_kill", "5" )
}
public fw_GotKilled( )
{
register_plugin("Headshot", VERSION, "Zpoke")
new iAttacker = read_data(1);
new iHeadshot = read_data(3);
if( iHeadshot )
{
set_user_health( iAttacker, get_user_health( iAttacker ) + get_pcvar_num( cvar_kill ) )
}
else
{
set_user_health( iAttacker, get_user_health( iAttacker ) + get_pcvar_num( cvar_hs ) )
}
}
__________________