Raised This Month: $ Target: $400
 0% 

[Optimize] Loop


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
^SmileY
Veteran Member
Join Date: Jan 2010
Location: Brazil [<o>]
Old 09-22-2011 , 22:40   [Optimize] Loop
Reply With Quote #1

Whats better usage and performance?

PHP Code:
    new iPlayers[32],iNum;
    
get_players(iPlayers,iNum,"ch");
    
    for(new 
i;iNum;i++)
    {
        if((
cs_get_user_team(iPlayers[i]) == CS_TEAM_SPECTATOR) || (cs_get_user_team(iPlayers[i]) == CS_TEAM_UNASSIGNED)) continue;
        
        
MainMenu(iPlayers[i]);
    } 
PHP Code:
    new iPlayers[32],iNum;
    
get_players(iPlayers,iNum,"ch");
    
    for(new 
i;iNum;i++)
    {
        switch(
cs_get_user_team(iPlayers[i]))
        {
            case 
CS_TEAM_SPECTATOR:
            {
                
/*Remove Players From Loop*/
                
continue;
            }
            case 
CS_TEAM_UNASSIGNED:
            {
                
/*Remove Players From Loop*/
                
continue;
            }

        }
        
MainMenu(iPlayers[i]);
    } 
PHP Code:
    new iPlayers[32],iNum;
    
get_players(iPlayers,iNum,"ch");
    
    for(new 
i;iNum;i++)
    {
        switch(
cs_get_user_team(iPlayers[i]))
        {
            case 
CS_TEAM_SPECTATOR CS_TEAM_UNASSIGNED:
            {
                
/*Remove Players From Loop*/
                
continue;
            }

        }
        
MainMenu(iPlayers[i]);
    } 
Thanks for read
__________________
Projects:

- See my Git Hub: https://github.com/SmileYzn
PHP Code:
set_pcvar_num(pCvar, !get_pcvar_num(pCvar)); 
^SmileY is offline
Send a message via MSN to ^SmileY Send a message via Skype™ to ^SmileY
 


Thread Tools
Display Modes

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