how do add sprite?
Help please, how to add a sprite to play this plugin?
PHP Code:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <fakemeta>
#include <zombieplague>
#define PLUGIN "Healing skill"
#define VERSION "1.0"
#define AUTHOR "teo"
new cvar_active, cvar_time, cvar_amount
new Float:user_time[32]
new bool:can_heal[32]
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
cvar_active = register_cvar("zp_zombie_heal_enable", "1")
cvar_time = register_cvar("zp_zombie_time", "5.0")
cvar_amount = register_cvar("zp_zombie_heal_amount","200.0")
register_forward(FM_PlayerPreThink, "fm_pthink")
}
public plugin_precache()
{
precache_sound("zombie_plague/zombi_heal.wav")
}
public fm_pthink(id)
{
if (!get_cvar_num("zp_on"))
return FMRES_IGNORED
if ( zp_get_user_nemesis(id) || zp_get_user_survivor(id))
return FMRES_IGNORED
if (!zp_get_user_zombie(id))
return FMRES_IGNORED
if (!is_user_alive(id))
return FMRES_IGNORED
if (!get_pcvar_num(cvar_active))
return FMRES_IGNORED
new button = pev(id, pev_button)
if (button & IN_MOVELEFT || button & IN_MOVERIGHT || button & IN_FORWARD || button & IN_BACK || button & IN_JUMP)
can_heal[id] = false
if (!(button & IN_MOVELEFT || button & IN_MOVERIGHT || button & IN_FORWARD || button & IN_BACK || button & IN_JUMP))
{
if (!can_heal[id])
{
can_heal[id] = true
user_time[id] = get_gametime()
}
if (can_heal[id])
{
new Float:current_time = get_gametime()
if (current_time - user_time[id] >= get_pcvar_float(cvar_time))
{
rehealth(id)
can_heal[id] = false
}
}
}
return FMRES_HANDLED
}
public rehealth(id)
{
new health = pev(id, pev_health)
if (health < zp_get_zombie_maxhealth(id))
{
if (health + get_pcvar_float(cvar_amount) < zp_get_zombie_maxhealth(id))
{
set_pev(id, pev_health, pev(id, pev_health) + get_pcvar_float(cvar_amount))
emit_sound(id, CHAN_BODY, "zombie_plague/zombi_heal.wav", 1, ATTN_NORM, 0, PITCH_NORM)
}
else
{
set_pev(id, pev_health, float(zp_get_zombie_maxhealth(id)))
emit_sound(id, CHAN_BODY, "zombie_plague/zombi_heal.wav", 1, ATTN_NORM, 0, PITCH_NORM)
}
}
}
|