mysql_get_field Fehler

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
  • Moin,


    Fehler:


    C:\Users\Hieke\Desktop\ScriptHAUPT\gamemodes\UpDateV1.0R3.pwn(13993) : warning 213: tag mismatch
    C:\Users\Hieke\Desktop\ScriptHAUPT\gamemodes\UpDateV1.0R3.pwn(13996) : warning 213: tag mismatch
    C:\Users\Hieke\Desktop\ScriptHAUPT\gamemodes\UpDateV1.0R3.pwn(13999) : warning 213: tag mismatch
    C:\Users\Hieke\Desktop\ScriptHAUPT\gamemodes\UpDateV1.0R3.pwn(14002) : warning 213: tag mismatch
    C:\Users\Hieke\Desktop\ScriptHAUPT\gamemodes\UpDateV1.0R3.pwn(14005) : warning 213: tag mismatch
    C:\Users\Hieke\Desktop\ScriptHAUPT\gamemodes\UpDateV1.0R3.pwn(14008) : warning 213: tag mismatch
    C:\Users\Hieke\Desktop\ScriptHAUPT\gamemodes\UpDateV1.0R3.pwn(14011) : warning 213: tag mismatch
    C:\Users\Hieke\Desktop\ScriptHAUPT\gamemodes\UpDateV1.0R3.pwn(14014) : warning 213: tag mismatch
    C:\Users\Hieke\Desktop\ScriptHAUPT\gamemodes\UpDateV1.0R3.pwn(14017) : warning 213: tag mismatch
    C:\Users\Hieke\Desktop\ScriptHAUPT\gamemodes\UpDateV1.0R3.pwn(14020) : warning 213: tag mismatch


    mysql_get_field("sbentrancex", result);
    SBizzInfo[idx][sbEntranceX] = floatstr(result);

    mysql_get_field("sbentrancey", result);
    SBizzInfo[idx][sbEntranceY] = floatstr(result);

    mysql_get_field("sbentrancez", result);
    SBizzInfo[idx][sbEntranceZ] = floatstr(result);

    mysql_get_field("sblevelneeded", result);
    SBizzInfo[idx][sbLevelNeeded] = floatstr(result);


    mysql_get_field("sbbuyprice", result);
    SBizzInfo[idx][sbBuyPrice] = floatstr(result);

    mysql_get_field("sbentrancecost", result);
    SBizzInfo[idx][sbEntranceCost] = floatstr(result);

    mysql_get_field("sbtill", result);
    SBizzInfo[idx][sbTill] = floatstr(result);

    mysql_get_field("sblocked", result);
    SBizzInfo[idx][sbLocked] = floatstr(result);

    mysql_get_field("sbinterior", result);
    SBizzInfo[idx][sbInterior] = floatstr(result);

    mysql_get_field("sbproducts", result);
    SBizzInfo[idx][sbProducts] = floatstr(result);

    mysql_get_field("sbmaxproducts", result);
    SBizzInfo[idx][sbMaxProducts] = floatstr(result);

    mysql_get_field("sbpriceprod", result);
    SBizzInfo[idx][sbPriceProd] = floatstr(result);

    mysql_get_field("sbdate", result);
    SBizzInfo[idx][sbDate] = floatstr(result);


    Und paar Zeilen..


    Hab ich die falsche Include?
    Oder warum kommt das mit tag mismatch ?

  • ich kann auch falsch liegen da ich die funktion nicht kenne aber versuch trotzdem mal was dazu zu schreiben.
    anscheinend ist get_field für strings geeignet. aber sbEntranceX sieht mir wie ein float aus und sbproducts sieht wie ein integer.
    von daher würde ich für floats mysql_fetch_float(sqlfloat); verwenden und für integer mysql_fetch_int();

  • Hm ne da spuckt es mir gleich bei der ersten schon ein Error raus:


    error 017: undefined symbol "sqlfloat"


    Hier mal die Ganze Funktion:
    public LoadSBizz()
    {
    new result[164],query[180];
    /*for(new idx=0; idx<sizeof(SBizzInfo); idx++)
    {*/
    new idx=0;
    format(query, sizeof(query), "SELECT * FROM `sbizz`", idx);
    mysql_query(query);
    mysql_store_result();
    while(mysql_retrieve_row())
    {
    mysql_get_field("sbid", result);
    idx = strval(result);


    mysql_get_field("sbowned", result);
    SBizzInfo[idx][sbOwned] = strval(result);

    mysql_get_field("sbowner", SBizzInfo[idx][sbOwner]);
    mysql_get_field("sbmessage", SBizzInfo[idx][sbMessage]);
    mysql_get_field("sbextortion", SBizzInfo[idx][sbExtortion]);

    mysql_get_field("sbentrancex", result);
    SBizzInfo[idx][sbEntranceX] = floatstr(result);

    mysql_get_field("sbentrancey", result);
    SBizzInfo[idx][sbEntranceY] = floatstr(result);

    mysql_get_field("sbentrancez", result);
    SBizzInfo[idx][sbEntranceZ] = floatstr(result);

    mysql_get_field("sblevelneeded", result);
    SBizzInfo[idx][sbLevelNeeded] = floatstr(result);


    mysql_get_field("sbbuyprice", result);
    SBizzInfo[idx][sbBuyPrice] = floatstr(result);

    mysql_get_field("sbentrancecost", result);
    SBizzInfo[idx][sbEntranceCost] = floatstr(result);

    mysql_get_field("sbtill", result);
    SBizzInfo[idx][sbTill] = floatstr(result);

    mysql_get_field("sblocked", result);
    SBizzInfo[idx][sbLocked] = floatstr(result);

    mysql_get_field("sbinterior", result);
    SBizzInfo[idx][sbInterior] = floatstr(result);

    mysql_get_field("sbproducts", result);
    SBizzInfo[idx][sbProducts] = floatstr(result);

    mysql_get_field("sbmaxproducts", result);
    SBizzInfo[idx][sbMaxProducts] = floatstr(result);

    mysql_get_field("sbpriceprod", result);
    SBizzInfo[idx][sbPriceProd] = floatstr(result);

    mysql_get_field("sbdate", result);
    SBizzInfo[idx][sbDate] = floatstr(result);
    }
    printf("sGeschäfte geladen %s!", SBizzInfo[idx][sbOwner]);
    mysql_free_result();
    //}
    return 1;
    }


    Benutze MySQL Plugin R6, ich musste es mit jemanden zusammen so umschreiben, da es vorher so stand:
    (Gab zwar keine warnings aber ok)
    public LoadSBizz()
    {
    new val[128],query[256];
    for(new idx=0; idx<sizeof(SBizzInfo); idx++)
    {
    format(query, sizeof(query), "SELECT * FROM `sbizz` WHERE `sid`='%i'", idx);
    mysql_query(query);
    mysql_store_result();
    if(mysql_num_rows())
    {
    mysql_fetch_field_row(val,"sbowned");
    SBizzInfo[idx][sbOwned] = strval(val);

    mysql_fetch_field_row(SBizzInfo[idx][sbOwner],"sbowner");
    mysql_fetch_field_row(SBizzInfo[idx][sbMessage],"sbmessage");
    mysql_fetch_field_row(SBizzInfo[idx][sbExtortion],"sbextortion");

    mysql_fetch_field_row(val,"sbentrancex");
    SBizzInfo[idx][sbEntranceX] = floatstr(val);

    mysql_fetch_field_row(val,"sbentrancey");
    SBizzInfo[idx][sbEntranceY] = floatstr(val);

    mysql_fetch_field_row(val,"sbentrancez");
    SBizzInfo[idx][sbEntranceZ] = floatstr(val);

    mysql_fetch_field_row(val,"sblevelneeded");
    SBizzInfo[idx][sbLevelNeeded] = strval(val);

    mysql_fetch_field_row(val,"sbbuyprice");
    SBizzInfo[idx][sbBuyPrice] = strval(val);

    mysql_fetch_field_row(val,"sbentrancecost");
    SBizzInfo[idx][sbEntranceCost] = strval(val);

    mysql_fetch_field_row(val,"sbtill");
    SBizzInfo[idx][sbTill] = strval(val);

    mysql_fetch_field_row(val,"sblocked");
    SBizzInfo[idx][sbLocked] = strval(val);

    mysql_fetch_field_row(val,"sbinterior");
    SBizzInfo[idx][sbInterior] = strval(val);

    mysql_fetch_field_row(val,"sbproducts");
    SBizzInfo[idx][sbProducts] = strval(val);

    mysql_fetch_field_row(val,"sbmaxproducts");
    SBizzInfo[idx][sbMaxProducts] = strval(val);

    mysql_fetch_field_row(val,"sbpriceprod");
    SBizzInfo[idx][sbPriceProd] = strval(val);

    mysql_fetch_field_row(val,"sbdate");
    SBizzInfo[idx][sbDate] = strval(val);
    }
    mysql_free_result();
    }
    print("sGeschäfte geladen!");
    return 1;
    }


    Hat aber die Biz´s nicht geladen ...
    Hast vllt noch eine Idee, wie man es noch umschreiben könnte ?

  • Du lässt alle Inhalte von result in eine Dezimalzahl (Datentyp float) umwandeln, wobei scheinbar dieser Datentyp nicht bei der Deklarierung angegeben wurde. Entweder strval verwenden oder den Datentyp nachträglich ergänzen.

  • Du lässt alle Inhalte von result in eine Dezimalzahl (Datentyp float) umwandeln, wobei scheinbar dieser Datentyp nicht bei der Deklarierung angegeben wurde. Entweder strval verwenden oder den Datentyp nachträglich ergänzen.


    perfekt :)


    Mit strval funktioniert es jetzt. Danke euch beiden.


    (e)1: Server zeigt keine Errors bzw- warnings mehr.
    Dafür jetzt Gamemode "Unknown".
    Mom log kommt gleich


    (e)2: Hier die Server Log, der Gamemode wird geladen ?(

    Spoiler anzeigen
    SA-MP Dedicated Server
    ----------------------
    v0.3e-R2, (C)2005-2012 SA-MP Team

    Spoiler anzeigen
    [17:20:38] mapname = "San Andreas" (string)
    [17:20:38]
    [17:20:38] Server Plugins
    [17:20:38] --------------
    [17:20:38] Loading plugin: streamer.so
    [17:20:38]

    Spoiler anzeigen
    *** Streamer Plugin v2.6.1 by Incognito loaded ***

    Spoiler anzeigen
    [17:20:38] Loaded.
    [17:20:38] Loading plugin: sscanf.so
    [17:20:38]

    Spoiler anzeigen
    [17:20:38] ===============================

    Spoiler anzeigen
    [17:20:38] sscanf plugin loaded.

    Spoiler anzeigen
    [17:20:38] (c) 2009 Alex "Y_Less" Cole

    Spoiler anzeigen
    [17:20:38] 0.3d-R2 500 Players "dnee"

    Spoiler anzeigen
    [17:20:38] ===============================

    Spoiler anzeigen
    [17:20:38] Loaded.
    [17:20:38] Loading plugin: mysql.so
    [17:20:38]

    Spoiler anzeigen
    > MySQL plugin R6 successfully loaded.

    Spoiler anzeigen
    [17:20:38] Loaded.
    [17:20:38] Loading plugin: crashdetect.so
    [17:20:38] crashdetect v4.8.4 is OK.
    [17:20:38] Loaded.
    [17:20:38] Loaded 4 plugins.

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

    Spoiler anzeigen
    [17:20:38] -------------------------------- --------
    [17:20:38] Savebox Filterscript geladen
    [17:20:38] ---------------------------------------

    Spoiler anzeigen
    [17:20:38] SQL-LITE: Versuche mit SQL-Datenbank zu öffnen ...
    [17:20:38] SQL-LITE: Datenbank verbindung hergestellt!
    [17:20:38] CREATE TABLE IF NOT EXISTS "dtsb_SaveBoxs" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL ,"Frak" INTAGER NOT NULL ,"PosX" VARCHAR NOT NULL ,"PosY" VARCHAR NOT NULL ,"PosZ" VARCHAR NOT NULL ,"RotZ" VARCHAR NOT NULL ,"Int" INTAGER NOT NULL DEFAULT '0', "VW" INTAGER NOT NULL DEFAULT '0', "Mats" INTAGER NOT NULL DEFAULT '0',`Drugs` INTAGER NOT NULL DEFAULT '0',"9mm" INTAGER NOT NULL DEFAULT '0',"s9mm" INTAGER NOT NULL DEFAULT '0',"Deagle" INTAGER NOT NULL DEFAULT '0',"Shotgun" INTAGER NOT NULL DEFAULT '0',"sShotgun" INTAGER NOT NULL DEFAULT '0',"cShotgun" INTAGER NOT NULL DEFAULT '0',"mUzi" INTAGER NOT NULL DEFAULT '0',"Mp5" INTAGER NOT NULL DEFAULT '0',"Tec9" INTAGER NOT NULL DEFAULT '0',"M4" INTAGER NOT NULL DEFAULT '0',"Ak47" INTAGER NOT NULL DEFAULT '0');
    [17:20:38] Loaded 3 filterscripts.

    Spoiler anzeigen
    [17:20:38] foreach called
    [17:20:38] Lade Häuser..
    [17:20:38] Häuser geladen!
    [17:20:38] Lade Blacklisten..
    [17:20:38] Blacklisten geladen!
    [17:20:38] Lade Geschäfte..
    [17:20:38] Geschäfte geladen!
    [17:20:38] Lade sGeschäfte..
    [17:20:38] [debug] Run time error 4: "Array index out of bounds"
    [17:20:38] [debug] Accessing element at index 34 past array upper bound 33
    [17:20:38] [debug] AMX backtrace:
    [17:20:38] [debug] #0 0006a1e4 in ?? () from UpDateV1.0R3.amx
    [17:20:38] [debug] #1 0006b010 in public Itter_OnGameModeInit () from UpDateV1.0R3.amx
    [17:20:38] [debug] #2 native CallLocalFunction () [080dc980] from samp9495_2018
    [17:20:38] [debug] #3 00004cb8 in public Streamer_OnGameModeInit () from UpDateV1.0R3.amx
    [17:20:38] [debug] #4 native CallLocalFunction () [080dc980] from samp9495_2018
    [17:20:38] [debug] #5 00003548 in public OnGameModeInit () from UpDateV1.0R3.amx
    [17:20:38]
    [17:20:38] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
    [17:20:38] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
    [17:20:38] Scriptversion V1.0 R3
    [17:20:38] (c) Mainscripy by MVD | My Virtual World
    [17:20:38] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
    [17:20:38] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
    [17:20:38]
    [17:20:38]
    [17:20:38] Number of vehicle models: 6

    (e)3: Fällt euch noch was ein ? - Zeilen bei Serverlog vergessen ..

    Einmal editiert, zuletzt von ReborN ()