Code:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "My Computer"
new One_Time = 1;
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd( "say /random","Command_Random" );
}
public Command_Random(id)
{
new flags = get_user_flags(id)
if(!(flags & ADMIN_KICK))
{
client_print(id,print_chat,"You have no access to this command")
return PLUGIN_HANDLED
}
if(One_Time == 1)
{
new num, players[32]
get_players(players,num)
for(new i=0;i<=num;i++)
{
if(cs_get_user_team(players[i])==CS_TEAM_SPECTATOR)
continue
new rannum = random_num(1,2)
if(rannum==1)
{
cs_set_user_team(players[i],CS_TEAM_T)
}
else
{
cs_set_user_team(players[i],CS_TEAM_CT)
}
}
client_print(id,print_chat,"You have changed successfully the teams!")
}
else
{
client_print(id,print_chat,"Only one time per map")
}
One_Time = 0
return PLUGIN_HANDLED
}