[ZP] Classe: Quebra Colete
Descrição:
Infecte Humanos com 1 tapa com ou sem Colete Anti-Infecção
Infecte Humanos com 1 tapa com ou sem Colete Anti-Infecção
SMA:
Código:
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>
#include <zombieplague>
new g_class_quebra_col, allow_infect
new const zclass_name[] = { "Zombie Quebra Colete" }
new const zclass_info[] = { "Infecta em um tapa" }
new const zclass_model[] = { "zombie_source" }
new const zclass_clawmodel[] = { "v_knife_zombie.mdl" }
const zclass_health = 1200
const zclass_speed = 300
const Float:zclass_gravity = 0.78
const Float:zclass_knockback = 1.0
public plugin_init()
{
register_plugin("[ZP] Class: Quebra Colete", "1.0", "[P]erfec[T] [S]cr[@]s[H]")
RegisterHam(Ham_TakeDamage, "player", "fw_TakeDamage")
}
public plugin_precache()
g_class_quebra_col = zp_register_zombie_class(zclass_name, zclass_info, zclass_model, zclass_clawmodel, zclass_health, zclass_speed, zclass_gravity, zclass_knockback)
public zp_user_infected_post(id)
{
if (zp_get_user_zombie_class(id) == g_class_quebra_col && !zp_get_user_nemesis(id))
client_printcolor(id, "!g[ZP]!y Voce Esta Com Zombie Quebra Colete. Agora pode infectar em um Tapa")
}
public fw_TakeDamage(victim, inflictor, attacker, Float:damage, damage_type)
{
if(!zp_get_user_zombie(victim) && get_user_armor(victim) > 0 && zp_get_user_zombie_class(attacker) == g_class_quebra_col && allow_infect)
{
zp_infect_user(victim)
SendDeathMsg(attacker, victim)
FixDeadAttrib(victim)
}
}
public zp_round_started(gm)
{
if(gm == MODE_INFECTION || gm == MODE_MULTI) allow_infect = true
else allow_infect = false
}
// Pra aparecer o bang de quem matou quem no canto de cima
SendDeathMsg(attacker, victim)
{
message_begin(MSG_BROADCAST, get_user_msgid("DeathMsg"))
write_byte(attacker) // killer
write_byte(victim) // victim
write_byte(1) // headshot flag
write_string("Quebra Colete") // killer's weapon
message_end()
}
// Pra nao bugar
FixDeadAttrib(id)
{
message_begin(MSG_BROADCAST, get_user_msgid("ScoreAttrib"))
write_byte(id) // id
write_byte(0) // attrib
message_end()
}
// Mensagem Colorida (client_printcolor)
stock client_printcolor(const id, const input[], any:...)
{
new count = 1, players[32]
static msg[191]
vformat(msg, 190, input, 3)
replace_all(msg, 190, "!g", "^4") // Chat Verde
replace_all(msg, 190, "!y", "^1") // Chat Normal
replace_all(msg, 190, "!t", "^3") // Chat Do Time Tr=Vermelho Ct=Azul Spec=Branco
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();
}
}
}
}