Thread: Randomize Teams
View Single Post
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 02-11-2021 , 06:33   Re: Randomize Teams
Reply With Quote #6

try this, i didn't test it.

PHP Code:
/* Sublime AMXX Editor v2.2 */

#pragma semicolon 1

#include <amxmodx>
// #include <amxmisc>
#include <cstrike>
// #include <engine>
// #include <fakemeta>
// #include <hamsandwich>
// #include <fun>
// #include <xs>
// #include <sqlx>

#define PLUGIN  "Randomize Teams"
#define VERSION "1.0"
#define AUTHOR  "NapoleoN#"

#if !defined MAX_PLAYERS
    
const MAX_PLAYERS 32;
#endif

new bool:bUsed;

public 
plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR);

    
register_clcmd("say /random""randomizeTeams");
}

public 
randomizeTeams(id)
{
    if(
get_user_flags(id) & ADMIN_KICK)
    {
        if(!
bUsed)
        {
            new 
iPlayers[MAX_PLAYERS], iNum;
            
get_players(iPlayersiNum);

            for(new 
iiNumi++)
            {
                
cs_set_user_team(iPlayers[i], CS_TEAM_T);

                if(
iPlayers[1] <= iNum)
                {
                    
cs_set_user_team(iPlayers[1], CS_TEAM_CT);
                }
            }
            
bUsed true;
        }
    }

__________________

Last edited by Napoleon_be; 02-11-2021 at 08:18.
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be