SA-MP Forums Archive
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: error 032: array index out of bounds (/showthread.php?tid=539740)



error 032: array index out of bounds - FullCircle - 30.09.2014

pawn Код:
error 032: array index out of bounds (variable "RandomPizzaTimer")
pawn Код:
new RandomPizzaTimer[][] =
{
    {15, 0},
    {15, 0},
    {15, 0},
    {15, 0},
    {15, 0}
};
new Random = random(sizeof(RandomPizzaPoints));
vPlayer[playerid][pPizzaData] = Random;

GivePlayerMoney(playerid, RandomPizzaTimer[vPlayer[playerid][pPizzaData]][2]);//Error Line
Any idea? It might be solved with a enum? Thanks...


Re: error 032: array index out of bounds - Emmet_ - 30.09.2014

You are trying to access the second index in the array, which is invalid. Array indexes start from 0.

pawn Код:
GivePlayerMoney(playerid, RandomPizzaTimer[vPlayer[playerid][pPizzaData]][1]);