Code:
public Forward_PreThink(id)
{
if(!is_user_alive(id))
return FMRES_IGNORED
static EntList[1]
if(find_sphere_class(id,g_aMissionClass,100.0,EntList,1))
RunNPC(id,EntList[0]);
if(!(pev(id,pev_button) & IN_USE && !(pev(id,pev_oldbuttons) & IN_USE)))
return FMRES_IGNORED
new Index,Body
get_user_aiming(id,Index,Body,100);
if(!Index)
return FMRES_IGNORED
static Classname[33]
pev(Index,pev_classname,Classname,32);
if(!equal(Classname,g_aMissionClass))
return
}
I'm calling "find_sphere_class" - obviously alot. Which is my question. Is that bad? I only use to check when a player comes close to a NPC. It runs that function. I would use a task (with about 1-3 task time) but I figured I can just throw it into the prethink. So which is better, a task looping every 3 seconds. Or using it in prethink?
__________________