array index out of bounds
#1

Код:
SetPlayerPos(playerid, RandomSpawn[rand3][0], RandomSpawn[rand3][1],RandomSpawn[rand3][2],RandomSpawn[rand3][3],RandomSpawn[rand3][4],RandomSpawn[rand3][5],RandomSpawn[rand3][6]);
error: array index out of bounds
Reply
#2

You used the function in a way it is not suppose to be used:
pawn Код:
SetPlayerPos(playerid, x, y, z);
You can't add more things into it, its only suppose to be a X, a Y, and a Z... There are tutorials in which you use switch cases and so on to get the player to randomly spawn somewhere, just search for one.
Reply
#3

@Dr Yes he can make it like that.

The wrong thing is you put too many argument. It's supposed to be 4 arguments. So basically like this:
pawn Код:
SetPlayerPos(playerid,RandomSpawn[rand3][0],RandomSpawn[rand3][1],RandomSpawn[rand3][2]);
if you still get the error please show us your "RandomSpawn" code.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)