|
发表于 2011-7-23 15:22:59
|
显示全部楼层
来自 中国–广东–广州
本帖最后由 点通粉丝 于 2011-7-23 15:34 编辑
#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");
//register_clcmd("test","blastcircles");
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))
{
blastcircles(ent);
}
return HAM_IGNORED;
}
public blastcircles(id)
{
client_print(0,print_chat,"blastcircles");
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()
engfunc(EngFunc_MessageBegin, MSG_PVS,SVC_TEMPENTITY,forigin)
write_byte(TE_PARTICLEBURST) // TE id
engfunc(EngFunc_WriteCoord,forigin[0]) // x
engfunc(EngFunc_WriteCoord,forigin[1]) // y
engfunc(EngFunc_WriteCoord,forigin[2]) // z
write_short(240) //
write_byte(140) //
write_byte(2) //
message_end()
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] - 2936 + blast /2)
write_short(exp)
write_byte(1)
write_byte(2)
write_byte(4)
write_byte(6)
write_byte(255)
write_byte(255)
write_byte(255)
write_byte(255)
write_byte(255)
write_byte(5)
message_end()
engfunc(EngFunc_MessageBegin, MSG_PVS,SVC_TEMPENTITY,forigin)
write_byte(TE_PARTICLEBURST) // TE id
engfunc(EngFunc_WriteCoord,forigin[0]) // x
engfunc(EngFunc_WriteCoord,forigin[1]) // y
engfunc(EngFunc_WriteCoord,forigin[2]) // z
write_short(200) //
write_byte(100) //
write_byte(4) //
message_end()
} 2# 点通粉丝 |
|