Line(4248) : error 032: 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: Line(4248) : error 032: array index out of bounds (
/showthread.php?tid=522187)
Line(4248) : error 032: array index out of bounds -
Juvanii - 26.06.2014
Hello Guys!! I'm kinda making a command to promote players to a specific thing and i decided to make the PromoteName which is one of the cmd parameters "sscanf" as a text instead of an integer. But an error appears.
Somebody please tell me how should the index work?!
pawn Код:
new promotename[10]; //it's one of the sscanf parameters
if(promotename[10] == "admin") // (Line 4248) instead of "promotename == integer" if the promotename is not indexed with [10]
{
//rest of code
return 1;
}
Re: Line(4248) : error 032: array index out of bounds -
RenovanZ - 26.06.2014
Use strcmp to compare strings
Re: Line(4248) : error 032: array index out of bounds -
Juvanii - 26.06.2014
I don't get what is the usage of strcmp in this case !
Re: Line(4248) : error 032: array index out of bounds -
RenovanZ - 26.06.2014
pawn Код:
new promotename[10]; //it's one of the sscanf parameters
if(!strcmp(promotename, "admin")) // (Line 4248) instead of "promotename == integer" if the promotename is not indexed with [10]
{
//rest of code
return 1;
}
Re: Line(4248) : error 032: array index out of bounds -
Juvanii - 26.06.2014
Thank you!