SA-MP Forums Archive
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=412977)



Array Index Out Of Bounds - Black Axe - 03.02.2013

PHP код:
new Float:FedexPoints[5][4] = {
{
1298.6033,-1856.7441,12.9526,88.7204},
{
1293.3746,-1650.4768,12.9565,181.3578},
{
1195.2435,-1324.1394,12.9615,181.9488},
{
1315.7272,-920.2856,37.5370,72.5887},
{
1009.0753,-932.6588,41.7536,97.1067}
}; 
PHP код:
            new rand random(sizeof(FedexPoints));
            
SetPlayerCheckpoint(playeridFedexPoints[rand][0], FedexPoints[rand][1], FedexPoints[rand][2], FedexPoints[rand][3], FedexPoints[rand][4], 3.0); // <---- Error here 
Help would be appreciated :/


Re: Array Index Out Of Bounds - Danyal - 03.02.2013

Quote:

SetPlayerCheckpoint(playerid, FedexPoints[rand][0], FedexPoints[rand][1], FedexPoints[rand][2], 3.0); // <---- Error here

here you go

btw why are you using
Quote:

FedexPoints[rand][3]

and
Quote:

FedexPoints[rand][4]

what these are for as SetPlayerCheckpoint only use below pattern

Quote:

(playerid, Float, Float:y, Float:z, Floatize)




Re: Array Index Out Of Bounds - Black Axe - 03.02.2013

Lol Thanks , No idea why did I add 3 , 4 xD - Repped.