Raised This Month: $ Target: $400
 0% 

How efficient is this?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Drak
Veteran Member
Join Date: Jul 2005
Old 10-14-2009 , 17:40   How efficient is this?
Reply With Quote #1

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?
__________________
Oh yeah
Drak is offline
Send a message via MSN to Drak
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 22:37.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode