Beiträge von Master147

    Guten Tag Community,


    wenn ich ein haus kaufe wird es in der Datenbank nicht eingetragen ..


    ocmd:bh(playerid,params[])
    {
    for(new i = 0; i < MAX_HAUSER; i++)
    {
    if(IsPlayerInRangeOfPoint(playerid, 3.0, Hauser[i][pEnterX], Hauser[i][pEnterY], Hauser[i][pEnterZ]))
    {
    if(Hauser[i][pCreated] == 1)
    {
    if(Hauser[i][pOwned] == 0)
    {
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid,name,24);
    format(Hauser[i][pOwner],24,"%s",name);
    new query[500];
    format(query,sizeof(query),"UPDATE `haus` SET `Besitzer` = '%s' WHERE `id` = '%d'",Hauser[i][pOwner],i);
    mysql_query(query);
    Hauser[i][pOwned] = 1;
    SaveHaus(i);
    LoadHaus(i);
    return 1;
    }
    }
    }
    }
    return 1;
    }


    aber im mysql log steht das


    `Besitzer` = 'Koray16'


    Bitte sieh erst was ich da verändert habe und was du da gemacht hast ist quatsch

    stock SpamChat(playerid)
    {
    SendClientMessage(playerid,-1,"");
    SendClientMessage(playerid,-1,"");
    SendClientMessage(playerid,-1,"");
    SendClientMessage(playerid,-1,"");
    SendClientMessage(playerid,-1,"");
    SendClientMessage(playerid,-1,"");
    SendClientMessage(playerid,-1,"");
    SendClientMessage(playerid,-1,"");
    SendClientMessage(playerid,-1,"");
    SendClientMessage(playerid,-1,"");
    SendClientMessage(playerid,-1,"");
    SendClientMessage(playerid,-1,"");
    SendClientMessage(playerid,-1,"");
    SendClientMessage(playerid,-1,"");
    SendClientMessage(playerid,-1,"");
    SendClientMessage(playerid,-1,"");
    SendClientMessage(playerid,-1,"");
    SendClientMessage(playerid,-1,"");
    }

    Graphics: Fancy
    Render Distance: Normal
    Smooth Lighting: Off
    Performance: Power saver
    3D Anaglyph: Off
    View Bobbing: Off
    GUI Scale: Normal
    Advanced OpenGL: Off
    Brightness: Moody
    Clouds: Off
    Particles: All
    Server Textures: Off
    Fullscreen: Off
    Use VSync: Off

    Guten Tag Community,


    mein Minecraft laggt sehr hard woran kann es liegen?


    habe ein:


    Intel i 5 Prozessor
    eine nvidia gefore gt 630m
    4Gb Ram 1Gb grafikspeicher


    Ich hoffe um hilfe


    MfG


    Master

    ocmd:bh(playerid,params[])
    {
    for(new i = 1; i < MAX_HAUSER; i++)
    {
    if(IsPlayerInRangeOfPoint(playerid, 3.0, Hauser[i][pEnterX], Hauser[i][pEnterY], Hauser[i][pEnterZ]))
    {
    if(Hauser[i][pCreated] == 1)
    {
    if(Hauser[i][pOwned] == 0)
    {
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid,name,24);
    strmid(Hauser[i][pOwner],SpielerInfo[playerid][pSName], 0, strlen(SpielerInfo[playerid][pSName]), MAX_PLAYER_NAME);
    return 1;
    }
    }
    }
    }
    return 1;
    }

    habe jetzt das problem :/ -.-


    new query1[500];
    strcat(query1, "INSERT INTO `haus` (`id`,`Created`,`Owned`,`EnterX`,`EnterY`,`EnterZ`,`ExitX`,`ExitY`,`ExitZ`,`Preis`,`Level`,`Int`,`Mieter`,`Miete`,`Rentable`,`lock`) ");
    new query2[500];
    format(query2,sizeof(query2),"VALUES ('%d','%d','%d','%f','%f','%f','%f','%f','%f','%d','%d','%d','%d','%d','%d','%d')", i,Hauser[i][pCreated],Hauser[i][pOwned],Hauser[i][pEnterX],Hauser[i][pEnterY],Hauser[i][pEnterZ],Hauser[i][pExitX],Hauser[i][pExitY],Hauser[i][pExitZ],Hauser[i][pPrice],Hauser[i][pLevel],Hauser[i][pInt],Hauser[i][pMieter],Hauser[i][pMiete],Hauser[i][pRentable],Hauser[i][plock]);
    new mainquery[1000];
    format(mainquery,sizeof(mainquery),"%s%s",query1,query2);
    mysql_query(mainquery);


    [13:41:30] CMySQLHandler::Query(INSERT INTO `haus` (`id`,`Created`,`Owned`,`EnterX`,`EnterY`,`EnterZ`,`ExitX`,`ExitY`,`ExitZ`,`Preis`,`Level`,`Int`,`Mieter`,`Miete`,`Rentable`,`lock`) VALUES ('1','0','0','0.000000','0.000000','0.000000','0.000000','0.000000','0.000000','0','0','0','0','0','0','0')) - An error has occured. (Error ID: 1062, Duplicate entry '1' for key 'PRIMARY')

    was bedeutet das ?


    [11:13:51] CMySQLHandler::Query(INSERT INTO `haus` (`id`,`Created`,`Owned`,`EnterX`,`EnterY`,`EnterZ`,`ExitX`,`ExitY`,`ExitZ`,`Preis`,`Level`,`Int`,`Mieter`,`Miete`,`Rentable`,`lock`) VALUES ('1','0','0','0.000000','0.000000','0.000000','0.000000','0.000000','0.000000','0','0','0','0','0','0','0')) - An error has occured. (Error ID: 1062, Duplicate entry '1' for key 'PRIMARY')

    [01:11:43] CMySQLHandler::Query(INSERT INTO `haus` (id,Created,Owner,Owned,Preis,EnterX,EnterY,EnterZ,ExitX,ExitY,ExitZ,Preis,Level,Int,Mieter,Miete,Rentable,lock) VALUES ('1','0','','0','0.000000','0.000000','0.000000','0.000000','0.000000','0.000000','0','0','0','0','0','0','0')) - An error has occured. (Error ID: 1064, You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Int,Mieter,Miete,Rentable,lock) VALUES ('1','0','','0','0.000000','0.000000','0.' at line 1)


    //edit


    Hmm.. ich kriege es nicht -.-

    Guten Tag Community,


    ich habe ein problem und zwar wenn ich ein Haus erstelle wird in der Datenbank nix eingetragen also der Preis der level usw


    ocmd:ch(playerid,params[])
    {
    for(new i = 1; i < MAX_HAUSER; i++)
    {
    if(Hauser[i][pCreated] == 1)continue;
    new query1[500];
    strcat(query1, "INSERT INTO `haus` (id,Created,Owner,Owned,Preis,EnterX,EnterY,EnterZ,ExitX,ExitY,ExitZ,Preis,Level,Int,Mieter,Miete,Rentable,lock");
    new query2[500];
    format(query2,sizeof(query2),"VALUES ('%d','%d','%s','%d','%f','%f','%f','%f','%f','%f','%d','%d','%d','%d','%d','%d','%d')", i,Hauser[i][pCreated],Hauser[i][pOwner],Hauser[i][pOwned],Hauser[i][pEnterX],Hauser[i][pEnterY],Hauser[i][pEnterZ],Hauser[i][pExitX],Hauser[i][pExitY],Hauser[i][pExitZ],Hauser[i][pPrice],Hauser[i][pLevel],Hauser[i][pInt],Hauser[i][pMieter],Hauser[i][pMiete],Hauser[i][pRentable],Hauser[i][plock]);
    new mainquery[1000];
    format(mainquery,sizeof(mainquery),"%s%s",query1,query2);
    mysql_query(mainquery);
    new Float:X,Float:Y,Float:Z;
    GetPlayerPos(playerid,X,Y,Z);
    strmid(Hauser[i][pOwner],"Niemand",0,strlen("Niemand"),24);
    Hauser[i][pOwned] = 0;
    Hauser[i][pPrice] = 1;
    Hauser[i][pEnterX] = 0;
    Hauser[i][pEnterY] = 0;
    Hauser[i][pEnterZ] = 0;
    Hauser[i][pExitX] = X;
    Hauser[i][pExitY] = Y;
    Hauser[i][pExitZ] = Z;
    Hauser[i][pLevel] = 1;
    Hauser[i][plock] = 1;
    Hauser[i][pInt] = 0;
    Hauser[i][pMieter] = 0;
    Hauser[i][pMiete] = 0;
    Hauser[i][pRentable] = 0;
    Hauser[i][pCreated] = 1;
    new string[128];
    format(string,sizeof(string),"ID: %d\nDas Haus ist zum Verkaufen\nPreis: %d\nLevel: %d",i,Hauser[i][pPrice],Hauser[i][pLevel]);
    Create3DTextLabel(string, 0x008080FF, X, Y, Z, 40.0, 0, 0);
    SaveHaus(i);
    return 1;
    }
    return 1;
    }


    stock SaveHaus(haus)
    {
    if(Hauser[haus][pCreated] == 1)
    {
    new query1[500];
    format(query1,sizeof(query1),"UPDATE `haus` SET `Created` = '%d',`Besitzer` = '%s',`Owned = '%d',`EnterX` = '%f',`EnterY` = '%f',`EnterZ` = '%f',`ExitX` = '%f',`ExitY` = '%f',`ExitZ` = '%f',",Hauser[haus][pCreated],Hauser[haus][pOwner],Hauser[haus][pOwned],Hauser[haus][pEnterX],Hauser[haus][pEnterY],Hauser[haus][pEnterZ],Hauser[haus][pExitX],Hauser[haus][pExitY],Hauser[haus][pExitZ]);
    new query2[500];
    format(query2,sizeof(query2),"`Preis` = '%d',`Level` = '%d',`Int` = '%d',`Mieter` = '%d',`Miete` = '%d',`Rentable` = '%d',`lock` = '%d', WHERE `id` = '%d'",Hauser[haus][pPrice],Hauser[haus][pLevel],Hauser[haus][pInt],Hauser[haus][pMieter],Hauser[haus][pMiete],Hauser[haus][pRentable],Hauser[haus][plock]);
    new mainquery[1000];
    format(mainquery,sizeof(mainquery),"%s%s",query1,query2);
    mysql_query(mainquery);
    printf("Es wurden %d Häuser gespeichert",haus);
    }
    return 1;
    }

    habe es jetzt so gemacht


    new query1[500];
    format(query1,sizeof(query1),"UPDATE `haus` SET `Created` = '%d',`Besitzer` = '%s',`Owned = '%d',`EnterX` = '%f',`EnterY` = '%f',`EnterZ` = '%f',`ExitX` = '%f',`ExitY` = '%f',`ExitZ` = '%f',",Hauser[haus][pCreated],]Hauser[haus][pOwner],Hauser[haus][pOwned],Hauser[haus][pEnterX],Hauser[haus][pEnterY],Hauser[haus][pEnterZ],Hauser[haus][pExitX],Hauser[haus][pExitY],Hauser[haus][pExitZ]); //<-----Kriege hier alle fehler
    new query2[500];
    format(query2,sizeof(query2),"`Preis` = '%d',`Level` = '%d',`Int` = '%d',`Mieter` = '%d',`Miete` = '%d',`Rentable` = '%d',`lock` = '%d', WHERE `id` = '%d'",Hauser[haus][pPrice],Hauser[haus][pLevel],Hauser[haus][pInt],Hauser[haus][pMieter],Hauser[haus][pMiete],Hauser[haus][pRentable],Hauser[haus][plock]);
    new mainquery[1000];
    format(mainquery,sizeof(mainquery),"%s%s",query1,query2);
    mysql_query(mainquery);


    C:\Users\Koray Bircan\Desktop\Selfmade by Koray\gamemodes\PeG.pwn(3226) : error 029: invalid expression, assumed zero
    C:\Users\Koray Bircan\Desktop\Selfmade by Koray\gamemodes\PeG.pwn(3226) : warning 215: expression has no effect
    C:\Users\Koray Bircan\Desktop\Selfmade by Koray\gamemodes\PeG.pwn(3226) : warning 215: expression has no effect
    C:\Users\Koray Bircan\Desktop\Selfmade by Koray\gamemodes\PeG.pwn(3226) : warning 215: expression has no effect
    C:\Users\Koray Bircan\Desktop\Selfmade by Koray\gamemodes\PeG.pwn(3226) : warning 215: expression has no effect
    C:\Users\Koray Bircan\Desktop\Selfmade by Koray\gamemodes\PeG.pwn(3226) : warning 215: expression has no effect
    C:\Users\Koray Bircan\Desktop\Selfmade by Koray\gamemodes\PeG.pwn(3226) : warning 215: expression has no effect
    C:\Users\Koray Bircan\Desktop\Selfmade by Koray\gamemodes\PeG.pwn(3226) : warning 215: expression has no effect
    C:\Users\Koray Bircan\Desktop\Selfmade by Koray\gamemodes\PeG.pwn(3226) : warning 215: expression has no effect
    C:\Users\Koray Bircan\Desktop\Selfmade by Koray\gamemodes\PeG.pwn(3226) : error 001: expected token: ";", but found ")"
    C:\Users\Koray Bircan\Desktop\Selfmade by Koray\gamemodes\PeG.pwn(3226) : error 029: invalid expression, assumed zero
    C:\Users\Koray Bircan\Desktop\Selfmade by Koray\gamemodes\PeG.pwn(3226) : fatal error 107: too many error messages on one line


    Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase



    4 Errors.

    Guten Tag Community,


    die Zeile beim speichern ist zu lang wie könnte ich sie in 2 Zeilen schreiben?


    format(query,sizeof(query),"UPDATE `haus` SET `Created` = '%d',`Besitzer` = '%s',`Owned = '%d',`EnterX` = '%f',`EnterY` = '%f',`EnterZ` = '%f',`ExitX` = '%f',`ExitY` = '%f',`ExitZ` = '%f',`Preis` = '%d',`Level` = '%d',`Int` = '%d',`Mieter` = '%d',`Miete` = '%d',`Rentable` = '%d',`lock` = '%d', WHERE `id` = '%d'",Hauser[haus][pOwner],haus);
    mysql_query(query);