Ich habe ein Problem mit meinem MySQL GangZonen System undzwar speichert es nicht in die Datenbank
enum GWInfo{
gwid,
Float:gwx,
Float:gwy,
Float:gwxx,
Float:gwyy,
gwname[60],
gwwirderstellt
}
new GangZone[MAX_GWZONEN][GWInfo];
OnGamemodeInit:
for(new i=0;i<MAX_GWZONEN;i++)
{
format(query, sizeof(query),"SELECT * FROM gfzonen WHERE id='%i'",i);
mysql_function_query(dbhandle,query,true,"LoadGangZone","i",i);
}
ocmd:creategangzone(playerid, params[])
{
new name, Float:X, Float:Y, Float:Z;
if(sscanf(params, "s", name))return SendClientMessage(playerid, -1, "Benutzung: /creategangzone [Zonen-Name]");
GetPlayerPos(playerid, X, Y, Z);
GangZone[gfidx][gwx] = X;
GangZone[gfidx][gwy] = Y;
GangZone[gfidx][gwwirderstellt] = 1;
GangZone[gfidx][gwname] = name;
SendClientMessage(playerid, -1, "Benutze nun bitte /pos2!");
return 1;
}
ocmd:pos2(playerid)
{
new Float:X, Float:Y, Float:Z, query[128];
if(GangZone[gfidx][gwwirderstellt] != 1)return SendClientMessage(playerid, -1, "Du musst erst /creategangzone benutzen!");
GetPlayerPos(playerid, X, Y, Z);
GangZone[gfidx][gwxx] = X;
GangZone[gfidx][gwyy] = Y;
format(query, sizeof(query),"INSERT INTO gfzonen(Name, X, Y, XX, YY) VALUES('%s', '%f', '%f', '%f', '%f', '%f', '%f')",GangZone[gfidx][gwname], GangZone[gfidx][gwx], GangZone[gfidx][gwy], GangZone[gfidx][gwxx], GangZone[gfidx][gwyy]);
mysql_function_query(dbhandle,query,false,"", "");
gfidx ++;
return 1;
}
public LoadGangZone(zonenid)
{
//gwid, Float:gwx, Float:gwy, Float:gwz, gwxx, gwyy, gwzz,gwname[60]
GangZone[zonenid][gwx] = cache_get_field_content_float(0, "X", dbhandle);
GangZone[zonenid][gwy] = cache_get_field_content_float(0, "Y", dbhandle);
GangZone[zonenid][gwxx] = cache_get_field_content_float(0, "XX", dbhandle);
GangZone[zonenid][gwyy] = cache_get_field_content_float(0, "YY", dbhandle);
cache_get_field_content(0, "Name",GangZone[zonenid][gwname],dbhandle);
gfidx = cache_get_field_content_int(0, "id", dbhandle);
}