Better Way (Difference)
which way is better (less cpu, faster), and does anyone know even better way than this one
1. PHP Code:
somewhere in plugin_init -> g_maxplayers = get_maxplayers(); PHP Code:
|
Re: Better Way (Difference)
Well the 2nd method will give this public event to not connected or already disconnected players if the server is not full... you should use get_playersnum with second method and don't declare the playersnum in plugin_init, declare it everytime public event is hooked.
|
Re: Better Way (Difference)
you can't use playersnum, because playersnum returns the number of online players.
so for example: there are 20 players on the server. player 15 disconnects, and in the server remains 19 players. if your loop is for(new i = 1; i <= get_playersnum(); i++), it goes 1 to 19, and the 20. player won't be watched... |
Re: Better Way (Difference)
PHP Code:
what's the actuall difference between new i = 1 and new i = 0? edit: now i saw the post, so playersnum wont work Quote:
PHP Code:
|
| All times are GMT -4. The time now is 19:46. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.