2021-02-23, 04:42 PM
Hi, how can i randomly select a player and have it run once per game?
i have a TDM server for rounds and i need it to run only once per game
This is my code:
The problem is that it runs more than once, can you help me please?, thanks
i have a TDM server for rounds and i need it to run only once per game
This is my code:
Code:
new ran = random(GetPlayerPoolSize());
loop_start:
if(!IsPlayerConnected(ran))
{
? ? ran = random(GetPlayerPoolSize());
? ? goto loop_start;
}
printf("player found");
printf("%d",ran);
if(team[ran] == TEAM_GREEN)SpawnPlayer(ran);
GetPlayerPos(ran, xpo, ypo, zpo);
The problem is that it runs more than once, can you help me please?, thanks