Make Player Spawns more Perfect
#6

All i can think of is a infinite loop (but its working perfect for me) try to debug the code like this and show me what is printing on console.


Код:
new rand = random(sizeof(TruckerSpawn));
static last[MAX_PLAYERS],current[MAX_PLAYERS]; 
new i;
while( last[playerid] == current[playerid]) 
{ 
  printf("iteration = %d ",i++);
  current[playerid] = random(sizeof(TruckerSpawn)); 
  printf("current = %d ",current[playerid]);
} 
SetPlayerPos(playerid, TruckerSpawn[current[playerid]][SpawnX], TruckerSpawn[current[playerid]][SpawnY], TruckerSpawn[current[playerid]][SpawnZ]); 
SetPlayerFacingAngle(playerid, TruckerSpawn[current[playerid]][SpawnAngle]); 
SetCameraBehindPlayer(playerid); 
last[playerid] = current[playerid];
Reply


Messages In This Thread
Make Player Spawns more Perfect - by DerickClark - 26.01.2017, 11:39
Re: Make Player Spawns more Perfect - by SyS - 26.01.2017, 11:50
Re: Make Player Spawns more Perfect - by DerickClark - 26.01.2017, 11:58
Re: Make Player Spawns more Perfect - by SyS - 26.01.2017, 12:01
Re: Make Player Spawns more Perfect - by DerickClark - 26.01.2017, 12:11
Re: Make Player Spawns more Perfect - by SyS - 26.01.2017, 12:40
Re: Make Player Spawns more Perfect - by SyS - 27.01.2017, 00:47
Re: Make Player Spawns more Perfect - by DerickClark - 27.01.2017, 01:48
Re: Make Player Spawns more Perfect - by SyS - 27.01.2017, 02:25
Re: Make Player Spawns more Perfect - by DerickClark - 27.01.2017, 02:30

Forum Jump:


Users browsing this thread: 1 Guest(s)