Nome da Classe : Crawler
Habilidade : Ducka sem parar
Creditos : AlliedModders
Download : Link Direto
Habilidade : Ducka sem parar
Creditos : AlliedModders
Download : Link Direto
Código:
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>
#include <zombie_plague_advance>
new const zclass_name[] = "Crawl Zombie"
new const zclass_info[] = "Full-Time Duck"
new const zclass_model[] = "zombie_scrawler"
new const zclass_clawmodel[] = "v_knife_zombie.mdl"
const zclass_health = 957
const zclass_speed = 975
const Float:zclass_gravity = 0.5
const Float:zclass_knockback = 1.15
new g_zcrawl
new g_ducked[33]
new g_maxplayers, g_maxspeed
public plugin_init()
{
register_event("HLTV", "event_round_start", "a", "1=0", "2=0")
register_logevent("logevent_round_end", 2, "1=Round_End")
register_forward(FM_PlayerPreThink, "fw_PlayerPreThink")
RegisterHam(Ham_Killed, "player", "fw_PlayerKilled")
g_maxplayers = get_maxplayers()
g_maxspeed = get_cvar_pointer("sv_maxspeed")
}
public plugin_precache()
{
register_plugin("[ZP] Zombie Class: Crawler", "1.4", "93()|29!/<")
g_zcrawl = 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,infector, nemesis)
{
if (nemesis)
{
unduck_player(id)
g_ducked[id] = false
return;
}
new assassin
if (assassin)
{
unduck_player(id)
g_ducked[id] = false
return;
}
if (zp_get_user_zombie_class(id) != g_zcrawl)
{
g_ducked[id] = false
return;
}
client_cmd(id, "cl_forwardspeed %d; cl_backspeed %d; cl_sidespeed %d", Float:zclass_speed, Float:zclass_speed, Float:zclass_speed)
g_ducked[id] = true
}
public zp_user_humanized_post(id, survivor)
{
unduck_player(id)
g_ducked[id] = false
}
public client_connect(id)
g_ducked[id] = false
public client_disconnect(id)
unduck_player(id)
public fw_PlayerPreThink(id)
{
if (zp_get_user_nemesis(id) || zp_get_user_assassin(id) || !zp_get_user_zombie(id) || is_user_bot(id)
|| zp_get_user_zombie_class(id) != g_zcrawl || !is_user_alive(id))
return;
set_pev(id, pev_bInDuck, 1)
client_cmd(id, "+duck")
g_ducked[id] = true
}
public fw_PlayerKilled(id)
{
unduck_player(id)
g_ducked[id] = false
}
public logevent_round_end()
{
static id
for (id = 1; id <= g_maxplayers; id++)
{
if (zp_get_user_nemesis(id) || zp_get_user_assassin(id) || !zp_get_user_zombie(id) || zp_get_user_zombie_class(id) != g_zcrawl || !is_user_alive(id))
g_ducked[id] = false
else
g_ducked[id] = true
}
}
public event_round_start()
{
if (get_pcvar_float(g_maxspeed) < Float:zclass_speed)
server_cmd("sv_maxspeed 99999")
static id
for (id = 1; id <= g_maxplayers; id++)
{
unduck_player(id)
g_ducked[id] = false
}
}
public unduck_player(id)
{
if (!g_ducked[id] || is_user_bot(id))
return;
set_pev(id, pev_bInDuck, 0)
client_cmd(id, "-duck")
client_cmd(id, "-duck")
}