Array Index Out of Bounds - 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: Array Index Out of Bounds (
/showthread.php?tid=508099)
Array Index Out of Bounds -
NoahF - 20.04.2014
I get this error when compiling:
Код:
C:\Users\X\Desktop\X\gamemodes\X.pwn(425) : error 032: array index out of bounds (variable "BanReason")
Line:
Код:
if(sscanf(params, "us", targetid, BanReason[128])) return SendClientMessage(playerid, COLOR_RED, "USAGE: /ban [ID] [REASON]");
I also get:
Код:
C:\Users\X\Desktop\X\gamemodes\X.pwn(517) : error 029: invalid expression, assumed zero
Line:
Код:
else SendClientMessage(playerid, COLOR_RED, "You are not an Admin.");
Re: Array Index Out of Bounds -
JeaSon - 20.04.2014
try this
pawn Код:
if(sscanf(params, "us[128]", targetid, BanReason)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /ban [ID] [REASON]");
pawn Код:
else return SendClientMessage(playerid, COLOR_RED, "You are not an Admin.");
Re: Array Index Out of Bounds -
NoahF - 20.04.2014
Oh, I'm stupid lol. Thank you!