View Single Post
GoldNux
Senior Member
Join Date: Mar 2018
Old 11-05-2022 , 10:23   Re: Can't teamswap dead players
Reply With Quote #3

Quote:
Originally Posted by iceeedr View Post
Never faced such problem, what version of amx are you using? Anyway, here are some corrections to your code...
I use the latest version.
This worked for some reason:
Obviously not pretty..

Thanks for your reply.
I will test the code and try some more.
PHP Code:
public SwapTeams()
{
    new 
players[32];
    new 
playercount;
    
get_players(playersplayercount);
    
    new 
i
    
for (i=0i<playercounti++)
    {
        if (
cs_get_user_team(players[i]) == CS_TEAM_T)
        {
            
cs_set_user_team(players[i], CS_TEAM_CT)
        }
        else if (
cs_get_user_team(players[i]) == CS_TEAM_T)
        {
            
cs_set_user_team(players[i], CS_TEAM_T)
        }
    }


Last edited by GoldNux; 11-05-2022 at 10:24.
GoldNux is offline