Ich hab mal ne Frage, weil ich mein Script "etwas" Resourcensparender schreiben möchte
stock SpielerSpeichern(playerid)
{
if(IsPlayerConnected(playerid) && !IsPlayerNPC(playerid))
{
if(GetPVarInt(playerid,"Eingeloggt") == 1)
{
new query[2800], sstring[128];
format(sstring, sizeof(sstring), "UPDATE accounts SET Level = '%d' WHERE Name = '%s'", Spieler[playerid][sLevel], SpielerName(playerid));
strcat(query, sstring);
format(sstring, sizeof(sstring), "UPDATE accounts SET Geld = '%d' WHERE Name = '%s'", Spieler[playerid][sGeld], SpielerName(playerid));
strcat(query, sstring);
format(sstring, sizeof(sstring), "UPDATE accounts SET Kills = '%d' WHERE Name = '%s'", Spieler[playerid][sKills], SpielerName(playerid));
strcat(query, sstring);
format(sstring, sizeof(sstring), "UPDATE accounts SET Tode = '%d' WHERE Name = '%s'", Spieler[playerid][sTode], SpielerName(playerid));
strcat(query, sstring);
format(sstring, sizeof(sstring), "UPDATE accounts SET Premium = '%d' WHERE Name = '%s'", Spieler[playerid][sPremium], SpielerName(playerid));
strcat(query, sstring);
format(sstring, sizeof(sstring), "UPDATE accounts SET Premiumpunkte = '%d' WHERE Name = '%s'", Spieler[playerid][sPremiumpunkte], SpielerName(playerid));
strcat(query, sstring);
format(sstring, sizeof(sstring), "UPDATE accounts SET Geschlecht = '%d' WHERE Name = '%s'", Spieler[playerid][sGeschlecht], SpielerName(playerid));
strcat(query, sstring);
format(sstring, sizeof(sstring), "UPDATE accounts SET Fraktion = '%d' WHERE Name = '%s'", Spieler[playerid][sFraktion], SpielerName(playerid));
strcat(query, sstring);
format(sstring, sizeof(sstring), "UPDATE accounts SET Rang = '%d' WHERE Name = '%s'", Spieler[playerid][sRang], SpielerName(playerid));
strcat(query, sstring);
format(sstring, sizeof(sstring), "UPDATE accounts SET Startbonus = '%d' WHERE Name = '%s'", Spieler[playerid][sStartbonus], SpielerName(playerid));
strcat(query, sstring);
format(sstring, sizeof(sstring), "UPDATE accounts SET Waffenschein = '%d' WHERE Name = '%s'", Spieler[playerid][sWaffenschein], SpielerName(playerid));
strcat(query, sstring);
format(sstring, sizeof(sstring), "UPDATE accounts SET Verwarnungen = '%d' WHERE Name = '%s'", Spieler[playerid][sWarns], SpielerName(playerid));
strcat(query, sstring);
format(sstring, sizeof(sstring), "UPDATE accounts SET Gebannt = '%d' WHERE Name = '%s'", Spieler[playerid][sGebannt], SpielerName(playerid));
strcat(query, sstring);
format(sstring, sizeof(sstring), "UPDATE accounts SET Adminlevel = '%d' WHERE Name = '%s'", Spieler[playerid][sAdmin], SpielerName(playerid));
strcat(query, sstring);
format(sstring, sizeof(sstring), "UPDATE accounts SET Punkte = '%d' WHERE Name = '%s'", Spieler[playerid][sPunkte], SpielerName(playerid));
strcat(query, sstring);
format(sstring, sizeof(sstring), "UPDATE accounts SET Bankkonto = '%d' WHERE Name = '%s'", Spieler[playerid][sBank], SpielerName(playerid));
strcat(query, sstring);
format(sstring, sizeof(sstring), "UPDATE accounts SET Skin = '%d' WHERE Name = '%s'", Spieler[playerid][sSkin], SpielerName(playerid));
strcat(query, sstring);
format(sstring, sizeof(sstring), "UPDATE accounts SET Beruf = '%d' WHERE Name = '%s'", Spieler[playerid][sJob], SpielerName(playerid));
strcat(query, sstring);
format(sstring, sizeof(sstring), "UPDATE accounts SET Tutorial = '%d' WHERE Name = '%s'", Spieler[playerid][sTutorial], SpielerName(playerid));
strcat(query, sstring);
format(sstring, sizeof(sstring), "UPDATE accounts SET PayDay = '%d' WHERE Name = '%s'", Spieler[playerid][sPayDay], SpielerName(playerid));
strcat(query, sstring);
format(sstring, sizeof(sstring), "UPDATE accounts SET Wanteds = '%d' WHERE Name = '%s'", Spieler[playerid][sWanteds], SpielerName(playerid));
strcat(query, sstring);
format(sstring, sizeof(sstring), "UPDATE accounts SET Alter = '%d' WHERE Name = '%s'", Spieler[playerid][sAlter], SpielerName(playerid));
strcat(query, sstring);
format(sstring, sizeof(sstring), "UPDATE accounts SET Arbeitslosengeld = '%d' WHERE Name = '%s'", Spieler[playerid][sArbeitslosengeld], SpielerName(playerid));
strcat(query, sstring);
format(sstring, sizeof(sstring), "UPDATE accounts SET Handynummer = '%d' WHERE Name = '%s'", Spieler[playerid][sHandynummer], SpielerName(playerid));
strcat(query, sstring);
format(sstring, sizeof(sstring), "UPDATE accounts SET Jobsperre = '%d' WHERE Name = '%s'", Spieler[playerid][sJobSperre], SpielerName(playerid));
strcat(query, sstring);
format(sstring, sizeof(sstring), "UPDATE accounts SET Brechstange = '%d' WHERE Name = '%s'", Spieler[playerid][sBrechstange], SpielerName(playerid));
strcat(query, sstring);
mysql_query(query);
}
}
return 1;
}
{
if(IsPlayerConnected(playerid) && !IsPlayerNPC(playerid))
{
if(GetPVarInt(playerid,"Eingeloggt") == 1)
{
new query[2800], sstring[128];
format(sstring, sizeof(sstring), "UPDATE accounts SET Level = '%d' WHERE Name = '%s'", Spieler[playerid][sLevel], SpielerName(playerid));
strcat(query, sstring);
format(sstring, sizeof(sstring), "UPDATE accounts SET Geld = '%d' WHERE Name = '%s'", Spieler[playerid][sGeld], SpielerName(playerid));
strcat(query, sstring);
format(sstring, sizeof(sstring), "UPDATE accounts SET Kills = '%d' WHERE Name = '%s'", Spieler[playerid][sKills], SpielerName(playerid));
strcat(query, sstring);
format(sstring, sizeof(sstring), "UPDATE accounts SET Tode = '%d' WHERE Name = '%s'", Spieler[playerid][sTode], SpielerName(playerid));
strcat(query, sstring);
format(sstring, sizeof(sstring), "UPDATE accounts SET Premium = '%d' WHERE Name = '%s'", Spieler[playerid][sPremium], SpielerName(playerid));
strcat(query, sstring);
format(sstring, sizeof(sstring), "UPDATE accounts SET Premiumpunkte = '%d' WHERE Name = '%s'", Spieler[playerid][sPremiumpunkte], SpielerName(playerid));
strcat(query, sstring);
format(sstring, sizeof(sstring), "UPDATE accounts SET Geschlecht = '%d' WHERE Name = '%s'", Spieler[playerid][sGeschlecht], SpielerName(playerid));
strcat(query, sstring);
format(sstring, sizeof(sstring), "UPDATE accounts SET Fraktion = '%d' WHERE Name = '%s'", Spieler[playerid][sFraktion], SpielerName(playerid));
strcat(query, sstring);
format(sstring, sizeof(sstring), "UPDATE accounts SET Rang = '%d' WHERE Name = '%s'", Spieler[playerid][sRang], SpielerName(playerid));
strcat(query, sstring);
format(sstring, sizeof(sstring), "UPDATE accounts SET Startbonus = '%d' WHERE Name = '%s'", Spieler[playerid][sStartbonus], SpielerName(playerid));
strcat(query, sstring);
format(sstring, sizeof(sstring), "UPDATE accounts SET Waffenschein = '%d' WHERE Name = '%s'", Spieler[playerid][sWaffenschein], SpielerName(playerid));
strcat(query, sstring);
format(sstring, sizeof(sstring), "UPDATE accounts SET Verwarnungen = '%d' WHERE Name = '%s'", Spieler[playerid][sWarns], SpielerName(playerid));
strcat(query, sstring);
format(sstring, sizeof(sstring), "UPDATE accounts SET Gebannt = '%d' WHERE Name = '%s'", Spieler[playerid][sGebannt], SpielerName(playerid));
strcat(query, sstring);
format(sstring, sizeof(sstring), "UPDATE accounts SET Adminlevel = '%d' WHERE Name = '%s'", Spieler[playerid][sAdmin], SpielerName(playerid));
strcat(query, sstring);
format(sstring, sizeof(sstring), "UPDATE accounts SET Punkte = '%d' WHERE Name = '%s'", Spieler[playerid][sPunkte], SpielerName(playerid));
strcat(query, sstring);
format(sstring, sizeof(sstring), "UPDATE accounts SET Bankkonto = '%d' WHERE Name = '%s'", Spieler[playerid][sBank], SpielerName(playerid));
strcat(query, sstring);
format(sstring, sizeof(sstring), "UPDATE accounts SET Skin = '%d' WHERE Name = '%s'", Spieler[playerid][sSkin], SpielerName(playerid));
strcat(query, sstring);
format(sstring, sizeof(sstring), "UPDATE accounts SET Beruf = '%d' WHERE Name = '%s'", Spieler[playerid][sJob], SpielerName(playerid));
strcat(query, sstring);
format(sstring, sizeof(sstring), "UPDATE accounts SET Tutorial = '%d' WHERE Name = '%s'", Spieler[playerid][sTutorial], SpielerName(playerid));
strcat(query, sstring);
format(sstring, sizeof(sstring), "UPDATE accounts SET PayDay = '%d' WHERE Name = '%s'", Spieler[playerid][sPayDay], SpielerName(playerid));
strcat(query, sstring);
format(sstring, sizeof(sstring), "UPDATE accounts SET Wanteds = '%d' WHERE Name = '%s'", Spieler[playerid][sWanteds], SpielerName(playerid));
strcat(query, sstring);
format(sstring, sizeof(sstring), "UPDATE accounts SET Alter = '%d' WHERE Name = '%s'", Spieler[playerid][sAlter], SpielerName(playerid));
strcat(query, sstring);
format(sstring, sizeof(sstring), "UPDATE accounts SET Arbeitslosengeld = '%d' WHERE Name = '%s'", Spieler[playerid][sArbeitslosengeld], SpielerName(playerid));
strcat(query, sstring);
format(sstring, sizeof(sstring), "UPDATE accounts SET Handynummer = '%d' WHERE Name = '%s'", Spieler[playerid][sHandynummer], SpielerName(playerid));
strcat(query, sstring);
format(sstring, sizeof(sstring), "UPDATE accounts SET Jobsperre = '%d' WHERE Name = '%s'", Spieler[playerid][sJobSperre], SpielerName(playerid));
strcat(query, sstring);
format(sstring, sizeof(sstring), "UPDATE accounts SET Brechstange = '%d' WHERE Name = '%s'", Spieler[playerid][sBrechstange], SpielerName(playerid));
strcat(query, sstring);
mysql_query(query);
}
}
return 1;
}
Ist das Resourcenfressend? Wie geht es sparender?