Raised This Month: $ Target: $400
 0% 

[TUT] Modules and efficient scripting


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
joaquimandrade
Veteran Member
Join Date: Dec 2008
Location: Portugal
Old 03-29-2009 , 16:27   Re: [TUT] Modules and efficient scripting
Reply With Quote #1

More. (I'm assuming that pev_valid(id) is equivalent to is_valid_ent(id)). If they aren't, the results are invalid.
Attached Files
File Type: txt more.txt (2.1 KB, 527 views)
__________________
joaquimandrade is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 03-29-2009 , 17:13   Re: [TUT] Modules and efficient scripting
Reply With Quote #2

Quote:
Originally Posted by joaquimandrade View Post
More. (I'm assuming that pev_valid(id) is equivalent to is_valid_ent(id)). If they aren't, the results are invalid.
is_valid_ent only returns 0/1 when pev_valid returns 0,1 or 2.

Code:
/**
 * Checks the validity of an entity.
 *
 * @param entindex		The entity id to check.
 *
 * @return 			0 on invalid entity
 *						1 on entity is valid
 *						2 on entity is valid and it has private data (safe to use pdata natives on).
 */
native pev_valid(entindex);
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
joaquimandrade
Veteran Member
Join Date: Dec 2008
Location: Portugal
Old 03-29-2009 , 17:20   Re: [TUT] Modules and efficient scripting
Reply With Quote #3

Quote:
Originally Posted by ConnorMcLeod View Post
is_valid_ent only returns 0/1 when pev_valid returns 0,1 or 2.

Code:
/**
 * Checks the validity of an entity.
 *
 * @param entindex        The entity id to check.
 *
 * @return             0 on invalid entity
 *                        1 on entity is valid
 *                        2 on entity is valid and it has private data (safe to use pdata natives on).
 */
native pev_valid(entindex);
Ok. So the comparison is not fair.
A question: is it normal needing the "return 2" case?
__________________
joaquimandrade is offline
Reply



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 21:01.


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