Loop Players HUD Message
Hi,
I am unsure of how to loop players in my HUD message PHP Code:
|
Re: Loop Players HUD Message
You do realize that get_maxplayers returns the settings value and not the amount of connected players currently at the server, search for proper method. Strings don't have operators, so you could use some kind of native for example format to build the string. You are setting the string's value totally wrong, read some pawn tutorial for arrays and their indexes and please don't create variables inside loops. Why would you create such function as public?
|
Re: Loop Players HUD Message
Quote:
Use get_players instead. To set/modify strings (in this case) use format and/or formatex. Put the new szName[32] outside (above) the loop. See http://www.amxmodx.org/funcwiki.php for more information on these, and please read http://wiki.alliedmods.net/Optimizin...d_X_Scripting). |
Re: Loop Players HUD Message
Quote:
Your link doesn't work. http://wiki.alliedmods.net/Optimizin...d_X_Scripting) |
Re: Loop Players HUD Message
take look on my Show Admins Online
plugin it does what you try to do you only need to remove the admin stuff |
Re: Loop Players HUD Message
Thanks everyone.
Here is my final code that works. If there are any optimizations, please correct. PHP Code:
|
Re: Loop Players HUD Message
PHP Code:
|
Re: Loop Players HUD Message
What's the advantage of using g_iMaxPlayers instead of using get_maxplayers() in the loop?
|
Re: Loop Players HUD Message
Quote:
http://wiki.alliedmods.net/Optimizin...op_Comparisons |
| All times are GMT -4. The time now is 02:09. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.