Descrição: Quando o Jogador Mata 20 ZMs O Jogador é automaticamente convertido a ZM para morrer tambem :D
SMA:
- Código:
#include <amxmodx>
#include <zombieplague>
#define PLUGIN "[ZP] Addon: Anti-Apelao"
#define VERSION "1.0"
#define AUTHOR "[P]erfec[T] [S]cr[@]s[H]"
new allow_antiapelao, g_kills_count[33], cvar_kills_for_punnition
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_event("HLTV", "event_round_start", "a", "1=0", "2=0")
register_event("DeathMsg", "DeathEvent", "a");
cvar_kills_for_punnition = register_cvar("zp_kills_for_punnition", "20")
}
public client_putinserver(id) g_kills_count[id] = 0
public client_disconnect(id) g_kills_count[id] = 0
public zp_user_humanized_post(id) g_kills_count[id] = 0
public zp_user_infected_post(id) g_kills_count[id] = 0
public event_round_start() for(new id = 1; id <= get_maxplayers(); id++) g_kills_count[id] = 0
public zp_round_started(gm)
{
if(gm == MODE_INFECTION || gm == MODE_MULTI) allow_antiapelao = true
else allow_antiapelao = false
}
public DeathEvent()
{
new id = read_data(1)
if(!allow_antiapelao || zp_get_user_zombie(id)) return PLUGIN_HANDLED
if(g_kills_count[id] >= get_pcvar_num(cvar_kills_for_punnition))
{
zp_infect_user(id)
client_printcolor(id, "!g[ZP Anti-Apelao]!t Voce Virou ZM Por Apelar Muito !!")
g_kills_count[id] = 0
return PLUGIN_HANDLED
}
else if(g_kills_count[id] >= (get_pcvar_num(cvar_kills_for_punnition) - 5))
{
g_kills_count[id]++
client_printcolor(id, "!g[ZP Anti-Apelao]!t Cuidado Voce so pode Matar Mais !g%d!t ZMs.", get_pcvar_num(cvar_kills_for_punnition) - g_kills_count[id])
return PLUGIN_HANDLED
}
else g_kills_count[id]++
return PLUGIN_CONTINUE
}
stock client_printcolor(const id,const input[], any:...)
{
new msg[191], players[32], count = 1; vformat(msg,190,input,3);
replace_all(msg,190,"!g","^4"); // green
replace_all(msg,190,"!y","^1"); // normal
replace_all(msg,190,"!t","^3"); // team
if (id) players[0] = id; else get_players(players,count,"ch");
for (new i=0;i<count;i++)
{
if (is_user_connected(players[i]))
{
message_begin(MSG_ONE_UNRELIABLE,get_user_msgid("SayText"),_,players[i]);
write_byte(players[i]);
write_string(msg);
message_end();
}
}
}