PHP Code:
stock pf_find_weapon_ent_id(id, CSW_ID)
{
static ent, szClassname[24]; ent = -1;
get_weaponname(CSW_ID, szClassname, charsmax(szClassname));
while ((ent = find_ent_by_class(ent, szClassname)) > 0 && entity_get_edict(ent, EV_ENT_owner) != id) { }
return ent;
}
it will be more common sense and faster to use..
Code:
stock pf_find_weapon_ent_id(id, CSW_ID)
{
static szClassname[24];
get_weaponname(CSW_ID, szClassname, charsmax(szClassname));
return find_ent_by_owner(-1, szClassname, id);
}
since i forgot about the find_ent_by_owner native.
__________________