Raised This Month: $ Target: $400
 0% 

More efficient way to check an entity?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
kirewv
Senior Member
Join Date: Oct 2007
Old 06-15-2008 , 18:11   More efficient way to check an entity?
Reply With Quote #1

Let's say I have a group of 50 entites of 6 classtypes.
I want to perform an action on particular entity after aiming at it.

Is it more efficient to check if the entities index falls within a certain number
PHP Code:
if(50 <= entity <= 100)//hypothetical index values
{
do 
stuff;

or

is it more efficient to check if they are of the desired class
PHP Code:
GetEntityClassname(entity,string,length);
if (
string desiredclass)
{
do 
someting;

kirewv is offline
 



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 03:26.


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