Beiträge von Blackshadowscript

    Es wird beim Registrieren alles normal gespeichert der Score als 1. Aber sobald man sich Einloggt weil man ja schon fertig ist mit dem Registrieren bekommt man als Score 0 und nicht 1 oder anderen

    Guten Abend.


    Bei mir Buggt das mit den Level Speichern so wie das Laden aus der Datenbank:


    enum:
    enum playerInfo{
    eingeloggt,
    level,
    db_id,
    alevel,
    fraktion,
    rang,
    spawnchange
    }


    savepalyer:
    savePlayer(playerid)
    {
    if(sInfo[playerid][eingeloggt]==0)return 1;
    //speichern level,money
    GetPlayerScore(sInfo[playerid][level]);
    new query[256];
    format(query,sizeof(query),"UPDATE user SET level='%i', money='%i', alevel='%i', fraktion='%i', rang='%i' , spawnchange='%i' WHERE id='%i'",sInfo[playerid][level],GetPlayerMoney(playerid),sInfo[playerid][alevel],sInfo[playerid][fraktion],sInfo[playerid][rang],sInfo[playerid][spawnchange],sInfo[playerid][db_id]);
    mysql_function_query(dbhandle,query,false,"","");
    return 1;
    }


    Wenn passwort richtig ist:
    sInfo[playerid][eingeloggt] = 1;
    sInfo[playerid][level] = cache_get_field_content_int(1,"level",dbhandle);
    SetPlayerScore(playerid,sInfo[playerid][level]);
    sInfo[playerid][db_id] = cache_get_field_content_int(0,"id",dbhandle);
    SetPlayerMoney(playerid,cache_get_field_content_int(0,"money",dbhandle));
    sInfo[playerid][alevel] = cache_get_field_content_int(0,"alevel",dbhandle);
    sInfo[playerid][fraktion] = cache_get_field_content_int(0,"fraktion",dbhandle);
    sInfo[playerid][rang] = cache_get_field_content_int(0,"rang",dbhandle);
    sInfo[playerid][spawnchange]= cache_get_field_content_int(0,"spawnchange",dbhandle);


    resetplayer:
    resetPlayer(playerid)
    {
    for(new i=0; i<sizeof(sInfo[]); i++)
    {
    sInfo[playerid][playerInfo:i]=0;
    sInfo[playerid][level]=0;
    loadPlayerCars(playerid);
    }
    return 1;
    }


    Wenn Spieler sich ausloggt:
    public OnPlayerDisconnect(playerid, reason)
    {
    for(new i=0; i<sizeof(aInfo); i++)
    {
    if(aInfo[i][id_x]==0)continue;
    if(aInfo[i][besitzer]!=sInfo[playerid][db_id])continue;
    GetVehiclePos(aInfo[i][id_x],aInfo[i][c_x],aInfo[i][c_y],aInfo[i][c_z]);
    GetVehicleZAngle(aInfo[i][id_x],aInfo[i][c_r]);
    new query[156];
    format(query,sizeof(query),"UPDATE user SET level='%i',money='%i',alevel='%i',fraktion='%i,rang='%i' WHERE id='%i'",sInfo[playerid][level],
    GetPlayerMoney(playerid),sInfo[playerid][alevel],sInfo[playerid][fraktion],sInfo[playerid][rang],sInfo,sInfo[playerid][db_id]);
    mysql_function_query(dbhandle,query,false,"","");
    DestroyVehicle(aInfo[i][id_x]);
    aInfo[i][id_x]=0;
    break;
    }
    savePlayer(playerid);
    resetPlayer(playerid);
    loadPlayerCars(playerid);
    return 1;
    }


    Wenn passwort richtig ist:
    public OnPasswordResponse(playerid)
    {
    new num_rows,num_fields;
    cache_get_data(num_rows,num_fields,dbhandle);
    if(num_rows==1)
    {
    //passwort Richtig
    sInfo[playerid][eingeloggt] = 1;
    sInfo[playerid][level] = cache_get_field_content_int(1,"level",dbhandle);
    SetPlayerScore(playerid,sInfo[playerid][level]);
    sInfo[playerid][db_id] = cache_get_field_content_int(0,"id",dbhandle);
    SetPlayerMoney(playerid,cache_get_field_content_int(0,"money",dbhandle));
    sInfo[playerid][alevel] = cache_get_field_content_int(0,"alevel",dbhandle);
    sInfo[playerid][fraktion] = cache_get_field_content_int(0,"fraktion",dbhandle);
    sInfo[playerid][rang] = cache_get_field_content_int(0,"rang",dbhandle);
    sInfo[playerid][spawnchange]= cache_get_field_content_int(0,"spawnchange",dbhandle);
    loadPlayerCars(playerid);


    }
    else
    {
    //Passwort Falsch
    SendClientMessage(playerid,grün,"Du hast dein Passwort falsch eingetippt. Versuche es nochmal!");
    ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_PASSWORD,"Login","Gibt bitte dein Passwort ein:","Anmelden","Abbrechen");
    }
    return 1;
    }
    Register:
    if(dialogid==DIALOG_REGISTER)
    {
    if(response)
    {
    new name[MAX_PLAYER_NAME],query[128],passwort[35];
    GetPlayerName(playerid,name,sizeof(name));
    if(strlen(inputtext)>5)
    {
    //Registrierungsfunktion
    mysql_escape_string(inputtext,passwort,dbhandle);
    format(query,sizeof(query),"INSERT INTO user (username,passwort) VALUES ('%s',MD5('%s')) ",name,passwort);
    mysql_function_query(dbhandle,query,false,"","");
    sInfo[playerid][level]=1;
    SetPlayerScore(playerid,sInfo[playerid][level]);
    }
    else
    {
    //Kleiner als 4 Zeichen
    SendClientMessage(playerid,helblau,"Dein Passwort muss mindestens 6 Zeichen lang sein.");
    ShowPlayerDialog(playerid,DIALOG_REGISTER,DIALOG_STYLE_INPUT,"Account Erstellung","Gebe bitte nun dein gewünschtes Passwort ein!","Erstellen","Abbrechen");
    }
    }
    else
    {
    Kick(playerid);
    }
    }


    Spieler einloggen:
    if(dialogid==DIALOG_LOGIN)
    {
    if(response)
    {
    new name[MAX_PLAYER_NAME],query[128],passwort[35];
    GetPlayerName(playerid,name,sizeof(name));
    if(strlen(inputtext)>0)
    {
    mysql_escape_string(inputtext,passwort,dbhandle);
    format(query,sizeof(query),"SELECT * FROM user WHERE username='%s' AND passwort=MD5('%s')",name,passwort);
    mysql_function_query(dbhandle,query,true,"OnPasswordResponse","i",playerid);
    }
    else
    {
    //Keine Eingabe
    SendClientMessage(playerid,grün,"Gibt bitte dein Passwort ein.");
    ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_PASSWORD,"Login","Gibt bitte dein Passwort ein:","Anmelden","Abbrechen");
    }
    }
    else
    {
    Kick(playerid);
    }
    }



    Ich weiß nicht wo mein Fehler sein könnte. Hänge jetzt schon eine längere zeit dran aber finde einfach kein Fehler oder finde auch nichts wo ich was falsch gemacht habe sollte. Wäre dankbar wenn man mir helfen könnte da ich an das problem ultra hänge

    Die Fehler werden mir in:



    odmc:mechaniktor(playerid,params[])
    {
    MoveObject(mdtor1,1497.14282, -1778.25525, 13.70000,5,0.00000, 0.00000, 0.00000);
    SendClientMessage(playerid,grün,"Du hast das Tor1 geöffnent!");
    return 1;
    }
    odmc: md1zu(playerid,params[])
    {
    MoveObject(mdtor1, 1497.14282, -1778.25525, 21.3327,5,0.00000, 0.00000, 0.00000);
    SendClientMessage(playerid,grün,"Du hast das Tor1 geschlossen");
    return 1;
    }
    odmc: md2auf(playerid,params[])
    {
    MoveObject(mdtor2,1497.14282, -1778.25525, 13.70000,5,0.00000, 0.00000, 0.00000);
    SendClientMessage(playerid,grün,"Du hast das Tor2 geöffnent!");
    return 1;
    }
    odmc: md2zu(playerid,params[])
    {
    MoveObject(mdtor2,1497.14282, -1778.25525, 21.3327,5,0.00000, 0.00000, 0.00000);
    SendClientMessage(playerid,grün,"Du hast das Tor2 geschlossen!");
    return 1;
    }
    odmc: md3auf(playerid,params[])
    {
    MoveObject(mdtor3,1497.14282, -1769.84436, 13.70000,5,0.00000, 0.00000, 0.00000);
    SendClientMessage(playerid,grün,"Du hast das Tor3 geöffnent!");
    return 1;
    }
    odmc: md3ztu(playerid,params[])
    {
    MoveObject(mdtor3,1497.14282, -1778.25525, 21.3327,5,0.00000, 0.00000, 0.00000);
    SendClientMessage(playerid,grün,"Du hast das Tor3 geschlossen!");
    return 1;
    }
    odmc: md4auf(playerid,params[])
    {
    MoveObject(mdtor4,1497.14282, -1765.63916, 13.70000,5,0.00000, 0.00000, 0.00000);
    SendClientMessage(playerid,grün,"Du hast das Tor4 geöffnent!");
    return 1;
    }
    odmc: md4zu(playerid,params[])
    {
    MoveObject(mdtor4,1497.14282, -1778.25525, 21.3327,5,0.00000, 0.00000, 0.00000);
    SendClientMessage(playerid,grün,"Du hast das Tor4 geschlossen!");
    return 1;
    }
    odmc: md5auf(playerid,params[])
    {
    MoveObject(mdtor5,1497.14282, -1761.43286, 13.70000,5,0.00000, 0.00000, 0.00000);
    SendClientMessage(playerid,grün,"Du hast das Tor5 geöffnent!");
    return 1;
    }
    odmc: md5zu(playerid,params[])
    {
    MoveObject(mdtor5,1497.14282, -1778.25525, 21.3327,5,0.00000, 0.00000, 0.00000);
    SendClientMessage(playerid,grün,"Du hast das Tor5 geschlossen!");
    return 1;
    }
    odmc: md6auf(playerid,params[])
    {
    MoveObject(mdtor6,1497.14282, -1778.25525, 13.70000,5,0.00000, 0.00000, 0.00000);
    SendClientMessage(playerid,grün,"Du hast das Tor6 geöffnent!");
    return 1;
    }
    odmc: md6zu(playerid,params[])
    {
    MoveObject(mdtor6,1497.14282, -1778.25525, 21.3327,5,0.00000, 0.00000, 0.00000);
    SendClientMessage(playerid,grün,"Du hast das Tor6 geschlossen!");
    return 1;
    }
    odmc: md7auf(playerid,params[])
    {
    MoveObject(mdtor7,1497.14282, -1757.22693, 13.70000,5,0.00000, 0.00000, 0.00000);
    SendClientMessage(playerid,grün,"Du hast das Tor7 geöffnent!");
    return 1;
    }
    odmc: md7zu(playerid,params[])
    {
    MoveObject(mdtor7,1497.14282, -1778.25525, 121.3327,5,0.00000, 0.00000, 0.00000);
    SendClientMessage(playerid,grün,"Du hast das Tor7 geschlossen!");
    return 1;
    }
    odmc: md8auf(playerid,params[])
    {
    MoveObject(mdtor8,1497.14282, -1753.02515, 13.70000,5,0.00000, 0.00000, 0.00000);
    SendClientMessage(playerid,grün,"Du hast das Tor8 geöffnent!");
    return 1;
    }
    odmc: md8zu(playerid,params[])
    {
    MoveObject(mdtor8,1497.14282, -1778.25525, 21.3327,5,0.00000, 0.00000, 0.00000);
    SendClientMessage(playerid,grün,"Du hast das Tor8 geschlossen!");
    return 1;
    }
    odmc: md9auf(playerid,params[])
    {
    MoveObject(mdtor9,1497.14282, -1748.81909, 13.70000,5,0.00000, 0.00000, 0.00000);
    SendClientMessage(playerid,grün,"Du hast das Tor9 geöffnent!");
    return 1;
    }


    odmc: md9zu(playerid,params[])
    {
    MoveObject(mdtor9, 1497.14282, -1778.2552, 21.3327,5,0.00000, 0.00000, 0.00000);
    SendClientMessage(playerid,grün,"Du hast das Tor9 geschlossen!");
    return 1;
    }


    den ganzen befehlen gezeigt:


    //tür:
    new mdtor1;
    new mdtor2;
    new mdtor3;
    new mdtor4;
    new mdtor5;
    new mdtor6;
    new mdtor7;
    new mdtor8;
    new mdtor9


    //mechanikertüren:
    mdtor1 = CreateObject(5422, 1497.14282, -1778.25525, 21.33270, 0.00000, 0.00000, 0.00000);
    mdtor2 = CreateObject(5422, 1497.14282, -1774.05042, 21.33270, 0.00000, 0.00000, 0.00000);
    mdtor3= CreateObject(5422, 1497.14282, -1769.84436, 21.33270, 0.00000, 0.00000, 0.00000);
    mdtor4 = CreateObject(5422, 1497.14282, -1765.63916, 21.33270, 0.00000, 0.00000, 0.00000);
    mdtor5 = CreateObject(5422, 1497.14282, -1761.43286, 21.33270, 0.00000, 0.00000, 0.00000);
    mdtor6 = CreateObject(5422, 1497.14282, -1757.22693, 21.33270, 0.00000, 0.00000, 0.00000);
    mdtor7 = CreateObject(5422, 1497.14282, -1748.81909, 21.33270, 0.00000, 0.00000, 0.00000);
    mdtor8 = CreateObject(5422, 1497.14282, -1753.02515, 21.33270, 0.00000, 0.00000, 0.00000);
    mdtor9 = CreateObject(5422, 1497.14282, -1744.61206, 21.33270, 0.00000, 0.00000, 0.00000);


    Hier nun die Befehle:
    odmc:mechaniktor(playerid,params[])
    {
    MoveObject(mdtor1,1497.14282, -1778.25525, 13.70000,5,0.00000, 0.00000, 0.00000);
    SendClientMessage(playerid,grün,"Du hast das Tor1 geöffnent!");
    return 1;
    }
    odmc: md1zu(playerid,params[])
    {
    MoveObject(mdtor1, 1497.14282, -1778.25525, 21.3327,5,0.00000, 0.00000, 0.00000);
    SendClientMessage(playerid,grün,"Du hast das Tor1 geschlossen");
    return 1;
    }
    odmc: md2auf(playerid,params[])
    {
    MoveObject(mdtor2,1497.14282, -1778.25525, 13.70000,5,0.00000, 0.00000, 0.00000);
    SendClientMessage(playerid,grün,"Du hast das Tor2 geöffnent!");
    return 1;
    }
    odmc: md2zu(playerid,params[])
    {
    MoveObject(mdtor2,1497.14282, -1778.25525, 21.3327,5,0.00000, 0.00000, 0.00000);
    SendClientMessage(playerid,grün,"Du hast das Tor2 geschlossen!");
    return 1;
    }
    odmc: md3auf(playerid,params[])
    {
    MoveObject(mdtor3,1497.14282, -1769.84436, 13.70000,5,0.00000, 0.00000, 0.00000);
    SendClientMessage(playerid,grün,"Du hast das Tor3 geöffnent!");
    return 1;
    }
    odmc: md3ztu(playerid,params[])
    {
    MoveObject(mdtor3,1497.14282, -1778.25525, 21.3327,5,0.00000, 0.00000, 0.00000);
    SendClientMessage(playerid,grün,"Du hast das Tor3 geschlossen!");
    return 1;
    }
    odmc: md4auf(playerid,params[])
    {
    MoveObject(mdtor4,1497.14282, -1765.63916, 13.70000,5,0.00000, 0.00000, 0.00000);
    SendClientMessage(playerid,grün,"Du hast das Tor4 geöffnent!");
    return 1;
    }
    odmc: md4zu(playerid,params[])
    {
    MoveObject(mdtor4,1497.14282, -1778.25525, 21.3327,5,0.00000, 0.00000, 0.00000);
    SendClientMessage(playerid,grün,"Du hast das Tor4 geschlossen!");
    return 1;
    }
    odmc: md5auf(playerid,params[])
    {
    MoveObject(mdtor5,1497.14282, -1761.43286, 13.70000,5,0.00000, 0.00000, 0.00000);
    SendClientMessage(playerid,grün,"Du hast das Tor5 geöffnent!");
    return 1;
    }
    odmc: md5zu(playerid,params[])
    {
    MoveObject(mdtor5,1497.14282, -1778.25525, 21.3327,5,0.00000, 0.00000, 0.00000);
    SendClientMessage(playerid,grün,"Du hast das Tor5 geschlossen!");
    return 1;
    }
    odmc: md6auf(playerid,params[])
    {
    MoveObject(mdtor6,1497.14282, -1778.25525, 13.70000,5,0.00000, 0.00000, 0.00000);
    SendClientMessage(playerid,grün,"Du hast das Tor6 geöffnent!");
    return 1;
    }
    odmc: md6zu(playerid,params[])
    {
    MoveObject(mdtor6,1497.14282, -1778.25525, 21.3327,5,0.00000, 0.00000, 0.00000);
    SendClientMessage(playerid,grün,"Du hast das Tor6 geschlossen!");
    return 1;
    }
    odmc: md7auf(playerid,params[])
    {
    MoveObject(mdtor7,1497.14282, -1757.22693, 13.70000,5,0.00000, 0.00000, 0.00000);
    SendClientMessage(playerid,grün,"Du hast das Tor7 geöffnent!");
    return 1;
    }
    odmc: md7zu(playerid,params[])
    {
    MoveObject(mdtor7,1497.14282, -1778.25525, 121.3327,5,0.00000, 0.00000, 0.00000);
    SendClientMessage(playerid,grün,"Du hast das Tor7 geschlossen!");
    return 1;
    }
    odmc: md8auf(playerid,params[])
    {
    MoveObject(mdtor8,1497.14282, -1753.02515, 13.70000,5,0.00000, 0.00000, 0.00000);
    SendClientMessage(playerid,grün,"Du hast das Tor8 geöffnent!");
    return 1;
    }
    odmc: md8zu(playerid,params[])
    {
    MoveObject(mdtor8,1497.14282, -1778.25525, 21.3327,5,0.00000, 0.00000, 0.00000);
    SendClientMessage(playerid,grün,"Du hast das Tor8 geschlossen!");
    return 1;
    }
    odmc: md9auf(playerid,params[])
    {
    MoveObject(mdtor9,1497.14282, -1748.81909, 13.70000,5,0.00000, 0.00000, 0.00000);
    SendClientMessage(playerid,grün,"Du hast das Tor9 geöffnent!");
    return 1;
    }


    odmc: md9zu(playerid,params[])
    {
    MoveObject(mdtor9, 1497.14282, -1778.2552, 21.3327,5,0.00000, 0.00000, 0.00000);
    SendClientMessage(playerid,grün,"Du hast das Tor9 geschlossen!");
    return 1;
    }