MySQL Problem

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
  • Nabend.
    Ich hab ein kleines problem mit Strickenkids MySQL plugin.
    wenn ich server starte läuft alles ganz normal nur nach einer zeit kommt immer register obwohl ich registriert bin.
    wenn ich server neustarte funktioniert es :(


    public OnPlayerConnect(playerid)
    {
    new name[24];
    PlayerLoggin[playerid] = false;
    new query[200],escname[24];
    GetPlayerName(playerid,name,sizeof name);
    GetFromAccount(name,"Passwort",Acc[playerid][Passwort]);
    mysql_real_escape_string(name,escname);
    format(query,sizeof(query),"SELECT * FROM `Accounts` WHERE `Nickname` = '%s'",escname);
    mysql_query(query);
    mysql_store_result();
    if(mysql_num_rows() >= 1)
    {
    new data[256];
    mysql_fetch_field("ID",data);
    Acc[playerid][ID] = strval(data);
    mysql_fetch_field("Nickname",data);
    format(Acc[playerid][Nickname],24,data);
    format(Acc[playerid][Nickname],24,data);
    mysql_fetch_field("Passwort",data);
    format(Acc[playerid][Passwort],30,data);
    mysql_fetch_field("Adminlevel",data);
    Acc[playerid][Adminlevel] = strval(data);
    mysql_fetch_field("Geld",data);
    Acc[playerid][Geld] = strval(data);
    mysql_fetch_field("Score",data);
    Acc[playerid][Score] = strval(data);
    mysql_fetch_field("Warns",data);
    Acc[playerid][Warns] = strval(data);
    mysql_fetch_field("Kills",data);
    Acc[playerid][Kills] = strval(data);
    mysql_fetch_field("Deaths",data);
    Acc[playerid][Deaths] = strval(data);
    mysql_fetch_field("Banned",data);
    Acc[playerid][Banned] = strval(data);
    mysql_fetch_field("Bannedby",data);
    format(Acc[playerid][Bannedby],50,data);
    mysql_fetch_field("Banreason",data);
    format(Acc[playerid][Banreason],50,data);
    mysql_fetch_field("Tempbanned",data);
    Acc[playerid][Tempbanned] = strval(data);
    mysql_fetch_field("Tempban",data);
    Acc[playerid][Tempban] = strval(data);
    mysql_free_result();
    TextDrawShowForPlayer(playerid,Hintergrund);
    TextDrawShowForPlayer(playerid,Uhr);
    HardwareCheck(playerid);
    TempCheck(playerid);
    if(Acc[playerid][Adminlevel]>0)
    {
    TextDrawShowForPlayer(playerid,Admincmd);
    new s[50];
    GetPlayerName(playerid,name,sizeof name);
    format(s,sizeof s,"Admin %s hat den Server betreten",name);
    TextDrawSetString(Admincmd,s);
    }
    if(Acc[playerid][Banned] == 1)
    {
    new s[256];
    GetPlayerName(playerid,name,sizeof name);
    SendClientMessage(playerid,COLOR_ORANGE,"This Account is banned");
    SendClientMessage(playerid,COLOR_RED,"=====================================");
    format(s,sizeof s,"Bannedby Admin %s",Acc[playerid][Bannedby]);
    SendClientMessage(playerid,COLOR_LBLUE,s);
    format(s,sizeof s,"Banreason from Admin: %s",Acc[playerid][Banreason]);
    SendClientMessage(playerid,COLOR_LBLUE,s);
    new ip[15];
    GetPlayerIp(playerid,ip,sizeof ip);
    format(s,sizeof s,"Your Current IP: %s",ip);
    SendClientMessage(playerid,COLOR_LBLUE,s);
    SendClientMessage(playerid,COLOR_RED,"=====================================");
    SendClientMessage(playerid,COLOR_ORANGE,"If you think this Ban is unfair, write a Unban Appeal in our Fourms");
    SendClientMessage(playerid,COLOR_ORANGE,"Forum: Forum currently Offline!");
    format(s,sizeof s,"Server: %s was kicked by the Server, Reason: Account banned",name);
    SendClientMessageToAll(COLOR_ORANGE,s);
    printf("%s",s);
    Kick(playerid);
    }
    else
    ShowPlayerDialog(playerid,Dialog_Login,DIALOG_STYLE_INPUT,""ORANGE"_.·´¯`·-> "LBLUE"Welcome - Login "ORANGE"<-·´¯`·._",""ORANGE"Your Account was found.\nPlease enter your "RED"correctly Password\n"LBLUE"Info: After 3 login attempts you will be kicked","Login","Cancel");
    }
    else
    {
    ShowPlayerDialog(playerid,Dialog_Reg,DIALOG_STYLE_INPUT,""ORANGE"Welcome - Register",""ORANGE"You "RED"havent't an Account "ORANGE"on this Server\n"ORANGE"Please enter an Account Password to register.\n"LBLUE"Info: You need an Account on this Server","Register","Cancel");
    }
    return 1;
    }


    public OnPlayerDisconnect(playerid, reason)
    {
    TextDrawHideForPlayer(playerid,Uhr);
    TextDrawHideForPlayer(playerid,Hintergrund);
    TextDrawHideForPlayer(playerid,Admincmd);
    if(PlayerLoggin[playerid] == true)
    {
    PlayerLoggin[playerid] = false;
    new query[200],name[24],escname[24];
    GetPlayerName(playerid,name,sizeof name);
    mysql_real_escape_string(name,escname);
    format(query,sizeof query,"UPDATE `Accounts` SET `Adminlevel` = '%d' WHERE `Nickname` = '%s'",Acc[playerid][Adminlevel],escname); mysql_query(query);
    format(query,sizeof query,"UPDATE `Accounts` SET `Geld` = '%d' WHERE `Nickname` = '%s'",Acc[playerid][Geld],escname); mysql_query(query);
    format(query,sizeof query,"UPDATE `Accounts` SET `Score` = '%d' WHERE `Nickname` = '%s'",Acc[playerid][Score],escname); mysql_query(query);
    format(query,sizeof query,"UPDATE `Accounts` SET `Warns` = '%d' WHERE `Nickname` = '%s'",Acc[playerid][Warns],escname); mysql_query(query);
    format(query,sizeof query,"UPDATE `Accounts` SET `Kills` = '%d' WHERE `Nickname` = '%s'",Acc[playerid][Kills],escname); mysql_query(query);
    format(query,sizeof query,"UPDATE `Accounts` SET `Deaths` = '%d' WHERE `Nickname` = '%s'",Acc[playerid][Deaths],escname); mysql_query(query);
    format(query,sizeof query,"UPDATE `Accounts` SET `Banned` = '%d' WHERE `Nickname` = '%s'",Acc[playerid][Banned],escname); mysql_query(query);
    format(query,sizeof query,"UPDATE `Accounts` SET `Bannedby` = '%s' WHERE `Nickname` = '%s'",Acc[playerid][Bannedby],escname); mysql_query(query);
    format(query,sizeof query,"UPDATE `Accounts` SET `Banreason` = '%s' WHERE `Nickname` = '%s'",Acc[playerid][Banreason],escname); mysql_query(query);
    format(query,sizeof query,"UPDATE `Accounts` SET `Tempbanned` = '%d' WHERE `Nickname` = '%s'",Acc[playerid][Tempbanned],escname); mysql_query(query);
    format(query,sizeof query,"UPDATE `Accounts` SET `Tempban` = '%d' WHERE `Nickname` = '%s'",Acc[playerid][Tempban],escname); mysql_query(query);
    mysql_free_result();
    }
    return 1;
    }

    ich weiß der code is lang und man könnte ihn kürzen was ich auch machen werde aber ich weiß trotdem das problem nicht.
    hoffe es kann einer helfen


    PS: Linux Server


    EDIT: keiner eine idee ?


    EDIT2: dump pls help

    2 Mal editiert, zuletzt von RedStyle () aus folgendem Grund: EDIT2