SERVER:Unknown command. error even the command works well - 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: SERVER:Unknown command. error even the command works well (
/showthread.php?tid=658321)
Re: SERVER:Unknown command. error even the command works well -
SyS - 07.09.2018
You are using sizeof(pWeapons) as iteration's Upper bound which is MAX_PLAYERS and trying to access the 3rd dimension which has only 12 as upper bound.This will lead to
INDEX OUT OF BOUNDS.Use
sizeof(pWeapons[][]) instead
Код:
for(new i = 0; i < sizeof(pWeapons[][]); i++) {
GivePlayerWeapon(playerid, pWeapons[playerid][0][i], pWeapons[playerid][1][i]);
}
You could have easily detect it if you had
crashdetect plugin and compiled the code in
-d3 mode.