Best player of the map?
Hello there,
I've tryed to catch the best player of the map by using plugin_end, and another action by that. Ill show you guys what i've tried and what the problem is. PHP Code:
|
Re: Best player of the map?
PHP Code:
1. Cache get_maxplayers() in plugin init: Code:
2. Players are 1 to maxplayers, not 0 to maxplayers - 1. Code:
Also, your message won't be seen in plugin_end() since the map is changing and it is called right before clients are disconnected and reconnected to the changed map. |
Re: Best player of the map?
Hmm, then how would I check if its the end of the map ?:O
EDIT: So if my loop is wrong, why does it work on other actions? |
Re: Best player of the map?
Quote:
in the plugin PHP Code:
|
Quote:
Your incorrect loop only works on the first (maxplayers - 1) players (so 32 slot server only works on first 31 players). Also, your incorrect loop starts at player id 0, which is no player so you should get a lot of runtime errors saying invalid player id if you are not checking if player exists (like your frag comparison loop). EDIT: Quote:
However, his code shows get_maxplayers() called from 2 separate places. |
Re: Best player of the map?
Hm ye, my fault
Exolent[jNr] is right. (Like always) |
Re: Best player of the map?
Quote:
|
Re: Best player of the map?
So this is a correct loop?
PHP Code:
|
Re: Best player of the map?
Quote:
Don't you read what Exolent says? :down: -> If you do like that, every time it needs to take the get_maxplayers() (every number from 1 to maxplayers) |
Re: Best player of the map?
Well just asking to be sure :D
|
| All times are GMT -4. The time now is 15:08. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.