30.05.2017, 12:11
PHP код:
stock ReloadTeleports()
{
mysql_tquery(sql, "SELECT * FROM `Teleports`", "ReloadTPS");
return 1;
}
forward ReloadTPS();
public ReloadTPS()
{
new rows,fields;
cache_get_data(rows,fields);
if(rows)
{
for(new i = 0;i < rows;i++)
{
new String[64], query[128], Cache:result, getint, getstr[32], Float:getfloat;
getint = cache_get_field_content_int(i, "ID"); TPDB[i][ID] = getint;
cache_get_field_content(i, "Description", getstr); format(TPDB[i][Description], 32, getstr);
getfloat = cache_get_field_content_float(i, "X1"); TPDB[i][X1] = getfloat;
getfloat = cache_get_field_content_float(i, "Y1"); TPDB[i][Y1] = getfloat;
getfloat = cache_get_field_content_float(i, "Z1"); TPDB[i][Z1] = getfloat;
getfloat = cache_get_field_content_float(i, "A1"); TPDB[i][A1] = getfloat;
getint = cache_get_field_content_int(i, "Interior1"); TPDB[i][Interior1] = getint;
getint = cache_get_field_content_int(i, "VirtualWorld1"); TPDB[i][VirtualWorld1] = getint;
getfloat = cache_get_field_content_float(i, "X2"); TPDB[i][X2] = getfloat;
getfloat = cache_get_field_content_float(i, "Y2"); TPDB[i][Y2] = getfloat;
getfloat = cache_get_field_content_float(i, "Z2"); TPDB[i][Z2] = getfloat;
getfloat = cache_get_field_content_float(i, "A2"); TPDB[i][A2] = getfloat;
getint = cache_get_field_content_int(i, "Interior2"); TPDB[i][Interior2] = getint;
getint = cache_get_field_content_int(i, "VirtualWorld2"); TPDB[i][VirtualWorld2] = getint;
format(String,sizeof(String),"[Teleport: %d]\n%s", i, TPDB[i][Description]);
TPEnter[i] = CreateDynamic3DTextLabel(String, 0xFFFFFFFF, TPDB[i][X1], TPDB[i][Y1], TPDB[i][Z1], 20, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, TPDB[i][VirtualWorld1], TPDB[i][Interior1], -1, 50.0);
TPExit[i] = CreateDynamic3DTextLabel(String, 0xFFFFFFFF, TPDB[i][X2], TPDB[i][Y2], TPDB[i][Z2], 20, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, TPDB[i][VirtualWorld2], TPDB[i][Interior2], -1, 50.0);
}
}
return 1;
}