Array index,first one is 0 or 1?
#1

Код:
new pArea [4][3] =
{
	{1323.5114,10.8203,158.5349},
	{1323.1530,10.8203,267.2626},
	{1342.7168,10.8203,357.8168},
	{1343.3971,10.8203,90.2510},
};
That way i get no errors,so i guess first array is indexed with [1] not [0] ?
Reply
#2

new pArena[0-3][0-2] = {
...
Reply
#3

Код:
error 001: expected token: ";", but found "{"
error 010: invalid function or declaration
Код:
new pArea [4][3] =
{
	{1323.5114,10.8203,158.5349},
	{1323.1530,10.8203,267.2626},
	{1342.7168,10.8203,357.8168},
	{1343.3971,10.8203,90.2510}, // LINE 12
}; // LINE 13
Reply
#4

add Float tag to pArena and remove last ,
Reply
#5

Код:
array_name[amount]
array_name = Points to the data structure
amount = Amount of allocated cells (1 cell = 4 bytes = 32 bits)

Example:
pawn Код:
new my_arr[5];
Possibilities:
pawn Код:
my_arr[0] // First
my_arr[1] // Second
my_arr[2] // Third
my_arr[3] // Fourth
my_arr[4] // Fifth
Reply
#6

Код:
new Float:pArea [3][2] =
{
	{1323.5114,10.8203,158.5349},
	{1323.1530,10.8203,267.2626},
	{1342.7168,10.8203,357.8168},
	{1343.3971,10.8203,90.2510}, // 12
}
Код:
(12) : error 001: expected token: ";", but found "{"
Reply
#7

remove the comma at the last line(error line)
Reply
#8

Quote:
Originally Posted by Tagathron
Посмотреть сообщение
Код:
new Float:pArea [3][2] =
{
	{1323.5114,10.8203,158.5349},
	{1323.1530,10.8203,267.2626},
	{1342.7168,10.8203,357.8168},
	{1343.3971,10.8203,90.2510}, // 12
}
Код:
(12) : error 001: expected token: ";", but found "{"
Remove the last comma in line 12...

Also I see 4 rows and 2 columns. In PAWN you don't need to re-define the amount of cells, if you are already assigning the data after "=".

pawn Код:
static const Float:pArea[][] =
{
    {1323.5114, 10.8203, 158.5349},
    {1323.1530, 10.8203, 267.2626},
    {1342.7168, 10.8203, 357.8168},
    {1343.3971, 10.8203, 90.2510}
};
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)