Is it normally create ent in SetThink() via static ?)
PHP Code:
SetThink(entity, "Corpse_Sprite_Think");
set_entvar(entity, var_nextthink, get_gametime() + 0.1); // entity - it's a weaponbox
// ...
public Corpse_Sprite_Think(const iEnt)
{
static iEntSprite = NULLENT;
if ((get_entvar(iEnt, var_flags) & FL_ONGROUND)) {
if (!is_entity(iEntSprite)) {
iEntSprite = rg_create_entity("info_target", false);
engfunc(EngFunc_SetModel, iEntSprite, MODEL_GUNDROP);
// then I set couple of entvars
} else {
// fixes ents' origin, because SetThink called from rg_CBasePlayerDropPlayerItemPost (in this case weaponbox can still moving somethime)
}
}
}
// This's my plugins logics :\