Mysql besser Speichern bzw freundlicher

Wichtiger Hinweis: Bitte ändert nicht manuell die Schriftfarbe auf schwarz sondern belasst es bei der Standardeinstellung. Somit tragt ihr dazu bei dass euer Text auch bei Verwendung unseren dunklen Forenstils noch lesbar ist!

Tipp: Ihr wollt längere Codeausschnitte oder Logfiles bereitstellen? Benutzt unseren eigenen PasteBin-Dienst Link
  • Guten Tag, ich habe ein Problem und zwar wenn es speichert, lagt der ganze Server.


    Ich mache es derzeit so:


    stock SpielerSpeichern(playerid)
    {
    if(GetPVarInt(playerid,"Eingeloggt")==1)
    {
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid,name,sizeof(name));
    mysql_SetInt("player","Level",GetPlayerScore(playerid), "Name", name);
    mysql_SetInt("player","Geld",GetPlayerMoney(playerid), "Name",name);
    mysql_SetInt("player","Adminlevel",GetPVarInt(playerid,"Adminlevel"), "Name",name);
    mysql_SetInt("player","Fraktion",GetPVarInt(playerid,"Fraktion"), "Name", name);
    mysql_SetInt("player","FRank",GetPVarInt(playerid,"FRank"), "Name", name);
    mysql_SetInt("player","Leader",GetPVarInt(playerid,"Leader"), "Name", name);
    mysql_SetInt("player","Bank",GetPVarInt(playerid,"Bank"), "Name", name);
    mysql_SetInt("player","Ticket",GetPVarInt(playerid,"Ticket"), "Name", name);
    mysql_SetInt("player","Wanted",GetPlayerWantedLevel(playerid), "Name", name);
    mysql_SetInt("player","Skin",GetPVarInt(playerid,"Skin"), "Name", name);
    mysql_SetInt("player","Warn",GetPVarInt(playerid,"Warn"), "Name", name);
    mysql_SetInt("player","Baned",GetPVarInt(playerid,"Baned"), "Name", name);
    mysql_SetInt("player","Job",GetPVarInt(playerid,"Job"), "Name", name);


    mysql_SetInt("player","bantime",GetPVarInt(playerid,"bantime"), "Name", name);
    mysql_SetInt("player","Car",GetPVarInt(playerid,"Car"), "Name", name);
    mysql_SetInt("player","Lkw",GetPVarInt(playerid,"Lkw"), "Name", name);
    mysql_SetInt("player","Boot",GetPVarInt(playerid,"Boot"), "Name", name);
    mysql_SetInt("player","Bike",GetPVarInt(playerid,"Bike"), "Name", name);
    mysql_SetInt("player","Drogen",GetPVarInt(playerid,"Drogen"), "Name", name);
    mysql_SetInt("player","Zivi",GetPVarInt(playerid,"Zivi"), "Name", name);
    mysql_SetInt("player","Bizkey",GetPVarInt(playerid,"Bizkey"), "Name", name);
    mysql_SetInt("player","Drugsplanted",GetPVarInt(playerid,"Drugsplanted"), "Name", name);
    mysql_SetInt("player","Housekey",GetPVarInt(playerid,"Housekey"), "Name", name);
    mysql_SetInt("player","Drogensamen",GetPVarInt(playerid,"Drogensamen"), "Name", name);
    mysql_SetInt("player","HatAuto",GetPVarInt(playerid,"HatAuto"), "Name", name);
    mysql_SetInt("player","Handy",GetPVarInt(playerid,"Handy"), "Name", name);
    mysql_SetInt("player","FSkin",GetPVarInt(playerid,"FSkin"), "Name", name);
    mysql_SetInt("player","Tankeninhaber",GetPVarInt(playerid,"Tankeninhaber"), "Name", name);
    mysql_SetInt("player","PDTime",GetPVarInt(playerid,"PDTime"), "Name", name);

    mysql_SetInt("player","FGehalt",GetPVarInt(playerid,"FGehalt"), "Name", name);
    mysql_SetInt("player","Tutorial",GetPVarInt(playerid,"Tutorial"), "Name", name);
    mysql_SetInt("player","Joints",GetPVarInt(playerid,"Joints"), "Name", name);
    mysql_SetInt("player","Blättchen",GetPVarInt(playerid,"Blättchen"), "Name", name);
    mysql_SetInt("player","Knastzeit",GetPVarInt(playerid,"Knastzeit"), "Name", name);
    mysql_SetInt("player","Jailed",GetPVarInt(playerid,"Jailed"), "Name", name);
    mysql_SetInt("player","Respekt",GetPVarInt(playerid,"Respekt"), "Name", name);
    mysql_SetInt("player","Perso",GetPVarInt(playerid,"Perso"), "Name", name);
    mysql_SetInt("player","Kills",GetPVarInt(playerid,"Kills"), "Name", name);
    mysql_SetInt("player","Tode",GetPVarInt(playerid,"Tode"), "Name", name);
    mysql_SetInt("player","Eingeloggt",GetPVarInt(playerid,"Eingeloggt"), "Name", name);
    mysql_SetInt("player","Waffenschein",GetPVarInt(playerid,"Waffenschein"), "Name", name);
    mysql_SetInt("player","Mats",GetPVarInt(playerid,"Mats"), "Name", name);
    }
    return 1;
    }


    Aber ich glaube es gibt dort auch eine bzw mehere freundlichere Lösung.


    Ich hoffe mir kann jemand helfen.


    mfg

  • Ja, sscanf + mysql_fetch_row_format ^^


    Sry wenn ich nicht mehr dazu sagen kann, bin aber gerade mit dem Handy nur online...

    ast2ufdyxkb1.png


    Leute, lernt scripten und versucht mal lieber etwas selber zu schreiben, als es aus einem GF zu kopieren. :S