Funcoes : Pode ver o Player atraves das parede ate ums 400 milimetros de destançia
Obs : Nao Coloquei Skin do Zombie
Obs : Vini;* q me deu esse Nome para o Zombie rsrs'
Print do Zombie:
- Código:
#include <amxmodx>
#include <engine>
#include < xs >
#include <zombieplague>
new Float:g_fDelay[33]
new g_CrawlerOn[33]
new sprite_playerheat
new cvar_enable
new cvar_maxdistance
new cvar_updatedelay
new g_zclass_crawler
// Zombie crawler
new const zclass_name[] = { "Zombie Crawler" }
new const zclass_info[] = { "Pode Ver atraves das paredes" }
new const zclass_model[] = { "zombie_source" } // model
new const zclass_clawmodel[] = { "v_knife_zombie.mdl" }
const zclass_health = 2800
const zclass_speed = 255
const Float:zclass_gravity = 1.0
const Float:zclass_knockback = 0.8
static const PLUGIN_NAME[] = "Zombie Crawler"
static const PLUGIN_AUTHOR[] = "MtsLa!<3.L"
static const PLUGIN_VERSION[] = "1.0"
public plugin_init()
{
register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR)
register_cvar(PLUGIN_NAME, PLUGIN_VERSION, FCVAR_SPONLY|FCVAR_SERVER)
cvar_enable = register_cvar("amx_tig_enable", "1")
cvar_maxdistance = register_cvar("amx_tig_distance", "400")
cvar_updatedelay = register_cvar("amx_tig_updatedelay", "0.4")
register_event("NVGToggle", "Event_NVGToggle", "be")
}
public plugin_precache()
{
sprite_playerheat = precache_model("sprites/poison.spr")
g_zclass_crawler = zp_register_zombie_class(zclass_name, zclass_info, zclass_model, zclass_clawmodel, zclass_health, zclass_speed, zclass_gravity, zclass_knockback)
}
public Event_NVGToggle(id)
g_CrawlerOn[id] = read_data(1)
public client_PostThink(id)
{
if(!is_user_alive(id) || !zp_get_user_zombie(id)) return PLUGIN_CONTINUE
if(zp_get_user_zombie_class(id) != g_zclass_crawler) return PLUGIN_CONTINUE
if((g_fDelay[id] + get_pcvar_float(cvar_updatedelay)) > get_gametime())
return PLUGIN_CONTINUE
g_fDelay[id] = get_gametime()
new Float:fMyOrigin[3]
entity_get_vector(id, EV_VEC_origin, fMyOrigin)
static Players[32], iNum
get_players(Players, iNum, "a")
for(new i = 0; i < iNum; ++i) if(id != Players[i])
{
new target = Players[i]
new Float:fTargetOrigin[3]
entity_get_vector(target, EV_VEC_origin, fTargetOrigin)
if((get_distance_f(fMyOrigin, fTargetOrigin) > get_pcvar_num(cvar_maxdistance))
|| !is_in_viewcone(id, fTargetOrigin))
continue
new Float:fMiddle[3], Float:fHitPoint[3]
xs_vec_sub(fTargetOrigin, fMyOrigin, fMiddle)
trace_line(-1, fMyOrigin, fTargetOrigin, fHitPoint)
new Float:fWallOffset[3], Float:fDistanceToWall
fDistanceToWall = vector_distance(fMyOrigin, fHitPoint) - 10.0
normalize(fMiddle, fWallOffset, fDistanceToWall)
new Float:fSpriteOffset[3]
xs_vec_add(fWallOffset, fMyOrigin, fSpriteOffset)
new Float:fScale, Float:fDistanceToTarget = vector_distance(fMyOrigin, fTargetOrigin)
if(fDistanceToWall > 100.0)
fScale = 8.0 * (fDistanceToWall / fDistanceToTarget)
else
fScale = 2.0
te_sprite(id, fSpriteOffset, sprite_playerheat, floatround(fScale), 125)
}
return PLUGIN_CONTINUE
}
stock te_sprite(id, Float:origin[3], sprite, scale, brightness)
{
message_begin(MSG_ONE, SVC_TEMPENTITY, _, id)
write_byte(TE_SPRITE)
write_coord(floatround(origin[0]))
write_coord(floatround(origin[1]))
write_coord(floatround(origin[2]))
write_short(sprite)
write_byte(scale)
write_byte(brightness)
message_end()
}
stock normalize(Float:fIn[3], Float:fOut[3], Float:fMul)
{
new Float:fLen = xs_vec_len(fIn)
xs_vec_copy(fIn, fOut)
fOut[0] /= fLen, fOut[1] /= fLen, fOut[2] /= fLen
fOut[0] *= fMul, fOut[1] *= fMul, fOut[2] *= fMul
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1046\\ f0\\ fs16 \n\\ par }
*/