步聚1: RegisterHam(Ham_Think, "info_target", "fw_Think_Camp")
设定名称:
campfireEnt = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString,"info_target"));
set_pev(campfireEnt, pev_classname, "campfire");
步聚2:
public fw_Think_Camp(campfireEnt)
{
static Float:originF [ 3 ]
pev (campfireEnt, pev_origin, originF)
if(!pev_valid(campfireEnt))
return HAM_IGNORED
static classname[32]
pev(campfireEnt, pev_classname, classname, 31)
if (equali(classname, "campfire"))
{
engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, originF, 0)
write_byte(TE_DLIGHT)
engfunc(EngFunc_WriteCoord, originF[0])
engfunc(EngFunc_WriteCoord, originF[1])
engfunc(EngFunc_WriteCoord, originF[2])
write_byte(5)
write_byte(255)
write_byte(210)
write_byte(2)
write_byte(2)
write_byte(0)
message_end()
entity_set_float(campfireEnt, EV_FL_nextthink, halflife_time() + 0.1)
return HAM_SUPERCEDE
}
return PLUGIN_CONTINUE
}
可是没效果