Beiträge von DJ Deagle

    kann es sein das du den intger als string sendest?
    WHERE Id = %s
    oder
    WHERE Id = %d


    stock GetMySQLint(Table[], Field[], Where[], Is[])
    {
    new query[128];
    mysql_real_escape_string(Table, Table);
    mysql_real_escape_string(Field, Field);
    mysql_real_escape_string(Where, Where);
    mysql_real_escape_string(Is, Is);
    format(query, 128, "SELECT `%s` FROM `%s` WHERE `%s` = '%s'", Field, Table, Where, Is);
    mysql_query(query);
    mysql_store_result();
    new sqlint = mysql_fetch_int();
    mysql_free_result();
    return sqlint;
    }


    dafuq, das is von maddin wtf

    OK, habs nun so:
    stock LoadHouse(HouseID)
    {
    new str[128];
    HausInfo[HouseID][hID] = GetMySQLint("haeuser", "ID", "ID", HausInfo[HouseID][hID]);
    HausInfo[HouseID][hPosX] = GetMySQLfloat("haeuser", "PosX", "ID", HausInfo[HouseID][hID]);
    HausInfo[HouseID][hPosY] = GetMySQLfloat("haeuser", "PosY", "ID", HausInfo[HouseID][hID]);
    HausInfo[HouseID][hPosZ] = GetMySQLfloat("haeuser", "PosZ", "ID", HausInfo[HouseID][hID]);
    HausInfo[HouseID][hLevel] = GetMySQLint("haeuser", "Level", "ID", HausInfo[HouseID][hID]);
    HausInfo[HouseID][hPreis] = GetMySQLint("haeuser", "Preis", "ID", HausInfo[HouseID][hID]);
    format(HausInfo[HouseID][hBesitzer],24,"%s",GetMySQLstring("haeuser", "PosZ", "ID", HausInfo[HouseID][hID]));
    HausInfo[HouseID][hBought] = GetMySQLint("haeuser", "Bought", "ID", HausInfo[HouseID][hID]);
    HausInfo[HouseID][hPickup] = CreatePickup(1239,1,HausInfo[HouseID][hPosZ],HausInfo[HouseID][hPosY],HausInfo[HouseID][hPosZ],0);
    if(HausInfo[HouseID][hBought] == 0)
    {
    format(str,sizeof(str),"Dieses Haus ist zu verkaufen!\nLevel: %d\nPreis: %d€",HausInfo[HouseID][hLevel],HausInfo[HouseID][hPreis]);
    }
    else
    {
    format(str,sizeof(str),"Besitzer: %s\nZimmer mieten - /rentroom(n.I.)",HausInfo[HouseID][hBesitzer]);
    }
    HausInfo[HouseID][hLabel]=Create3DTextLabel(str,COLOR_RED,HausInfo[HouseID][hPosX],HausInfo[HouseID][hPosY],HausInfo[HouseID][hPosZ],7,0);
    return 1;
    }


    auszug der log:

    HeyHoo,


    Ich hab mir gestern Abend ein Haussystem zusammengestellt, und dieses grad getestet.
    Leider musste Ich feststellen, dass das Haus nicht geladen wird.
    Hier ist alles, was zum Haussystem gehört:

    Peter PAWN Code
    #define MAX_HAEUSER 25
    enum HausDaten
    {
    hID,
    Float:hPosX,
    Float:hPosY,
    Float:hPosZ,
    hPickup,
    Text3D:hLabel,
    hBesitzer[24],
    hPreis,
    hLevel,
    hBought
    }
    new HausInfo[MAX_HAEUSER][HausDaten];

    Peter PAWN Code
    stock CreateHouse(Float:X,Float:Y,Float:Z,Level,Price)
    {
    for(new i=1;i<MAX_HAEUSER;i++)
    {
    new query[1024];
    format(query,sizeof(query),"INSERT INTO `haeuser` (`PosX`, `PosY`, `PosZ`, `Level`, `Preis`, `Besitzer`, `Bought`) VALUES ('%f', '%f', '%f', '%d', '%d', 'Niemand', '0')",X,Y,Z,Level,Price);
    mysql_query(query);
    return LoadHouse(i);
    }
    return 1;
    }

    Peter PAWN Code
    stock LoadHouse(HouseID)
    {
    new str[128];
    HausInfo[HouseID][hPosX] = GetMySQLfloat("haeuser", "PosX", "ID", HausInfo[HouseID][hID]);
    HausInfo[HouseID][hPosY] = GetMySQLfloat("haeuser", "PosY", "ID", HausInfo[HouseID][hID]);
    HausInfo[HouseID][hPosZ] = GetMySQLfloat("haeuser", "PosZ", "ID", HausInfo[HouseID][hID]);
    HausInfo[HouseID][hLevel] = GetMySQLint("haeuser", "Level", "ID", HausInfo[HouseID][hID]);
    HausInfo[HouseID][hPreis] = GetMySQLint("haeuser", "Preis", "ID", HausInfo[HouseID][hID]);
    format(HausInfo[HouseID][hBesitzer],24,"%s",GetMySQLstring("haeuser", "PosZ", "ID", HausInfo[HouseID][hID]));
    HausInfo[HouseID][hBought] = GetMySQLint("haeuser", "Bought", "ID", HausInfo[HouseID][hID]);
    HausInfo[HouseID][hPickup] = CreatePickup(1239,1,HausInfo[HouseID][hPosZ],HausInfo[HouseID][hPosY],HausInfo[HouseID][hPosZ],0);
    if(HausInfo[HouseID][hBought] == 0)
    {
    format(str,sizeof(str),"Dieses Haus ist zu verkaufen!\nLevel: %d\nPreis: %d€",HausInfo[HouseID][hLevel],HausInfo[HouseID][hPreis]);
    }
    else
    {
    format(str,sizeof(str),"Besitzer: %s\nZimmer mieten - /rentroom(n.I.)",HausInfo[HouseID][hBesitzer]);
    }
    HausInfo[HouseID][hLabel]=Create3DTextLabel(str,COLOR_RED,HausInfo[HouseID][hPosX],HausInfo[HouseID][hPosY],HausInfo[HouseID][hPosZ],7,0);
    return 1;
    }

    Peter PAWN Code
    stock LoadAllHouses()
    {
    for(new i=1;i<MAX_HAEUSER;i++)
    {
    new str[128];
    HausInfo[i][hID] = GetMySQLint("haeuser", "ID", "ID", HausInfo[i][hID]);
    HausInfo[i][hPosX] = GetMySQLfloat("haeuser", "PosX", "ID", HausInfo[i][hID]);
    HausInfo[i][hPosY] = GetMySQLfloat("haeuser", "PosY", "ID", HausInfo[i][hID]);
    HausInfo[i][hPosZ] = GetMySQLfloat("haeuser", "PosZ", "ID", HausInfo[i][hID]);
    HausInfo[i][hLevel] = GetMySQLint("haeuser", "Level", "ID", HausInfo[i][hID]);
    HausInfo[i][hPreis] = GetMySQLint("haeuser", "Preis", "ID", HausInfo[i][hID]);
    format(HausInfo[i][hBesitzer],24,"%s",GetMySQLstring("haeuser", "PosZ", "ID", HausInfo[i][hID]));
    HausInfo[i][hBought] = GetMySQLint("haeuser", "Bought", "ID", HausInfo[i][hID]);
    HausInfo[i][hPickup] = CreatePickup(1239,1,HausInfo[i][hPosZ],HausInfo[i][hPosY],HausInfo[i][hPosZ],0);
    if(HausInfo[i][hBought] == 0)
    {
    format(str,sizeof(str),"Dieses Haus ist zu verkaufen!\nLevel: %d\nPreis: %d€",HausInfo[i][hLevel],HausInfo[i][hPreis]);
    }
    else
    {
    format(str,sizeof(str),"Besitzer: %s\nZimmer mieten - /rentroom(n.I.)",HausInfo[i][hBesitzer]);
    }
    HausInfo[i][hLabel]=Create3DTextLabel(str,COLOR_RED,HausInfo[i][hPosX],HausInfo[i][hPosY],HausInfo[i][hPosZ],7,0);
    }
    return 1;
    }

    Peter PAWN Code
    stock SaveHouse(HouseID)
    {
    SetMySQLfloat("haeuser", "PosX", HausInfo[HouseID][hPosX], "ID", HausInfo[HouseID][hID]);
    SetMySQLfloat("haeuser", "PosY", HausInfo[HouseID][hPosY], "ID", HausInfo[HouseID][hID]);
    SetMySQLfloat("haeuser", "PosZ", HausInfo[HouseID][hPosZ], "ID", HausInfo[HouseID][hID]);
    SetMySQLint("haeuser", "Level", HausInfo[HouseID][hLevel], "ID", HausInfo[HouseID][hID]);
    SetMySQLint("haeuser", "Preis", HausInfo[HouseID][hPreis], "ID", HausInfo[HouseID][hID]);
    SetMySQLstring("haeuser", "Besitzer", HausInfo[HouseID][hBesitzer], "ID", HausInfo[HouseID][hID]);
    SetMySQLint("haeuser", "Bought", HausInfo[HouseID][hBought], "ID", HausInfo[HouseID][hID]);
    return 1;
    }

    Peter PAWN Code
    stock SaveAllHouse()
    {
    for(new i=1;i<MAX_HAEUSER;i++)
    {
    SetMySQLfloat("haeuser", "PosX", HausInfo[HouseID][hPosX], "ID", HausInfo[i][hID]);
    SetMySQLfloat("haeuser", "PosY", HausInfo[HouseID][hPosY], "ID", HausInfo[i][hID]);
    SetMySQLfloat("haeuser", "PosZ", HausInfo[HouseID][hPosZ], "ID", HausInfo[i][hID]);
    SetMySQLint("haeuser", "Level", HausInfo[HouseID][hLevel], "ID", HausInfo[i][hID]);
    SetMySQLint("haeuser", "Preis", HausInfo[HouseID][hPrice], "ID", HausInfo[i][hID]);
    SetMySQLstring("haeuser", "Besitzer", HausInfo[HouseID][hBesitzer], "ID", HausInfo[i][hID]);
    SetMySQLint("haeuser", "Bought", HausInfo[HouseID][hBought], "ID", HausInfo[i][hID]);
    }
    return 1;
    }

    Peter PAWN Code
    stock KillHouse(HouseID)
    {
    SaveHouse(HouseID);
    DestroyPickup(HausInfo[HouseID][hPickup]);
    Delete3DTextLabel(HausInfo[HouseID][hLabel]);
    return 1;
    }

    Peter PAWN Code
    ocmd:buyhouse(playerid,params[])
    {
    if(!isPlayerAFK(playerid))
    {
    if(SpielerInfo[playerid][pHaus] == 0)
    {
    for(new i=1;i<MAX_HAEUSER;i++)
    {
    if(IsPlayerInRangeOfPoint(playerid,3,HausInfo[i][hPosX],HausInfo[i][hPosY],HausInfo[i][hPosZ]))
    {
    if(HausInfo[i][hBought] == 1)return SCM(playerid,COLOR_LIGHTRED,"Dieses Haus ist nicht zu verkaufen!");
    if(HausInfo[i][hBought] == 0)
    {
    if(SpielerInfo[playerid][pLevel] < HausInfo[i][hLevel])return SCM(playerid,COLOR_LIGHTRED,"Dein Level reicht nicht aus, um dieses Haus zu kaufen!");
    if(SpielerInfo[playerid][pGeld] < HausInfo[i][hPreis])return SCM(playerid,COLOR_LIGHTRED,"Dein Geld reicht nicht aus, um dieses Haus zu kaufen!");
    if(strcmp(HausInfo[i][hBesitzer],"Niemand",true))
    format(HausInfo[i][hBesitzer],24,"%s",PlayerName(playerid));
    HausInfo[i][hBought] = 1;
    SpielerInfo[playerid][pGeld] -= HausInfo[i][hPreis];
    SpielerInfo[playerid][pHaus] = 1;
    SpielerInfo[playerid][pHausKey] = i;
    SavePlayer(playerid);
    KillHouse(i);
    LoadHouse(i);
    SCM(playerid,COLOR_LIGHTGREEN,"Du hast dir das Haus erfolgreich gekauft!");
    return 1;
    }
    }
    }
    }
    else
    {
    SCM(playerid,COLOR_LIGHTRED,"Du besitzt bereits ein Haus!");
    }
    }
    return 1;
    }

    Peter PAWN Code
    ocmd:createhouse(playerid,params[])
    {
    if(!isPlayerAFK(playerid))
    {
    new p,l;
    if(sscanf(params,"ii",p,l))return SCM(playerid,COLOR_GREY,"Benutze: /createhouse [Preis] [Level]");
    {
    new Float:X,Float:Y,Float:Z;
    GetPlayerPos(playerid,X,Y,Z);
    CreateHouse(X,Y,Z,l,p);
    SCM(playerid,COLOR_LIGHTGREEN,"Du hast das Haus erfolgreich erstellt!");
    }
    }
    return 1;
    }


    Ich bekomme die msg, dass ein Haus ertellt wird, ebenso, wird alles in die Datenbank eingetragen.
    Nur geladen wird es nicht...


    lg

    HeyHoo,


    ich krig den Tag mismatch ned weg:


    Warn
    C:\Users\Zinne\Desktop\samp03x_svr_R1-2_win32\gamemodes\Lifestyle Roleplay\Lifestyle.pwn(15524) : warning 213: tag mismatch
    Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase

    Warn
    1 Warning.


    Zeile
    HausInfo[HouseID][hLabel]=Create3DTextLabel(str,COLOR_RED,HausInfo[HouseID][hPosX],HausInfo[HouseID][hPosY],HausInfo[HouseID][hPosZ],7,0);


    wtf is dat shit?


    Du nutzt die Funktion des erstellens falsch.
    Richtig:
    CreateNoDMZone(Float:B_XMin,Float:B_YMin,Float:B_XMax,Float:B_YMax)
    oder auch:
    CreateNoDMZone(1687.1169,-1548.5262,1753.6289,-1725.0043);


    lg.