SA-MP Forums Archive
Expected token - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Expected token (/showthread.php?tid=632837)



Expected token - Despacito - 20.04.2017

Im getting expected token ; but found ] in this line:

pawn Код:
format(nrs, sizeof(nrs), "Score: ~r~%02i/%02i", GetPlayerScore(i), gRank[(Player[i][Rank] + 1) >= sizeof(gRank)) ? (sizeof(gRank)) : (Player[i][Rank] + 1)][rankScore]);



Re: Expected token - iLearner - 20.04.2017

Quote:

format(nrs, sizeof(nrs), "Score: ~r~%02i/%02i", GetPlayerScore(i), gRank[(Player[i][Rank] + 1) >= sizeof(gRank)) ? (sizeof(gRank)) : (Player[i][Rank] + 1)[rankScore]);

Try dat


Re: Expected token - Despacito - 21.04.2017

error 001: expected token: "]", but found ")"
error 029: invalid expression, assumed zero


Re: Expected token - DarkSkull - 21.04.2017

Код:
format(nrs, sizeof(nrs), "Score: ~r~%02i/%02i", GetPlayerScore(i), (gRank[(Player[i][Rank] + 1)] >= sizeof(gRank)) ? (sizeof(gRank)) : (Player[i][Rank] + 1)][rankScore]);
EDIT: That'll fix an error. But I noticed something with your code.

PHP код:
(sizeof(gRank)) : (Player[i][Rank] + 1)][rankScore
The else part of this code doesn't make any sense. What're you trying to do here?


Re: Expected token - Despacito - 21.04.2017

Same error.