invalid subscript (not an array or too many subscripts):
#1

LoadSEnter() return mysql_tquery(g_iHandle, "SELECT * FROM `senters`", "OnSEnterLoad", "");

forward OnSEnterLoad();
public OnSEnterLoad()
{
for (new i, j = cache_get_row_count(); i != j; i++) // loops through the rows
{
sEnterID[i] = cache_get_row_int(i, 0);
sEnter_x[i] = cache_get_row_float(i, 1);
sEnter_y[i] = cache_get_row_float(i, 2);
sEnter_z[i] = cache_get_row_float(i, 3);
sExit_x[i] = cache_get_row_float(i, 4);
sExit_y[i] = cache_get_row_float(i, 5);
sExit_z[i] = cache_get_row_float(i, 6);
Int[i] = cache_get_row_int(i, 7);
Int2[i] = cache_get_row_int(i, ;
Wirt[i] = cache_get_row_int(i, 9);
Wirt2[i] = cache_get_row_int(i, 10);
Name[i] = cache_get_row_int(i, 11);
UpdateSEnterText( i );
Itter_Add(sEnters,i);
}
}


Error line - sEnterID[i] = cache_get_row_int(i, 0);

error 028: invalid subscript (not an array or too many subscripts): "sEnterID"
warning 215: expression has no effect
expected token: ";", but found "]"
error 029: invalid expression, assumed zero
Reply
#2

Show me the part where you declared the array "sEnterID". Probably it seems you haven't declared the array properly.

You need to declare array using this syntax:
Код:
new array_name[SIZE];
Reply
#3

Quote:
Originally Posted by evan69
Посмотреть сообщение
Show me the part where you declared the array "sEnterID". Probably it seems you haven't declared the array properly.

You need to declare array using this syntax:
Код:
new array_name[SIZE];
enum senters
{
sEnterID,
FloatEnter_x,
FloatEnter_y,
FloatEnter_z,
FloatExit_x,
FloatExit_Y,
FloatExit_z,
Int,
Int2,
Wirt,
Wirt2,
Name[126]
}

#define MAX_SENTERS 100

new sEnter[ MAX_SENTERS ][ senters ];
Reply
#4

All of them need to be:
Код:
sEnter[i][sEnterID] = ...;
sEnter[i][Enter_x] = ...;
// ...
Reply
#5

PHP код:
sEnter[i][sEnterID] = cache_get_row_int(i0); 
Apply that to the rest of the rows you're trying to retrieve.

Edit: Stinged beat me to it : (
Reply
#6

Thanks guys.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)