• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Pawn] Random Player
#1
Exclamation 
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:



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
  Reply


Messages In This Thread
Random Player - by Lord_Bukake - 2021-02-23, 04:42 PM
RE: Random Player - by destiezk - 2021-02-23, 05:24 PM
RE: Random Player - by Radical - 2021-02-23, 08:15 PM
RE: Random Player - by Lord_Bukake - 2021-02-24, 04:47 PM

Forum Jump: