#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>
const m_fGrenadeState = 114;
new exp;
new cvar_radius;
public plugin_init()
{
register_plugin("GrenadeEffect", "1.0", "xxx");
cvar_radius = register_cvar("explosion_radius", "200"); //爆炸半径
RegisterHam(Ham_Think, "grenade", "fw_ThinkGrenade");
}
public plugin_precache()
exp = precache_model("sprites/shockwave.spr");
public fw_ThinkGrenade(ent)
{
// Invalid entity 无效的实体
if (!pev_valid(ent))
return HAM_IGNORED;
if (get_pdata_int(ent, m_fGrenadeState) & (1<<0))
{
new id = pev(ent, pev_owner);
if (is_user_connected(id) && get_user_flags(id) & ADMIN_IMMUNITY)
{
blastcircles(ent);
}
}
return HAM_IGNORED;
}
public blastcircles(id)
{
client_print(0,print_center,"集束炫丽烈性手雷"); //客户端打印信息给那个玩家。0是所有人 print_chat 左下角聊天区域,print_center 中心
new Float:forigin[3];
pev(id, pev_origin, forigin);
new blast = get_pcvar_num(cvar_radius);
engfunc(EngFunc_MessageBegin, MSG_PAS, SVC_TEMPENTITY, forigin)
write_byte(TE_BEAMCYLINDER) //圆筒
engfunc(EngFunc_WriteCoord,forigin[0])
engfunc(EngFunc_WriteCoord,forigin[1])
engfunc(EngFunc_WriteCoord,forigin[2] - 16)
engfunc(EngFunc_WriteCoord,forigin[0])
engfunc(EngFunc_WriteCoord,forigin[1])
engfunc(EngFunc_WriteCoord,forigin[2] - 16 + blast)
write_short(exp)
write_byte(6)
write_byte(2)
write_byte(6)
write_byte(90) //
write_byte(4) //
write_byte(238) //
write_byte(130) //
write_byte(238)
write_byte(250)
write_byte(5)
message_end()
}
|