Raised This Month: $ Target: $400
 0% 

Some things I wonder about.


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 08-23-2012 , 16:13   Re: Some things I wonder about.
Reply With Quote #9

Quote:
Originally Posted by dark_style View Post
Note that if he uses get_maxplayers(), he should use it like that:

PHP Code:
new i_MaxPlayers get_maxplayers();
for( new 
id 1id <= i_MaxPlayersid++ ) 
This is a bad way, get_players should always be used, so you directly get a list (filled in players[32] array) of connected players.
With the other method, on each iteration you need to check if the player is connected, which is bad for performances.
Also get_players lets you add the "a" flag to retrieve only alive player that improve performances in the same way that having to put is_user_alive on each iteration.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod 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 05:42.


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