Thread: Swap Defuser
View Single Post
Liverwiz
Veteran Member
Join Date: Feb 2010
Location: Maryland
Old 05-05-2012 , 17:20   Re: Swap Defuser
Reply With Quote #8

Quote:
PHP Code:
get_players(playerscount)   
    
    for (new 
icounti++)
    {
        if (
cs_get_user_team(players[i]) != CS_TEAM_CT || cs_get_user_defuse(players[i]) )
            
playersi-- ] = players[ --count ];
    } 
I would get only alive CTs, then check if they have a diffuse

PHP Code:
get_players(playerscount"ae""CT"
PHP Code:
if( cs_get_user_defuse(players[i]) ) 
that would cut your for-loop iterations in about half, and get rid of another one of your if- checks. As well as make it easier to read. (directly showing you're only dealing with alive CTs)
This is just personal opinion. Your code looks like it works fine. But that would be more efficient.

Other than that...well done, man.

Last edited by Liverwiz; 05-05-2012 at 17:27.
Liverwiz is offline