Geld per Hand abspeichern und Laden.

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
  • Ja halt bei mir wird z.B das Geld irgendwie net gespeichert wird gespeichert aber wenn man sich einloggt, dann steht da 0$, und wenn ich dann db gucke steht auch 0$


    hier ist mal ein ausug von dem Stock Speicher.


    stock SpielerSpeichern(playerid)
    {
    if(GetPVarInt(playerid,"loggedin")==1)
    {
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid,name,sizeof(name));
    ////////////Mysql Speichern Das letzte hat kein KOMMA ,
    new string[949],mysql[128];
    format(mysql, sizeof(mysql), "fuehrerschein='%d',",GetPVarInt(playerid,"Fuehrerschein"));
    strcat(string, mysql);
    format(mysql, sizeof(mysql), "flugschein='%d',",GetPVarInt(playerid,"flugschein"));
    strcat(string, mysql);
    format(mysql, sizeof(mysql), "bootschein='%d',",GetPVarInt(playerid,"bootschein"));
    strcat(string, mysql);
    format(mysql, sizeof(mysql), "lkwschein='%d',",GetPVarInt(playerid,"LKWschein"));
    strcat(string, mysql);
    format(mysql, sizeof(mysql), "waffenschein='%d',",GetPVarInt(playerid,"Waffenschein"));
    strcat(string, mysql);
    format(mysql, sizeof(mysql), "motorradschein='%d',",GetPVarInt(playerid,"Motorradschein"));
    strcat(string, mysql);
    format(mysql, sizeof(mysql), "level='%d',",GetPlayerScore(playerid));
    strcat(string, mysql);
    format(mysql, sizeof(mysql), "spielzeit='%d',",GetPVarInt(playerid,"spielzeit"));
    strcat(string, mysql);
    format(mysql, sizeof(mysql), "geld='%d',",GetPlayerMoney(playerid));
    strcat(string, mysql);
    format(mysql, sizeof(mysql), "adminlevel='%d',",GetPVarInt(playerid,"Adminlevel"));
    strcat(string, mysql);
    format(mysql, sizeof(mysql), "suplevel='%d',",GetPVarInt(playerid,"Suplevel"));
    strcat(string, mysql);
    format(mysql, sizeof(mysql), "maprang='%d',",GetPVarInt(playerid,"Maprang"));
    strcat(string, mysql);
    format(mysql, sizeof(mysql), "fraktion='%d',",GetPVarInt(playerid,"fraktion"));
    strcat(string, mysql);
    format(mysql, sizeof(mysql), "banned='%d',",GetPVarInt(playerid,"Baned"));
    strcat(string, mysql);
    format(mysql, sizeof(mysql), "perso='%d',",GetPVarInt(playerid,"Perso"));
    strcat(string, mysql);
    ////
    /*format(mysql, sizeof(mysql), "perso='%d',",GetPVarInt(playerid,"Perso"));
    strcat(string, mysql);*/
    if(Tot[playerid] == 0)
    {
    format(mysql, sizeof(mysql), "skinID='%d',",GetPlayerSkin(playerid));
    strcat(string, mysql);
    }
    format(mysql, sizeof(mysql), "zeitseitpd='%d',",GetPVarInt(playerid,"ZeitSeitPD"));
    strcat(string, mysql);
    format(mysql, sizeof(mysql), "vip='%d',",GetPVarInt(playerid,"VIP"));
    strcat(string, mysql);
    format(mysql, sizeof(mysql), "punkte='%d',",GetPVarInt(playerid,"punkte"));
    strcat(string, mysql);
    format(mysql, sizeof(mysql), "kopfgeld='%d',",GetPVarInt(playerid,"kopfgeld"));
    strcat(string, mysql);
    format(mysql, sizeof(mysql), "job='%d',",GetPVarInt(playerid,"JOB"));
    strcat(string, mysql);
    format(mysql, sizeof(mysql), "jobzeit='%d',",GetPVarInt(playerid,"JobZeit"));
    strcat(string, mysql);
    format(mysql, sizeof(mysql), "jobzeit='%d',",GetPVarInt(playerid,"JobZeit"));
    strcat(string, mysql);
    format(mysql, sizeof(mysql), "mautpass='%d',",GetPVarInt(playerid,"mautpass"));
    strcat(string, mysql);
    format(mysql, sizeof(mysql), "rang='%d',",GetPVarInt(playerid,"Rang"));
    strcat(string, mysql);
    format(mysql, sizeof(mysql), "phonek='%d',",GetPVarInt(playerid,"Phonek"));
    strcat(string, mysql);
    format(mysql, sizeof(mysql), "handytyp='%d',",GetPVarInt(playerid,"handytyp"));
    strcat(string, mysql);
    format(mysql, sizeof(mysql), "telebuch='%d',",GetPVarInt(playerid,"Telebuch"));
    strcat(string, mysql);
    format(mysql, sizeof(mysql), "pnummer='%d',",GetPVarInt(playerid,"Pnummer"));
    strcat(string, mysql);
    format(mysql, sizeof(mysql), "drogen='%d',",GetPVarInt(playerid,"drogen"));
    strcat(string, mysql);
    format(mysql, sizeof(mysql), "mats='%d',",GetPVarInt(playerid,"mats"));
    strcat(string, mysql);
    format(mysql, sizeof(mysql), "SpawnHaus='%d',",GetPVarInt(playerid,"SpawnHaus"));
    strcat(string, mysql);
    format(mysql, sizeof(mysql), "knastid='%d',",GetPVarInt(playerid,"KnastID"));
    strcat(string, mysql);
    format(mysql, sizeof(mysql), "knastzeit='%d',",GetPVarInt(playerid,"KnastZeit"));
    strcat(string, mysql);
    format(mysql, sizeof(mysql), "respektpunkte='%d',",GetPVarInt(playerid,"Respektpunkte"));
    strcat(string, mysql);
    format(mysql, sizeof(mysql), "respekt='%d',",GetPVarInt(playerid,"Respekt"));
    strcat(string, mysql);
    format(mysql, sizeof(mysql), "levelmoney='%d',",GetPVarInt(playerid,"LevelMoney"));
    strcat(string, mysql);
    format(mysql, sizeof(mysql), "bank='%d',",GetPVarInt(playerid,"Bank"));
    strcat(string, mysql);
    format(mysql, sizeof(mysql), "hauskey='%d',",GetPVarInt(playerid,"HausKey"));
    strcat(string, mysql);
    format(mysql, sizeof(mysql), "wanted='%d',",GetPVarInt(playerid,"Wanted"));
    strcat(string, mysql);
    format(mysql, sizeof(mysql), "jobgeld='%d',",GetPVarInt(playerid,"jobgeld"));
    strcat(string, mysql);
    format(mysql, sizeof(mysql), "leader='%d',",GetPVarInt(playerid,"Leader"));
    strcat(string, mysql);
    format(mysql, sizeof(mysql), "invite='%d',",GetPVarInt(playerid,"invite"));
    strcat(string, mysql);
    format(mysql, sizeof(mysql), "geschlecht='%d'",GetPVarInt(playerid,"Geschlecht"));
    strcat(string, mysql);

    //////////////////////////////////////////////////////////////
    new query[999];
    format(query, 999, "UPDATE benutzer SET %s WHERE name = '%s'",string,SpielerName(playerid));
    mysql_query(query);
    ////////////////////////////
    //mysql_SetInt("benutzer", "fuehrerschein", GetPVarInt(playerid,"Fuehrerschein"), "name", name);
    //mysql_SetInt("benutzer", "flugschein", GetPVarInt(playerid,"flugschein"), "name", name);
    //mysql_SetInt("benutzer", "bootschein", GetPVarInt(playerid,"bootschein"), "name", name);
    //mysql_SetInt("benutzer", "lkwschein", GetPVarInt(playerid,"LKWschein"), "name", name);
    //mysql_SetInt("benutzer", "waffenschein", GetPVarInt(playerid,"Waffenschein"), "name", name);
    //mysql_SetInt("benutzer", "motorradschein", GetPVarInt(playerid,"Motorradschein"), "name", name);
    //mysql_SetInt("benutzer", "level", GetPlayerScore(playerid), "name", name);
    //mysql_SetInt("benutzer", "spielzeit", GetPVarInt(playerid,"spielzeit"), "name", name);
    //mysql_SetInt("benutzer", "geld", GetPlayerMoney(playerid), "name", name);
    //mysql_SetInt("benutzer", "adminlevel", GetPVarInt(playerid,"Adminlevel"), "name", name);
    //mysql_SetInt("benutzer", "suplevel", GetPVarInt(playerid,"Suplevel"), "name", name);
    //mysql_SetInt("benutzer", "fraktion", GetPVarInt(playerid,"fraktion"), "name", name);
    //mysql_SetInt("benutzer", "banned", GetPVarInt(playerid,"Baned"), "name", name);
    //mysql_SetInt("benutzer", "perso", GetPVarInt(playerid,"Perso"), "name", name);
    //if(Tot[playerid] == 0)
    //{
    //mysql_SetInt("benutzer", "skinID",GetPlayerSkin(playerid), "name", name);
    //}
    //mysql_SetInt("benutzer", "zeitseitpd", GetPVarInt(playerid,"ZeitSeitPD"), "name", name);
    //mysql_SetInt("benutzer", "vip", GetPVarInt(playerid,"VIP"), "name", name);
    //mysql_SetInt("benutzer", "punkte", GetPVarInt(playerid,"punkte"), "name", name);
    //mysql_SetInt("benutzer", "kopfgeld", GetPVarInt(playerid,"kopfgeld"), "name", name);
    //mysql_SetInt("benutzer", "job", GetPVarInt(playerid,"JOB"), "name", name);
    //mysql_SetInt("benutzer", "jobzeit", GetPVarInt(playerid,"JobZeit"), "name", name);
    //mysql_SetInt("benutzer", "mautpass", GetPVarInt(playerid,"mautpass"), "name", name);
    //mysql_SetInt("benutzer", "rang", GetPVarInt(playerid,"Rang"), "name", name);
    //mysql_SetInt("benutzer", "phonek", GetPVarInt(playerid,"Phonek"), "name", name);
    //mysql_SetInt("benutzer", "pnummer", GetPVarInt(playerid,"Pnummer"), "name", name);
    //mysql_SetInt("benutzer", "drogen", GetPVarInt(playerid,"drogen"), "name", name);
    //mysql_SetInt("benutzer", "mats", GetPVarInt(playerid,"mats"), "name", name);
    //mysql_SetInt("benutzer", "SpawnHaus", GetPVarInt(playerid,"SpawnHaus"), "name", name);
    //mysql_SetInt("benutzer", "knastid", GetPVarInt(playerid,"KnastID"), "name", name);
    //mysql_SetInt("benutzer", "knastzeit", GetPVarInt(playerid,"KnastZeit"), "name", name);
    //mysql_SetInt("benutzer", "respektpunkte", GetPVarInt(playerid,"Respektpunkte"), "name", name);
    //mysql_SetInt("benutzer", "respekt", GetPVarInt(playerid,"Respekt"), "name", name);
    //mysql_SetInt("benutzer", "levelmoney", GetPVarInt(playerid,"LevelMoney"), "name", name);
    //mysql_SetInt("benutzer", "bank", GetPVarInt(playerid,"Bank"), "name", name);
    //mysql_SetInt("benutzer", "hauskey", GetPVarInt(playerid,"HausKey"), "name", name);
    //mysql_SetInt("benutzer", "wanted", GetPVarInt(playerid,"Wanted"), "name", name);
    //mysql_SetInt("benutzer", "leader", GetPVarInt(playerid,"Leader"), "name", name);
    //mysql_SetInt("benutzer", "invite", GetPVarInt(playerid,"invite"), "name", name);
    //mysql_SetInt("benutzer", "geschlecht", GetPVarInt(playerid,"Geschlecht"), "name", name);
    }
    return 1;
    }




    und hier aus dem Loadaccount:


    stock LoadAccount (playerid)
    {
    //new Spielerdatei[64];
    new name[MAX_PLAYER_NAME];
    //new string [124];
    GetPlayerName(playerid,name,sizeof(name));


    new query[999],data[999],geschlecht1,ZeitSeitPD1,perso1,spielzeit1,kopfgeld1,job1,vip1,hauskey1,pnummer1,adminlevel1,suplevel1,bank1,skinid1,drogen1,mats1,phonek1,telebuch1,leader1,punkte1,fueherschein1;
    format(query, 999, "SELECT geschlecht,zeitseitpd,perso,spielzeit,kopfgeld,job,vip,hauskey,pnummer,adminlevel,suplevel,bank,skinid,drogen,mats,phonek,telebuch,leader,punkte,fuehrerschein FROM benutzer WHERE name = '%s'",name);
    mysql_query(query);
    mysql_store_result();
    mysql_fetch_row_format(data," ");
    sscanf(data, "dddddddddddddddddddd",geschlecht1,ZeitSeitPD1,perso1,spielzeit1,kopfgeld1,job1,vip1,hauskey1,pnummer1,adminlevel1,suplevel1,bank1,skinid1,drogen1,mats1,phonek1,telebuch1,leader1,punkte1,fueherschein1);

    new flugschein1,bootschein1,lkwschein1,waffenschein1,motorradschein1,rang1,jobzeit1,respektpunkte1,respekt1,knastid1,knastzeit1,mautpass1,spawnhaus1,invite1,levelmoney1,wanted1,jobgeld1,fraktion1,maprang1,handytyp1;
    format(query, 999, "SELECT flugschein,bootschein,lkwschein,waffenschein,motorradschein,rang,jobzeit,respektpunkte,respekt,knastid,knastzeit,mautpass,spawnhaus,invite,levelmoney,wanted,jobgeld,fraktion,maprang,handytyp FROM benutzer WHERE name = '%s'",name);
    mysql_query(query);
    mysql_store_result();
    mysql_fetch_row_format(data," ");
    sscanf(data, "dddddddddddddddddddd",flugschein1,bootschein1,lkwschein1,waffenschein1,motorradschein1,rang1,jobzeit1,respektpunkte1,respekt1,knastid1,knastzeit1,mautpass1,spawnhaus1,invite1,levelmoney1,wanted1,jobgeld1,fraktion1,maprang1,handytyp1);

    SetPVarInt(playerid,"Level",GetPlayerScore(playerid));
    SetPVarInt(playerid,"SkinID",skinid1);
    SetPVarInt(playerid,"Adminlevel",adminlevel1);
    SetPVarInt(playerid,"Suplevel",suplevel1);
    SetPVarInt(playerid,"Maprang",maprang1);
    SetPVarInt(playerid,"spielzeit",spielzeit1);
    SetPVarInt(playerid,"handytyp",handytyp1);
    SetPVarInt(playerid,"Fraktion",fraktion1);
    SetPVarInt(playerid,"invite",invite1);
    SetPVarInt(playerid,"Geschlecht",geschlecht1);
    SetPVarInt(playerid,"Fuehrerschein",fueherschein1);
    SetPVarInt(playerid,"Flugschein",flugschein1);
    SetPVarInt(playerid,"Bootschein",bootschein1);
    SetPVarInt(playerid,"LKWschein",lkwschein1);
    SetPVarInt(playerid,"Waffenschein",waffenschein1);
    SetPVarInt(playerid,"Motorradschein",motorradschein1);
    SetPVarInt(playerid, "Bank",bank1);
    SetPVarInt(playerid, "Hauskey",hauskey1);
    SetPVarInt(playerid, "SpawnHaus",spawnhaus1);
    SetPVarInt(playerid, "Pnummer",pnummer1);
    SetPVarInt(playerid, "VIP",vip1);
    SetPVarInt(playerid, "punkte",punkte1);
    SetPVarInt(playerid, "kopfgeld",kopfgeld1);
    SetPVarInt(playerid, "Job",job1);
    SetPVarInt(playerid, "JobZeit", jobzeit1);
    SetPVarInt(playerid, "mautpass",mautpass1);
    SetPVarInt(playerid, "Rang",rang1);
    SetPVarInt(playerid, "Wanted",wanted1);
    SetPVarInt(playerid, "jobgeld",jobgeld1);
    SetPVarInt(playerid, "Perso",perso1);
    SetPVarInt(playerid, "Drogen", drogen1);
    SetPVarInt(playerid, "mats", mats1);
    SetPVarInt(playerid, "KnastID",knastid1);
    SetPVarInt(playerid, "KnastZeit",knastzeit1);
    SetPVarInt(playerid, "Phonek",phonek1);
    SetPVarInt(playerid, "Telebuch",telebuch1);
    SetPVarInt(playerid, "ZeitSeitPD", ZeitSeitPD1);
    SetPVarInt(playerid, "Respektpunkte",respektpunkte1);//Diese Variable zeigt wieviel Respektpunkte er hat.
    SetPVarInt(playerid, "Respekt",respekt1);//Diese Variable zeigt wieviel Respektpunkte nötig sind
    SetPVarInt(playerid, "LevelMoney",levelmoney1);
    SetPVarInt(playerid,"Leader",leader1);//und dieiese Variable zeigt wieviel das nächste Level kostet.

    new level1,geld1,age1;
    format(query, 999, "SELECT tot,level,geld,age FROM benutzer WHERE name = '%s'",SpielerName(playerid));
    mysql_query(query);
    mysql_store_result();
    mysql_fetch_row_format(data," ");
    sscanf(data, "dddd",Tot[playerid],level1,geld1,age1);

    if(Tot[playerid] == 1)
    {
    TOTP[playerid] = CreatePickup(1254,1,999,999,999);
    new string[200];
    format(string, sizeof(string), "{BEBEBE}Leichnam von \n{646464}%s",SpielerName(playerid));
    TOTL[playerid] = Create3DTextLabel(string,0x00C3FFFF, 999,999,999, 7, 0 , 0);
    SetTimerEx("Tottimer",180000,0,"i",playerid);
    mysql_SetString("benutzer", "tot","0", "name",SpielerName(playerid));
    }
    SetPlayerScore(playerid,level1);

    if(age1 >= 9)
    {
    SetPVarInt(playerid, "age",0);
    print("GB: GB wurde auf 0 gesetzt");
    }
    else
    {
    new alterstring[130];
    format(query, 999, "SELECT gb FROM benutzer WHERE name = '%s'", name);
    mysql_query(query);
    mysql_store_result();
    mysql_fetch_row(alterstring);
    mysql_free_result();
    new DateInfo[3][20];
    split(alterstring, DateInfo, '.');
    SetPVarInt(playerid, "age",GetPlayerAge(strval(DateInfo[0]),strval(DateInfo[1]),strval(DateInfo[2]))); ////ALTER HINZUGEFÜGT
    print("GB: GB wurde auf Datum gesetzt");
    }
    SetPVarInt(playerid,"loggedin",1);
    SpawnPlayer(playerid);
    return 1;
    }


    Bedank mich schonmal im Vorraus PEACE!