Raised This Month: $ Target: $400
 0% 

Best player of the map?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Xalus
Veteran Member
Join Date: Dec 2009
Location: Belgium
Old 07-12-2012 , 16:33   Re: Best player of the map?
Reply With Quote #3

Quote:
Originally Posted by Exolent[jNr] View Post
PHP Code:
for (new i<get_maxplayers(); i++) 
Stop doing that!

1. Cache get_maxplayers() in plugin init:
Code:
new g_iMaxPlayers; public plugin_init( ) {     g_iMaxPlayers = get_maxplayers( ); }

2. Players are 1 to maxplayers, not 0 to maxplayers - 1.
Code:
for( new iPlayer = 1; iPlayer <= g_iMaxPlayers; iPlayer++ ) {     // Player loop }

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.
Doesnt need to make a global g_iMaxPlayers for that

in the plugin

PHP Code:
new iMaxPlayers get_maxplayers()
for(new 
1<= iMaxPlayersi++)
{


Should be enough, because it only gets "called" once ?
__________________
Retired.

Last edited by Xalus; 07-12-2012 at 16:34.
Xalus is offline
 



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 15:08.


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