11.03.2018, 17:38
What causes this error?
Код:
SetPlayerFacingAngle(playerid,gRandomSpawns[gRandom][3]);
Код:
error 032: array index out of bounds (variable "gRandomSpawns")
Код:
public OnPlayerSpawn(playerid) { new str[128], PlayerName[MAX_PLAYER_NAME]; GetPlayerName(playerid, PlayerName, sizeof(PlayerName)); format(str, sizeof(str), "%s has successfully spawned!", PlayerName); SendClientMessageToAll(-1, str); new gRandom = random(sizeof(gRandomSpawns)); SetPlayerPos(playerid, gRandomSpawns[gRandom][0], gRandomSpawns[gRandom][1], gRandomSpawns[gRandom][2]); SetPlayerFacingAngle(playerid,gRandomSpawns[gRandom][3]); return true; }