Help With putting random person on a certain team - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Help With putting random person on a certain team (
/showthread.php?tid=164572)
Help With putting random person on a certain team -
lSCARl - 01.08.2010
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.
Re: Help With putting random person on a certain team -
PotH3Ad - 01.08.2010
Add this where you want to pick the random player...
pawn Код:
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;
}
}
Re: Help With putting random person on a certain team -
lSCARl - 01.08.2010
Quote:
Originally Posted by PotH3Ad
Add this where you want to pick the random player...
pawn Код:
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; } }
|
this makes everyone who joins a hunter. how can i fix it