Mysql speichert und lädt Daten nicht

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
  • Hey Leute,


    ich habe mein Script so umgeschrieben: [ SCRIPTING ] MySQL (Installation, Zugriff, Einstellungen, Login & Register Beispiel)
    Jedoch werden die PlayerInfo nichts gesetzt , nicht gespeichert und nicht geladen ?
    Wieso ?


    //LoadPlayer
    GetPlayerName(playerid, PlayerInfo[playerid][pName], MAX_PLAYER_NAME); //Wir Speichern den Namen des Spielers in der Variable [i]PlayerInfo[playerid][pName][/i]
    PlayerInfo[playerid][pLevel] = mysql_GetInt("accounts", "pLevel", "Name", PlayerInfo[playerid][pName]); //Wir holen uns den wert der unter "Level" eingetragen ist und Speichern ihn in unserer Variable.
    PlayerInfo[playerid][pAdmin] = mysql_GetInt("accounts", "pAdmin", "Name", PlayerInfo[playerid][pName]); //Wir holen uns den wert der unter "Geld" eingetragen ist und Speichern ihn in unserer Variable.
    PlayerInfo[playerid][pDonateRank] = mysql_GetInt("accounts", "pDonateRank", "Name", PlayerInfo[playerid][pName]); //Wir holen uns den wert der unter "Kills" eingetragen ist und Speichern ihn in unserer Variable.
    PlayerInfo[playerid][gPupgrade] = mysql_GetInt("accounts", "gPupgrade", "Name", PlayerInfo[playerid][pName]); //Wir holen uns den wert der unter "Tode" eingetragen ist und Speichern ihn in unserer Variable.
    PlayerInfo[playerid][pConnectTime] = mysql_GetInt("accounts", "pConnectTime", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pReg] = mysql_GetInt("accounts", "pReg", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pSex] = mysql_GetInt("accounts", "pSex", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pAge] = mysql_GetInt("accounts", "pAge", "Name", PlayerInfo[playerid][pName]);
    .....


    //Save Player


    PlayerInfo[playerid][pCash] = GetPlayerMoney(playerid);
    mysql_SetInt("accounts", "pLevel", PlayerInfo[playerid][pLevel], "Name", PlayerInfo[playerid][pName]);
    mysql_SetInt("accounts", "pAdmin", PlayerInfo[playerid][pAdmin], "Name", PlayerInfo[playerid][pName]);
    mysql_SetInt("accounts", "pDonateRank", PlayerInfo[playerid][pDonateRank], "Name", PlayerInfo[playerid][pName]);
    mysql_SetInt("accounts", "gPupgrade", PlayerInfo[playerid][gPupgrade], "Name", PlayerInfo[playerid][pName]);
    mysql_SetInt("accounts", "pConnectTime", PlayerInfo[playerid][pConnectTime], "Name", PlayerInfo[playerid][pName]);
    mysql_SetInt("accounts", "pReg", PlayerInfo[playerid][pReg], "Name", PlayerInfo[playerid][pName]);
    mysql_SetInt("accounts", "pSex", PlayerInfo[playerid][pSex], "Name", PlayerInfo[playerid][pName]);
    mysql_SetInt("accounts", "pAge", PlayerInfo[playerid][pAge], "Name", PlayerInfo[playerid][pName]);
    // Der Server geht an und die Mysql Verbindung besteht....
    // Der Rest bleibt ja gleich vom Tutorial.

    Screen von der Datenbank (Also so wie ich die Tabelle gemacht habe. Richgitg oder Falsch ?)

  • Lass mal mysql_Debug(1); mitschreiben und dann printe das uns mal!

  • Mach ich, aber vorher noch:


    Ist schlimm wenn ich das alte Ende von OnPlayerLogin in den stock LoadPlayer mit übernehme ?
    stock LoadPlayer(playerid)
    {
    new tmp2[256];
    new string2[64];
    new playername2[MAX_PLAYER_NAME];
    GetPlayerName(playerid, playername2, sizeof(playername2));
    if(IsPlayerConnected(playerid) && !IsPlayerNPC(playerid))//Wir fragen ab ob der angegebene Spieler auch Online ist, und kein NPC ist (nur zur sicherhheit)
    {
    GetPlayerName(playerid, PlayerInfo[playerid][pName], MAX_PLAYER_NAME); //Wir Speichern den Namen des Spielers in der Variable [i]PlayerInfo[playerid][pName][/i]
    PlayerInfo[playerid][pLevel] = mysql_GetInt("accounts", "pLevel", "Name", PlayerInfo[playerid][pName]); //Wir holen uns den wert der unter "Level" eingetragen ist und Speichern ihn in unserer Variable.
    PlayerInfo[playerid][pAdmin] = mysql_GetInt("accounts", "pAdmin", "Name", PlayerInfo[playerid][pName]); //Wir holen uns den wert der unter "Geld" eingetragen ist und Speichern ihn in unserer Variable.
    PlayerInfo[playerid][pDonateRank] = mysql_GetInt("accounts", "pDonateRank", "Name", PlayerInfo[playerid][pName]);
    //Kleiner Sprung.....
    PlayerInfo[playerid][pAdjustable] = 0;
    ResetPlayerMoney(playerid);
    ConsumingMoney[playerid] = 1;
    GivePlayerMoney(playerid,PlayerInfo[playerid][pCash]);
    CurrentMoney[playerid] = PlayerInfo[playerid][pCash];
    if(PlayerInfo[playerid][pReg] == 0)
    {
    PlayerInfo[playerid][pLevel] = 1;
    PlayerInfo[playerid][pSHealth] = 0.0;
    ....


    //mysql_debug(1); eingefügt aber es tut sich nichts:



    Loaded log file: "server_log.txt".
    ----------


    SA-MP Dedicated Server
    ----------------------
    v0.3d, (C)2005-2011 SA-MP Team


    [14:04:12]
    [14:04:12] Server Plugins
    [14:04:12] --------------
    [14:04:12] Loading plugin: streamer.so
    [14:04:12]


    *** Streamer Plugin v2.6 by Incognito loaded ***


    [14:04:12] Loaded.
    [14:04:12] Loading plugin: mysql.so
    [14:04:12]


    > MySQL plugin R5 successfully loaded.


    [14:04:12] Loaded.
    [14:04:12] Loaded 2 plugins.


    [14:04:12]
    [14:04:12] Ban list
    [14:04:12] --------
    [14:04:12] Loaded: samp.ban
    [14:04:12]
    [14:04:12]
    [14:04:12] Filterscripts
    [14:04:12] ---------------
    [14:04:12] Loading filterscript 'JunkBuster.amx'...
    [14:04:12]
    [14:04:12] [junkbuster] Current JunkBuster configuration:
    [14:04:12] [junkbuster] - WeaponHack = 0
    [14:04:12] [junkbuster] - MoneyHack = 1
    [14:04:12] [junkbuster] - Jetpack = 0
    [14:04:12] [junkbuster] - HealthHack = 0
    [14:04:12] [junkbuster] - ArmourHack = 0
    [14:04:12] [junkbuster] - DriveBy = 0
    [14:04:12] [junkbuster] - Spam = 1
    [14:04:12] [junkbuster] - CommandSpam = 0
    [14:04:12] [junkbuster] - BadWords = 1
    [14:04:12] [junkbuster] - CarJackHack = 0
    [14:04:12] [junkbuster] - TeleportHack = 1
    [14:04:12] [junkbuster] - MaxPing = 0
    [14:04:12] [junkbuster] - SpectateHack = 1
    [14:04:12] [junkbuster] - Blacklist = 1
    [14:04:12] [junkbuster] - IpBans = 1
    [14:04:12] [junkbuster] - TempBans = 1
    [14:04:12] [junkbuster] - SpawnKill = 1
    [14:04:12] [junkbuster] - CapsLock = 1
    [14:04:12] [junkbuster] - 3DSpeed = 0
    [14:04:12] [junkbuster] - MaxSpeed = 0
    [14:04:12] [junkbuster] - AdminImmunity = 1
    [14:04:12] [junkbuster] - Advertisement = 0
    [14:04:12] [junkbuster] - FreezeUpdate = 0
    [14:04:12] [junkbuster] - SpawnTime = 5
    [14:04:12] [junkbuster] - CheckpointTeleport = 1
    [14:04:12] [junkbuster] - Airbrake = 150
    [14:04:12] [junkbuster] - TankMode = 1
    [14:04:12] [junkbuster] - WarnPlayers = 0
    [14:04:12] [junkbuster] - SingleplayerCheats = 1
    [14:04:12] [junkbuster] - MinFPS = 0
    [14:04:12] [junkbuster] - DisableBadWeapons = 1
    [14:04:12] [junkbuster] - CBug = 16
    [14:04:12] [junkbuster] - AntiBugKill = 1
    [14:04:12] [junkbuster] - NoReload = 0
    [14:04:12] [junkbuster] - NoReloadForSawnOff = 4
    [14:04:12] [junkbuster] - ActiveGMC = 2
    [14:04:12] [junkbuster] - GMCBan = 0
    [14:04:12] [junkbuster] - ServerSideHealth = 1
    [14:04:12] [junkbuster] - CheckVMPos = 0
    [14:04:12] [junkbuster] - QuickTurn = 0
    [14:04:12] [junkbuster] - VehicleTeleport = 1
    [14:04:12] [junkbuster] - Wallride = 170
    [14:04:12] [junkbuster] - DisplayTextDraw = 1
    [14:04:12] [junkbuster] - AFK = 20
    [14:04:12] [junkbuster] - PickupTeleport = 1
    [14:04:12] [junkbuster] - FlyHack = 40
    [14:04:12] [junkbuster] - JunkBusterChrome = 1
    [14:04:12] [junkbuster] - CheckWalkAnims = 1
    [14:04:12] [junkbuster] - ReportMoneyHack = 1
    [14:04:12] [junkbuster] - SpeedhackAdvanced = 20
    [14:04:12] [junkbuster] - Joypad = 0
    [14:04:12] [junkbuster] - ArmedVehicles = 0
    [14:04:12] [junkbuster] - VehicleRepair = 0
    [14:04:12] [junkbuster] - TuningHack = 1
    [14:04:12] [junkbuster] - PayForGuns = 3
    [14:04:12] [junkbuster] - SpawnVehicles = 2
    [14:04:12] [junkbuster] - MaxTotalWarnings = 15
    [14:04:12] [junkbuster] - TooManyWarningsAction = 1
    [14:04:12]
    [14:04:12] [junkbuster] 0 IP-bans have been loaded.
    [14:04:12] [junkbuster] 0 temporary bans have been loaded.
    [14:04:12] [junkbuster] 0 whitelist entries have been loaded.
    [14:04:12] [junkbuster] 5 blacklist entries have been loaded.
    [14:04:12] [junkbuster] 41 bad words have been loaded.
    [14:04:12] [junkbuster] 4 forbidden weapons have been loaded.
    [14:04:12] [junkbuster] JunkBuster has been configurated.
    [14:04:12] [junkbuster] JunkBuster (v10.0) has successfully been loaded.
    [14:04:12] Loaded 1 filterscripts.


    [14:04:12] <-| [MYSQL] Verbindung zur Datenbank wurde erfolgreich hergestellt!
    [14:04:12] BizzInfo:0 Owner:Staat Message:~w~Waffenladen Entfee:5000 Till:0 Products:100/500 Interior:1.


    [14:04:12] BizzInfo:1 Owner:The State Message:~w~Gun Shop 2 Entfee:0 Till:0 Products:100/500 Interior:4.


    [14:04:12] BizzInfo:2 Owner:The State Message:~w~Restaurant Entfee:0 Till:0 Products:100/500 Interior:1.


    [14:04:12] BizzInfo:3 Owner:The State Message:~w~Police Armoury Entfee:0 Till:0 Products:500/500 Interior:10.


    [14:04:12] BizzInfo:4 Owner:The State Message:~w~City Bank Entfee:0 Till:0 Products:99619/100000 Interior:0.


    [14:04:12] SBizzInfo:0 Owner:crazy Message:LS-Medic Ammu-Nation Entfee:0 Till:15000 Products:100/100 Interior:0.


    [14:04:12] SBizzInfo:1 Owner:The State Message:~w~Wang Cars Entfee:0 Till:0 Products:100/100 Interior:0.


    [14:04:12] SBizzInfo:2 Owner:The State Message:~w~Phone Company Entfee:0 Till:1495 Products:100/100 Interior:0.


    [14:04:12] SBizzInfo:3 Owner:LaCookie Message:~w~Gas Company Entfee:20 Till:56845 Products:100/100 Interior:0.


    [14:04:12] SBizzInfo:4 Owner:The State Message:~w~Electricity Company Entfee:0 Till:274092 Products:100/100 Interior:0.


    [14:04:12] SBizzInfo:5 Owner:Staat Message:~w~Hotring Racerzz Entfee:5000 Till:150000 Products:100/100 Interior:0.


    [14:04:12] SBizzInfo:6 Owner:The State Message:~w~House Upgrade Entfee:0 Till:0 Products:100/100 Interior:0.


    [14:04:12] SBizzInfo:7 Owner:The State Message:~w~CNN Studio Entfee:0 Till:244300 Products:100/100 Interior:0.


    [14:04:12] SBizzInfo:8 Owner:The State Message:~w~Tow Car Service Entfee:0 Till:0 Products:100/100 Interior:0.


    [14:04:12] SBizzInfo:9 Owner:The State Message:~w~General Store Entfee:0 Till:0 Products:100/100 Interior:0.


    [14:04:12] SBizzInfo:10 Owner:TieGer Message:PunchLike Paintball-Arena Entfee:3500 Till:7000 Products:68/100 Interior:0.


    [14:04:12] SBizzInfo:11 Owner:The State Message:~w~Kart Track Entfee:0 Till:0 Products:100/100 Interior:0.


    [14:04:12] Family:0 Taken: 0 Name:None MOTD:None Leader:None Members:0 SpawnX:0.000000 SpawnY:0.000000 SpawnZ:0.000000 Int:0
    [14:04:12] Family:1 Taken: 0 Name:None MOTD:None Leader:None Members:0 SpawnX:0.000000 SpawnY:0.000000 SpawnZ:0.000000 Int:0
    [14:04:12] Family:2 Taken: 0 Name:None MOTD:None Leader:None Members:0 SpawnX:0.000000 SpawnY:0.000000 SpawnZ:0.000000 Int:0
    [14:04:12] Family:3 Taken: 0 Name:None MOTD:None Leader:None Members:0 SpawnX:0.000000 SpawnY:0.000000 SpawnZ:0.000000 Int:0
    [14:04:12] Family:4 Taken: 0 Name:None MOTD:None Leader:None Members:0 SpawnX:0.000000 SpawnY:0.000000 SpawnZ:0.000000 Int:0
    [14:04:12] Family:5 Taken: 0 Name:None MOTD:None Leader:None Members:0 SpawnX:0.000000 SpawnY:0.000000 SpawnZ:0.000000 Int:0
    [14:04:12] Family:6 Taken: 0 Name:None MOTD:None Leader:None Members:0 SpawnX:0.000000 SpawnY:0.000000 SpawnZ:0.000000 Int:0
    [14:04:12] Family:7 Taken: 0 Name:None MOTD:None Leader:None Members:0 SpawnX:0.000000 SpawnY:0.000000 SpawnZ:0.000000 Int:0
    [14:04:12] Family:8 Taken: 0 Name:None MOTD:None Leader:None Members:0 SpawnX:0.000000 SpawnY:0.000000 SpawnZ:0.000000 Int:0
    [14:04:12] Family:9 Taken: 0 Name:None MOTD:None Leader:None Members:0 SpawnX:0.000000 SpawnY:0.000000 SpawnZ:0.000000 Int:0
    [14:04:12] CK:0 Taken: 0 Sendername:No-one Giveplayer: No-one
    [14:04:12] CK:1 Taken: 0 Sendername:No-one Giveplayer: No-one
    [14:04:12] CK:2 Taken: 0 Sendername:No-one Giveplayer: No-one
    [14:04:12] CK:3 Taken: 0 Sendername:No-one Giveplayer: No-one
    [14:04:12] CK:4 Taken: 0 Sendername:No-one Giveplayer: No-one
    [14:04:12] CK:5 Taken: 0 Sendername:No-one Giveplayer: No-one
    [14:04:12] CK:6 Taken: 0 Sendername:No-one Giveplayer: No-one
    [14:04:12] CK:7 Taken: 0 Sendername:No-one Giveplayer: No-one
    [14:04:12] CK:8 Taken: 0 Sendername:No-one Giveplayer: No-one
    [14:04:12] CK:9 Taken: 0 Sendername:No-one Giveplayer: No-one
    [14:04:12] Paper:0 Used: 0 Maker:No-one. Title: No Title. Text1: I have no text inserted here yet. Text2: I have no text inserted here yet. Text3: I have no text inserted here yet. Text4: I have no text inserted here yet. Text5: I have no text inserted here yet. Text6: I have no text inserted here yet. Text7: I have no text inserted here ye
    [14:04:12] Paper:1 Used: 0 Maker:0
    Title: No Title. Text1: I have no text inserted here yet. Text2: I have no text inserted here yet. Text3: I have no text inserted here yet. Text4: I have no text inserted here yet. Text5: I have no text inserted here yet. Text6: I have no text inserted here yet. Text7: I have no text inserted here ye
    [14:04:12] Paper:2 Used: 0 Maker:No-one. Title: No Title. Text1: I have no text inserted here yet. Text2: I have no text inserted here yet. Text3: I have no text inserted here yet. Text4: I have no text inserted here yet. Text5: I have no text inserted here yet. Text6: I have no text inserted here yet. Text7: I have no text inserted here ye
    [14:04:12] Paper:3 Used: 0 Maker:0
    Title: No Title. Text1: I have no text inserted here yet. Text2: I have no text inserted here yet. Text3: I have no text inserted here yet. Text4: I have no text inserted here yet. Text5: I have no text inserted here yet. Text6: I have no text inserted here yet. Text7: I have no text inserted here ye
    [14:04:12] Paper:4 Used: 0 Maker:No-one. Title: No Title. Text1: I have no text inserted here yet. Text2: I have no text inserted here yet. Text3: I have no text inserted here yet. Text4: I have no text inserted here yet. Text5: I have no text inserted here yet. Text6: I have no text inserted here yet. Text7: I have no text inserted here ye
    [14:04:12] Paper:5 Used: 0 Maker:0
    Title: No Title. Text1: I have no text inserted here yet. Text2: I have no text inserted here yet. Text3: I have no text inserted here yet. Text4: I have no text inserted here yet. Text5: I have no text inserted here yet. Text6: I have no text inserted here yet. Text7: I have no text inserted here ye
    [14:04:12] Paper:6 Used: 0 Maker:No-one. Title: No Title. Text1: I have no text inserted here yet. Text2: I have no text inserted here yet. Text3: I have no text inserted here yet. Text4: I have no text inserted here yet. Text5: I have no text inserted here yet. Text6: I have no text inserted here yet. Text7: I have no text inserted here ye
    [14:04:12] Paper:7 Used: 0 Maker:0
    Title: No Title. Text1: I have no text inserted here yet. Text2: I have no text inserted here yet. Text3: I have no text inserted here yet. Text4: I have no text inserted here yet. Text5: I have no text inserted here yet. Text6: I have no text inserted here yet. Text7: I have no text inserted here ye
    [14:04:12] Paper:8 Used: 0 Maker:No-one. Title: No Title. Text1: I have no text inserted here yet. Text2: I have no text inserted here yet. Text3: I have no text inserted here yet. Text4: I have no text inserted here yet. Text5: I have no text inserted here yet. Text6: I have no text inserted here yet. Text7: I have no text inserted here ye
    [14:04:12] Paper:9 Used: 0 Maker:0
    Title: No Title. Text1: I have no text inserted here yet. Text2: I have no text inserted here yet. Text3: I have no text inserted here yet. Text4: I have no text inserted here yet. Text5: I have no text inserted here yet. Text6: I have no text inserted here yet. Text7: I have no text inserted here ye
    [14:04:12] AllowAdminTeleport() : function is deprecated. Please see OnPlayerClickMap()
    [14:04:12] Pickups Max = 100, Current Pickups = 46
    [14:04:12]
    [14:04:12]
    [14:04:12] German Reallife
    [14:04:12] _____________________
    [14:04:12]
    [14:04:12]
    [14:04:12] Number of vehicle models: 71


    /e: Server_Log