Achei essa sma na alliedmoders o q eu queria modifica e n consigoh e q o zombie quando nascer ou quando foi infectado ja vim com furia sem precisar aperta botao nenhum acionar automatico!!! se alguem ouder ajudar ae vlw
Código:
#include <amxmodx>
#include <fakemeta>
#include < fun >
#include <hamsandwich>
#include <zombieplague>
enum (+=1337)
{
TASK_AURA,
TASK_GLOW
}
#define ID_AURA (taskid - TASK_AURA)
#define ID_GLOW (taskid - TASK_GLOW)
#define CHAT_PREFIX "[ZP]"
new const VERSION[] = "1.3"
new const RAGE_SOUND[] = "zombie_plague/zombie_rage.wav"
new const TRAIL_SPRITE[] = "sprites/laserbeam.spr"
new const zclass_name[] = "Rage Zombie"
new const zclass_info[] = " - Hot tempered"
new const zclass_model[] = "zombie_source"
new const zclass_clawmodel[] = "v_knife_zombie.mdl"
const zclass_health = 1800
const zclass_speed = 190
const Float:zclass_gravity = 1.0
const Float:zclass_knockback = 1.0
const OFFSET_PAINSHOCK = 108
const OFFSET_LINUX = 5
const Float: RENDERING_DELAY = 3.0
new g_zclass_rage, g_trailsprite
new r, g, b, amount, radius, Float:maxspeed
new cvar_duration, cvar_cooldown, cvar_rgb, cvar_radius, cvar_maxspeed, cvar_rageaddhealth, cvar_ragemultiplier, cvar_painshockfree, cvar_trailbrightness, cvar_trailsize, cvar_traillife
new bool:DmgAllowed
new Float:g_hookTime[33]
new g_msgSayText
new g_bitConnectedPlayers, g_bitAlivePlayers, g_bitIsRagePlayers, g_bitInRagePlayers, g_bitOMFGspamPlayers
#define MarkUserConnected(%0) g_bitConnectedPlayers |= (1 << (%0 & 31))
#define ClearUserConnected(%0) g_bitConnectedPlayers &= ~(1 << (%0 & 31))
#define IsUserConnected(%0) g_bitConnectedPlayers & (1 << (%0 & 31))
#define MarkUserAlive(%0) g_bitAlivePlayers |= (1 << (%0 & 31))
#define ClearUserAlive(%0) g_bitAlivePlayers &= ~(1 << (%0 & 31))
#define IsUserAlive(%0) g_bitAlivePlayers & (1 << (%0 & 31))
#define MarkUserIsRage(%0) g_bitIsRagePlayers |= (1 << (%0 & 31))
#define ClearUserIsRage(%0) g_bitIsRagePlayers &= ~(1 << (%0 & 31))
#define IsUserIsRage(%0) g_bitIsRagePlayers & (1 << (%0 & 31))
#define MarkUserInRage(%0) g_bitInRagePlayers |= (1 << (%0 & 31))
#define ClearUserInRage(%0) g_bitInRagePlayers &= ~(1 << (%0 & 31))
#define IsUserInRage(%0) g_bitInRagePlayers & (1 << (%0 & 31))
#define MarkUserOMFGspam(%0) g_bitOMFGspamPlayers |= (1 << (%0 & 31))
#define ClearUserOMFGspam(%0) g_bitOMFGspamPlayers &= ~(1 << (%0 & 31))
#define IsUserOMFGspam(%0) g_bitOMFGspamPlayers & (1 << (%0 & 31))
public plugin_init()
{
register_plugin("[ZP] Zombie Class: Rage Zombie", VERSION, "eXcalibur.007")
cvar_duration = register_cvar("zp_rage_duration", "8.0")
cvar_cooldown = register_cvar("zp_rage_cooldown", "25.0")
// RRR GGG BBB AAA - Red Green Blue Alpha
cvar_rgb = register_cvar("zp_rage_rgb", "255 0 0 16")
cvar_radius = register_cvar("zp_rage_radius", "20")
cvar_maxspeed = register_cvar("zp_rage_maxspeed", "300.0")
cvar_rageaddhealth = register_cvar("zp_rage_addhealth", "300")
cvar_ragemultiplier = register_cvar("zp_rage_dmgmultiplier", "2.0")
cvar_painshockfree = register_cvar("zp_rage_painshockfree", "1")
cvar_trailbrightness = register_cvar("zp_rage_trailbrightness", "255")
cvar_trailsize = register_cvar("zp_rage_trailsize", "5")
cvar_traillife = register_cvar("zp_rage_traillife", "2")
register_forward(FM_CmdStart, "fw_CmdStart")
register_forward(FM_PlayerPreThink, "fw_PlayerPreThink")
RegisterHam(Ham_Spawn, "player", "fw_PlayerSpawn_Post", 1)
RegisterHam(Ham_Killed, "player", "fw_PlayerKilled_Post", 1)
RegisterHam(Ham_TakeDamage, "player", "fw_PlayerTakeDamage")
RegisterHam(Ham_TakeDamage, "player", "fw_PlayerTakeDamage_Post", 1)
g_msgSayText = get_user_msgid("SayText")
}
public plugin_precache()
{
g_zclass_rage = zp_register_zombie_class(zclass_name, zclass_info, zclass_model, zclass_clawmodel, zclass_health, zclass_speed, zclass_gravity, zclass_knockback)
precache_sound(RAGE_SOUND)
g_trailsprite = precache_model(TRAIL_SPRITE)
}
public client_putinserver(id)
{
MarkUserConnected(id)
}
public client_disconnect(id)
{
ClearUserConnected(id)
ClearUserAlive(id)
ClearUserIsRage(id)
ClearUserInRage(id)
ClearUserOMFGspam(id)
}
public fw_CmdStart(id, uc_handle, seed)
{
if (IsUserAlive(id) && IsUserIsRage(id))
{
if (IsUserInRage(id) || IsUserOMFGspam(id))
return FMRES_IGNORED
static buttons; buttons = get_uc(uc_handle, UC_Buttons)
if (buttons & IN_RELOAD)
{
static Float: cooldown
cooldown = get_pcvar_float(cvar_cooldown)
if (get_gametime() - g_hookTime[id] < cooldown)
{
MarkUserOMFGspam(id)
set_task(1.0, "reset_vars", id)
client_printcolor(id, "!g%s !yYou need to wait %.f0 sec to use rage!", CHAT_PREFIX, cooldown - (get_gametime() - g_hookTime[id]))
return FMRES_IGNORED
}
g_hookTime[id] = get_gametime()
MarkUserInRage(id)
emit_sound(id, CHAN_AUTO, RAGE_SOUND, VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
static color[32], szRed[4], szGreen[4], szBlue[4], szAmount[4]
get_pcvar_string(cvar_rgb, color, 31)
parse(color, szRed, 3, szGreen, 3, szBlue, 3, szAmount, 3)
set_user_health(id, get_user_health(id) + get_pcvar_num(cvar_rageaddhealth))
set_task(get_pcvar_float(cvar_duration), "stop_raging", id)
r = clamp(str_to_num(szRed), 0, 255)
g = clamp(str_to_num(szGreen), 0, 255)
b = clamp(str_to_num(szBlue), 0, 255)
amount = str_to_num(szAmount)
radius = get_pcvar_num(cvar_radius)
maxspeed = get_pcvar_float(cvar_maxspeed)
set_user_rendering(id, kRenderFxGlowShell, r, g, b, kRenderNormal, amount)
message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
write_byte(TE_BEAMFOLLOW)
write_short(id)
write_short(g_trailsprite)
write_byte(get_pcvar_num(cvar_traillife) * 10)
write_byte(get_pcvar_num(cvar_trailsize))
write_byte(r)
write_byte(g)
write_byte(b)
write_byte(get_pcvar_num(cvar_trailbrightness))
message_end()
set_task(RENDERING_DELAY, "set_glow", id+TASK_GLOW, _, _, "b")
set_task(0.1, "rage_aura", id+TASK_AURA, _, _, "b")
}
}
return FMRES_IGNORED
}
public fw_PlayerPreThink(id)
{
if (IsUserAlive(id) && IsUserIsRage(id) && IsUserInRage(id))
{
set_user_maxspeed(id, maxspeed)
}
return FMRES_IGNORED
}
public fw_PlayerSpawn_Post(id)
{
if (is_user_alive(id))
{
MarkUserAlive(id)
ClearUserIsRage(id)
ClearUserInRage(id)
}
}
public fw_PlayerKilled_Post(victim)
{
ClearUserAlive(victim)
ClearUserIsRage(victim)
ClearUserInRage(victim)
}
public fw_PlayerTakeDamage(victim, inflictor, attacker, Float:damage, damagebits)
{
if (DmgAllowed && IsUserAlive(attacker) && IsUserAlive(victim) && IsUserInRage(attacker))
{
SetHamParamFloat(4, damage * get_pcvar_float(cvar_ragemultiplier))
}
return HAM_IGNORED
}
public fw_PlayerTakeDamage_Post(victim, inflictor, attacker)
{
if (victim != attacker && IsUserIsRage(victim) && IsUserInRage(victim) && IsUserAlive(victim) && get_pcvar_num(cvar_painshockfree))
{
set_pdata_float(victim, OFFSET_PAINSHOCK, 1.0, OFFSET_LINUX)
}
return HAM_IGNORED
}
public zp_user_infected_post(id, infector)
{
if (zp_get_user_zombie_class(id) == g_zclass_rage && !zp_get_user_nemesis(id))
{
client_printcolor(id, "!g%s !yPress your !greload button !yto use rage", CHAT_PREFIX)
MarkUserIsRage(id)
ClearUserInRage(id)
}
}
public zp_user_humanized_post(id)
{
ClearUserIsRage(id)
ClearUserInRage(id)
if (IsUserAlive(id))
{
set_user_rendering(id)
message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
write_byte(TE_KILLBEAM)
write_short(id)
message_end()
}
}
public zp_round_started(gamemode)
{
if (gamemode == MODE_SWARM || gamemode == MODE_PLAGUE || gamemode == MODE_SURVIVOR)
DmgAllowed = true
else
DmgAllowed = false
}
public set_glow(taskid)
{
if (IsUserAlive(ID_GLOW) && IsUserIsRage(ID_GLOW) && IsUserInRage(ID_GLOW))
{
set_user_rendering(ID_GLOW, kRenderFxGlowShell, r, g, b, kRenderNormal, amount)
}
else
{
remove_task(taskid)
return
}
}
public stop_raging(id)
{
if (IsUserAlive(id))
{
ClearUserInRage(id)
set_user_rendering(id)
client_printcolor(id, "!g%s !yYour rage has worn off", CHAT_PREFIX)
message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
write_byte(TE_KILLBEAM)
write_short(id)
message_end()
remove_task(id+TASK_GLOW)
}
}
public rage_aura(taskid)
{
if (IsUserInRage(ID_AURA) && IsUserAlive(ID_AURA))
{
static origin[3]
get_user_origin(ID_AURA, origin)
// I hook the cvars before this task so they wont be called every 0.1 second. That would be awful :(
message_begin(MSG_PVS, SVC_TEMPENTITY, origin)
write_byte(TE_DLIGHT)
write_coord(origin[0])
write_coord(origin[1])
write_coord(origin[2])
write_byte(radius)
write_byte(r)
write_byte(g)
write_byte(b)
write_byte(2)
write_byte(0)
message_end()
}
else
{
remove_task(taskid)
return
}
}
public reset_vars(id)
{
if (IsUserConnected(id))
ClearUserOMFGspam(id)
}
stock client_printcolor(const id, const input[ ], any:...)
{
new count = 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, "!ctr", "^3")
// replace_all(szMsg, 190, "!w", "^0")
if (id)
iPlayers[0] = id
else
get_players(iPlayers, count, "ch")
for (new i = 0; i < count; i++)
{
if (IsUserConnected(iPlayers[i]))
{
message_begin(MSG_ONE_UNRELIABLE, g_msgSayText, _, iPlayers[i])
write_byte(iPlayers[i])
write_string(szMsg)
message_end()
}
}
}