Raised This Month: $ Target: $400
 0% 

Checking for a Valid Player (id)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Mugwump
Senior Member
Join Date: May 2004
Old 10-05-2004 , 12:18   Checking for a Valid Player (id)
Reply With Quote #1

After looking at some debug stack traces I see some signs that a few natives are being called with ids that do not refer to valid players, I am assuming they are 0 but havent debugged further on that end yet.

Will is_valid_ent( id ) work to tell me if a passed playerid refers to a valid player, or if not is there another preferred way to handle this?

Thanks!
-Mugwump
Mugwump is offline
Votorx
Senior Member
Join Date: Jun 2004
Old 10-05-2004 , 12:50  
Reply With Quote #2

is_valid_ent(id) will work.
__________________
Currently Looking for a mod team.
Votorx is offline
Send a message via AIM to Votorx Send a message via MSN to Votorx Send a message via Yahoo to Votorx
BAILOPAN
Join Date: Jan 2004
Old 10-05-2004 , 13:44  
Reply With Quote #3

is_user_connected()
__________________
egg
BAILOPAN is offline
Mugwump
Senior Member
Join Date: May 2004
Old 10-05-2004 , 14:40  
Reply With Quote #4

Good to know is_valid_ent() will work, thanks.

Bailopan, if is_user_connected(id) is passed an invalid ID will it simply return false or will it produce a runtime error (Invalid Player) like the fun module natives do?

-Mug
Mugwump is offline
BAILOPAN
Join Date: Jan 2004
Old 10-05-2004 , 14:56  
Reply With Quote #5

is_valid_ent will return true if an entity or player entity is valid.
is_user_connected will return true if a player is connected and in game (stripped down is_valid_ent for players).
__________________
egg
BAILOPAN is offline
Mugwump
Senior Member
Join Date: May 2004
Old 10-05-2004 , 15:22  
Reply With Quote #6

Thats perfect then, thanks for suggesting that function.

-Mug
Mugwump is offline
Reply


Thread Tools
Display Modes

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 17:18.


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