Errors
#1

Heres the error:

pawn Код:
(2686 -- 2687) : error 001: expected token: "]", but found "-integer value-"
(2687) : warning 215: expression has no effect
(2687) : error 001: expected token: ";", but found "]"
(2687) : error 029: invalid expression, assumed zero
(2687) : fatal error 107: too many error messages on one line
Heres the line (Line 2686):

this is all on one line, it just couldn't fit in the [pawn] code box

pawn Код:
SetPlayerPos(playerid,
RandomSpawn10[rand10][0],
RandomSpawn10[rand10][1],
RandomSpawn10[rand10][2],
RandomSpawn10[rand10][3],
RandomSpawn10[rand10][4],
RandomSpawn10[rand10][5],
RandomSpawn10[rand10][6],
RandomSpawn10[rand10][7],
RandomSpawn10[rand10][8],
RandomSpawn10[rand10][9],
RandomSpawn10[rand10][10],
RandomSpawn10[rand10][11],
RandomSpawn10[rand10][12],
RandomSpawn10[rand10][13],
RandomSpawn10[rand10][14],
RandomSpawn10[rand10][15],
RandomSpawn10[rand10][16],
RandomSpawn10[rand10][17],
RandomSpawn10[rand10][18],
RandomSpawn10[rand10][19]
);
I'm sure its because I line has too much on it (Input line to long after substitutions) but that error doesn't show up and I'm sure I'm not missing a square bracket like it says, can someone help?
Reply
#2

https://sampwiki.blast.hk/wiki/SetPlayerPos

It only requires 4 parameters!
pawn Код:
SetPlayerPos(playerid, RandomSpawn10[rand10][0], RandomSpawn10[rand10][1], RandomSpawn10[rand10][2]);
That will work.

I'm guessing you are trying to make random spawns?
pawn Код:
new Float:iRandSpawn[][] = {
{0.0, 0.0, 0.0},
{0.1, 0.1, 0.1},
{0.2, 0.2, 0.2}
};

new
    iRand = random(sizeof(iRandSpawn));

SetPlayerPos(playerid, iRandSpawn[iRand][0], iRandSpawn[iRand][1], iRandSpawn[iRand][2]);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)