Raised This Month: $ Target: $400
 0% 

[Optimize] Loop


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 09-23-2011 , 07:55   Re: [Optimize] Loop
Reply With Quote #4

Instead of trying to avoid unassigned/spectator, just look for what you want which is players on a team. A switch is really only good if you want to react a number of different ways based on a value. Here an if-statement is better since you only want to do something if player is on a team which is easy since T=1 and CT=2.

PHP Code:
new iPlayers32 ] , iNum iPlayer;
get_playersiPlayers iNum "ch" );

for ( new 
iNum i++ )
{
    
iPlayer iPlayers];

    if ( 
CS_TEAM_T <= cs_get_user_teamiPlayer ) <= CS_TEAM_CT )
        
MainMenuiPlayer );

__________________
Bugsy 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 19:35.


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