04.12.2016, 08:16
PHP код:
forward AtmsLoad();
public AtmsLoad()
{
new rows = cache_num_rows();
if(rows)
{
new index = Iter_Free(i_ATM);
for(new i = 0; i < rows; i++)
{
cache_get_value_int(i, "ID", AtmInfo[index][aID]);
cache_get_value_float(i, "PosX", AtmInfo[index][aPosX]);
cache_get_value_float(i, "PosY", AtmInfo[index][aPosY]);
cache_get_value_float(i, "PosZ", AtmInfo[index][aPosZ]);
cache_get_value_float(i, "Angle", AtmInfo[index][aAngle]);
cache_get_value_int(i, "VW", AtmInfo[index][aVW]);
cache_get_value_int(i, "Interior", AtmInfo[index][aInt]);
AtmInfo[i][AtmExist] = true;
Iter_Add(i_ATM, index);
CreateAtm(index);
}
printf("ATMs loaded: %d", rows);
}
return 1;
}
But every ID is loading as 0.. Any ideas?
EDIT: When I am creating ATMs ther are created with ID 1, 2, 3, 4.. so loading is problem only..