Tai o Zombie Heal
OBS : NAO FOI EU QUE FIZ
OBS : NAO FOI EU QUE FIZ
- Código:
#include <amxmodx>
#include <fakemeta>
#include <zombieplague>
#define heal_sound "heal.wav"
new const zclass_name[] = "Zumbi Curandero"
new const zclass_info[] = "Aperta \r[G]"
new const zclass_model[] = "heal"
new const zclass_clawmodel[] = "v_heal_knife.mdl"
const zclass_health = 2500
const zclass_speed = 230
const Float:zclass_gravity = 0.9
const Float:zclass_knockback = 1.0
new g_zclass_heal;
new Float:last_use[33];
public plugin_init()
{
register_plugin("[ZP] Zombie Class: Heal Zombie", "0.1", "WPMG Team")
register_clcmd("drop", "use_skill")
}
public plugin_precache()
{
g_zclass_heal = zp_register_zombie_class(zclass_name, zclass_info, zclass_model, zclass_clawmodel, zclass_health, zclass_speed, zclass_gravity, zclass_knockback)
precache_sound(heal_sound)
}
public zp_user_infected_post(id, infector)
{
if(zp_get_user_zombie_class(id) == g_zclass_heal)
{
client_printcolor(id, "^4[BK] ^1Aperta ^4^"G^" ^1Para curar seu HP.")
last_use[id] = 0.0
}
}
public use_skill(id)
{
if(is_user_alive(id) && !zp_get_user_nemesis(id) && zp_get_user_zombie(id) && (zp_get_user_zombie_class(id) == g_zclass_heal))
{
if((pev(id, pev_health) < float(zp_get_zombie_maxhealth(id))) && (last_use[id] + 50.0 <= get_gametime()))
{
last_use[id] = get_gametime();
set_pev(id, pev_health, float(zp_get_zombie_maxhealth(id)))
emit_sound(id, CHAN_ITEM, heal_sound, 1.0, ATTN_NORM, 0, PITCH_NORM)
message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("ScreenFade"), { 0, 0, 0 }, id)
write_short(1<<10)
write_short(1<<12)
write_short(0x0000)
write_byte(50)
write_byte(150)
write_byte(50)
write_byte(200)
message_end()
return PLUGIN_HANDLED;
}
}
return PLUGIN_CONTINUE;
}
stock client_printcolor(const id, const input[], any:...)
{
new iCount = 1, iPlayers[32]
static szMsg[191]
vformat(szMsg, charsmax(szMsg), input, 3)
replace_all(szMsg, 190, "/g", "^4")
replace_all(szMsg, 190, "/y", "^1")
replace_all(szMsg, 190, "/t", "^3")
replace_all(szMsg, 190, "/w", "^0")
if(id) iPlayers[0] = id
else get_players(iPlayers, iCount, "ch")
for(new i = 0; i < iCount; i++)
{
if(is_user_connected(iPlayers[i]))
{
message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, iPlayers[i])
write_byte(iPlayers[i])
write_string(szMsg)
message_end()
}
}
}