Choosing a random player of a 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)
+--- Thread: Choosing a random player of a team (
/showthread.php?tid=378029)
Choosing a random player of a team -
KingyKings - 16.09.2012
Can you help. I need to script it so when the player spawns it will freeze them (already done) and then after a timer it will select a random person off the Defenders team and takes there name but not off the Invaders team.
Much appreciated!
Re: Choosing a random player of a team -
Sig Hansen - 16.09.2012
Download GameMode And Edit It....
Re: Choosing a random player of a team - Glint - 16.09.2012
Quote:
Originally Posted by Sig Hansen
Download GameMode And Edit It....
|
What does that have to do with anything ?
Re: Choosing a random player of a team -
[MM]RoXoR[FS] - 16.09.2012
Supposing that you have stored player team in
Код:
new gTeam[MAX_PLAYERS]
pawn Код:
//Whenever you want to select random player
new rP;
for(;;)
{
rP = random(GetMaxPlayers());
if(!IsPlayerConnected(rP) || gTeam[rP] != TEAM_DEFENDER) continue;
break;
}