Hey,
Habe folgendes Problem...
Die Speicherung Spamt mir die Datenbank Komplett zu..
Verstehe aber nicht warum kann mir jemand helfen?
Wo ich die Speicherung ausführe:
Code
public Erstellengraff(playerid)
{
new v = random(200+200);
POBJECT[playerid] += v;
DestroyDynamicObject(POBJECT[playerid]); //Das Alte Object Löschen!
POBJECT[playerid] = CreateDynamicObject(19482, Position[playerid][0], Position[playerid][1], Position[playerid][2], Position[playerid][3], Position[playerid][4], Position[playerid][5], GetPlayerVirtualWorld(playerid), GetPlayerInterior(playerid), -1, 200);//Erstellung des Objects
SetDynamicObjectMaterialText(POBJECT[playerid], 0, POBJECTN[playerid], OBJECT_MATERIAL_SIZE_256x256, "Diploma", 25, 0, 0xFFFFFFFF, 0, 1);//Einstellung des Textes
GameTextForPlayer(playerid, "~w~Spruehen ]", 5000, 5);
DeletePVar(playerid, "GraffitiErstellung"); //PVar Löschen
SprayMunition[playerid] = 0;
Spruhen ++;
for(new i=1;i<MAX_GRAFFITI;i++)
{
new query[128];
Graffiti[i][gCreated] = 1;
format(query, sizeof(query), "INSERT INTO `server_graffitis` (GraffiID) VALUES ('%d')", i);
mysql_function_query(MySqlConnection, query, false, "", "");
format(Graffiti[i][gGraffiName], 16, "%s", POBJECTN[playerid]);
format(Graffiti[i][gGraffiErsteller], 16, "%s", GetName(playerid));
Graffiti[i][gGraffiID] = POBJECT[playerid];
Graffiti[i][gGraffiX] = Position[playerid][0];
Graffiti[i][gGraffiY] = Position[playerid][1];
Graffiti[i][gGraffiZ] = Position[playerid][2];
Graffiti[i][gGraffiX2] = Position[playerid][3];
Graffiti[i][gGraffiY2] = Position[playerid][4];
Graffiti[i][gGraffiZ2] = Position[playerid][5];
SaveGraffitis();
}
return 1;
}
Alles anzeigen
Speichern:
Code
public SaveGraffitis()
{
new count = 0, mainQuery[1537], secondQuery[256];
for(new i=1;i<MAX_GRAFFITI;i++)
{
if(Graffiti[i][gCreated] == 1)
{
format(secondQuery, sizeof(secondQuery), "UPDATE `server_graffitis` SET `GraffiObj`='%d', `GraffiX`='%f' `GraffiY`='%f' `GraffiZ`='%f', `GraffiX2`='%f' `GraffiY2`='%f' `GraffiZ2`='%f', ",
Graffiti[i][gGraffiObj], Graffiti[i][gGraffiX], Graffiti[i][gGraffiY], Graffiti[i][gGraffiZ], Graffiti[i][gGraffiX2], Graffiti[i][gGraffiY2], Graffiti[i][gGraffiZ2]);
strcat(mainQuery, secondQuery);
format(secondQuery, sizeof(secondQuery), "`Ersteller`='%s', `Name`='%s' WHERE `GraffiID`='%d' ",
Graffiti[i][gGraffiErsteller], Graffiti[i][gGraffiName], Graffiti[i][gGraffiID]);
strcat(mainQuery, secondQuery);
print(mainQuery);
mysql_function_query(MySqlConnection, mainQuery, false, "", "");
strdel(mainQuery, 0, sizeof(mainQuery));
count++;
printf("[SAVE] Graffiti wurden gespeichert. (%d/%d)", count, MAX_GRAFFITI);
}
}
return 1;
}
Alles anzeigen