error 032: array index out of bounds (variable "Positions")
#1

Can anyone help me with these errors please ?
Код:
E:\Server\gamemodes\VGRP.pwn(35975) : error 032: array index out of bounds (variable "Positions")
E:\Server\gamemodes\VGRP.pwn(36095) : error 032: array index out of bounds (variable "Positions")
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.
Positions Define
pawn Код:
new Float:Positions[16][3];
Line "35975"
pawn Код:
GetDynamicObjectPos(LSFDGate, Positions[16][0], Positions[16][1], Positions[16][2]);
Line "36095"
pawn Код:
else if(GetDistance( Positions[0][0], Positions[0][1], Positions[0][2], Positions[16][0], Positions[16][1], Positions[16][2]) < 17.0 ) {
+REP
Reply
#2

Use enum
pawn Код:
enum Float:Postions [] []
{
 // ur Locs in {x, y, z), // remove the ',' in the last one
};

new Pos [] [Postions]; // change Pos to the one u want
and Delete ur New and change all things with new to Pos [] []
Reply
#3

You declare Positions as 16. That means 0-15 indexes (in total 16).

So the last index (valid index) you can use is 15, not 16.
Reply
#4

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
You declare Positions as 16. That means 0-15 indexes (in total 16).

So the last index (valid index) you can use is 15, not 16.
Thanks man its working now
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)