01.08.2010, 00:11
my game mode is hide n kill and alot of times people dont like being on TEAM_HUNTER 1 so i have to make it select a random person but i dont know how please help.
for(new x=0; x!=MAX_PLAYERS; x++)
{
if(GetPlayerTeam(x) != TEAM_HUNTER)
{
new str[80];
format(str, sizeof(str), "%s has been randomly set to \"Team Hunter\"", pName(x));
SendClientMessageToAll(0xAAFFFFF, str);
SetPlayerTeam(x, TEAM_HUNTER);
break;
}
}
Add this where you want to pick the random player...
pawn Код:
|