stock ToLoadGangfight(id)
{
new query[256];
mysql_format(Data, query, 128, "SELECT * FROM gangfight WHERE `id` = '%d'", id);
mysql_function_query(Data, query, true, "OnGFLoad", "d", id);
return 1;
}
Dazu dann:
public OnGFLoad(id)
{
new rows, fields,string[64],tmp[128];
cache_get_data(rows, fields);
GFInfo[id][xMin] = cache_get_row_float(0,0);
GFInfo[id][xMax] = cache_get_row_float(0,2);
GFInfo[id][yMax] = cache_get_row_float(0,3);
GFInfo[id][yMin] = cache_get_row_float(0,1);
GFInfo[id][ctfX] = cache_get_row_float(0,4);
GFInfo[id][ctfY] = cache_get_row_float(0,5);
GFInfo[id][ctfZ] = cache_get_row_float(0,6);
GFInfo[id][OwnerID] = cache_get_row_int(0,7);
GFInfo[id][Time] = cache_get_row_int(0,8);
GFInfo[id][GfCooldown] = cache_get_row_int(0,9);
GFInfo[id][KillsOwner] = cache_get_row_int(0,10);
GFInfo[id][KillsAttacker] = cache_get_row_int(0,11);
GFInfo[id][Attacker] = cache_get_row_int(0,12);
GFInfo[id][gActive] = cache_get_row_int(0,15);
GFInfo[id][gID] = cache_get_row_int(0,13);
cache_get_row(0,14, tmp);format(GFInfo[id][Name], 128, "%s", tmp);
new string2[128];
printf("%d | %s(%d)",id,GetFactionName(GFInfo[id][OwnerID]),GFInfo[id][OwnerID]);
//printf("%d\n - %f - %f - %f - %f - OnGFLoad(%d)\nBesitzer: %s\nFarbe:%s\n%f - %f - %f ",GFInfo[id][gID],GFInfo[id][xMin],GFInfo[id][xMax],GFInfo[id][yMax],GFInfo[id][yMin],id,string,gz,GFInfo[id][ctfX],GFInfo[id][ctfY],GFInfo[id][ctfZ]);
GFInfo[id][gID] = GangZoneCreate(GFInfo[id][xMin],GFInfo[id][yMin],GFInfo[id][xMax],GFInfo[id][yMax]);
GFInfo[id][gPick] = CreatePickup(1314,1,GFInfo[id][ctfX],GFInfo[id][ctfY],GFInfo[id][ctfZ],0);
format(string2,sizeof(string2),"Gangfight:\nOwner:%s\nBenutze '/ctf' zum einnehmen!",GetFactionName(GFInfo[id][OwnerID]));
printf("%s",string2);
GFInfo[id][Owner] = Create3DTextLabel(string2,0x008080FF,GFInfo[id][ctfX],GFInfo[id][ctfY],GFInfo[id][ctfZ],10.0,0);
//GFInfo[id][GZ] = GangZoneCreate(119.084594, -214.033096, 343.084594, -62.033096);
return 1;
}
Das wars das sind jetzt insgesammt alle Funktionen die zum Laden Fungieren.