26.01.2017, 12:40
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];