Checking for a Valid Player (id)
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 |
is_valid_ent(id) will work.
|
is_user_connected()
|
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 |
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). |
Thats perfect then, thanks for suggesting that function.
-Mug |
| All times are GMT -4. The time now is 17:18. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.