08.04.2017, 22:41
How i can change mysql variable?
need to have public LoadTurfs like public Detector_Load
This is from my GM
This is imported
need to have public LoadTurfs like public Detector_Load
This is from my GM
PHP код:
public Detector_Load()
{
static
rows,
fields;
cache_get_data(rows, fields, g_iHandle);
for (new i = 0; i < rows; i ++) if (i < MAX_METAL_DETECTORS)
{
MetalDetectors[i][detectorExists] = 1;
MetalDetectors[i][detectorID] = cache_get_field_int(i, "detectorID");
MetalDetectors[i][detectorPos][0] = cache_get_field_float(i, "detectorX");
MetalDetectors[i][detectorPos][1] = cache_get_field_float(i, "detectorY");
MetalDetectors[i][detectorPos][2] = cache_get_field_float(i, "detectorZ");
MetalDetectors[i][detectorPos][3] = cache_get_field_float(i, "detectorAngle");
MetalDetectors[i][detectorInterior] = cache_get_field_int(i, "detectorInterior");
MetalDetectors[i][detectorWorld] = cache_get_field_int(i, "detectorWorld");
Detector_Refresh(i);
}
return 1;
}
PHP код:
public LoadTurfs()
{
new result[100],index = 0;
mysql_query(SQL,"SELECT * FROM `turfs` ORDER BY `turfs`.`ID` ASC");
mysql_store_result();
while(mysql_retrieve_row())
{
index++;
new i = index;
mysql_get_field("ID", result); TurfInfo[i][zID] = strval(result);
mysql_get_field("Owned", result); TurfInfo[i][zOwned] = strval(result);
mysql_get_field("Time", result); TurfInfo[i][zTime] = strval(result);
mysql_get_field("MinX", result); TurfInfo[i][zMinX] = floatstr(result);
mysql_get_field("MinY", result); TurfInfo[i][zMinY] = floatstr(result);
mysql_get_field("MaxX", result); TurfInfo[i][zMaxX] = floatstr(result);
mysql_get_field("MaxY", result); TurfInfo[i][zMaxY] = floatstr(result);
}
mysql_free_result();
printf("[MySQL Turfs]: %d", index);
return 1;
}