Array Index Out of Bounds
#1

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.");
Reply
#2

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.");
Reply
#3

Oh, I'm stupid lol. Thank you!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)