Register/login System 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
  • Ich hab ein Problem und zwar ich hab das Register/Login System von Mr.Monat gemacht. Keine Errors/Warnings funktioniert aber ein Problem habe ich.
    Am Anfang geh ich auf den Server Registriere mich.Geh ich raus und wieder rein.Dort steht dann der Login Dialog aber wenn ich mein Passwort eingegeben habe dann steht dort "Erfolgrich Registriert" Und Eigentlich müsste er sich einloggen. Der Order Accounts ist auch schon da aber ich hab es schon ca 5 mal
    neu gemacht aber es kommt immer wieder das gleiche Problem ich Registiere mich die Ganze zeit :( . Ich Hoffe ihr könnt mir helfen.

  • Ich schicke dir das Script ...


    #define DIALOG_REGISTER 1
    #define RED 0xFF0000FF
    #define DIALOG_LOGIN 2
    #define BLAU 0x0073FFFF
    #define GELB 0xFFFA00FF
    #include <a_samp>
    #include <dini>


    #if defined FILTERSCRIPT


    new Eingeloggt;
    new passwort[128];//Hier laden wir das Passwort rauf beim Registrieren und beim logn versuch
    new EingegebenesPasswort[256];//beim Login laden wir hier das Passwort rauf was eingegeben wurden ist und überprüfen das mit der oberen variable
    new FalschesPasswort[MAX_PLAYERS];//Hiermit wird gezählt wie oft das Passwort falsch eingegeben wurde
    new Eingeloggt[MAX_PLAYERS];//Hier wird gespeichert ob der Spieler eingeloggt ist oder nicht (1 oder 2)


    forward Registrieren(playerid);//Hier wird der Spieler Account angelegt
    forward Anmelden(playerid);//Hier wird er geladen
    forward SpielerUpdate(playerid);//Hier wieder geschpeichert
    forward PasswortFalsch(playerid);//falls das pw falsch ist beim 3 mal gibts nen Kick
    forward ServerNaricht();

    new Adminlevel[MAX_PLAYERS_NAME];


    enum SInfo
    {
    Admin,
    Fraktion,
    Geld,
    Level
    }


    ////////////////////////////////////////////////////////////////////////////////////////////////////////
    ////////////////////////////////////////////////////////////////////////////////////////////////////////
    ////////////////////////////////////////////////////////////////////////////////////////////////////////



    ////////////////////////////////////////////////////////////////////////////////////////////////////////
    ////////////////////////////////////////////////////////////////////////////////////////////////////////
    ////////////////////////////////////////////////////////////////////////////////////////////////////////
    public OnFilterScriptInit()
    {
    print("\n--------------------------------------");
    print(" -------------SF~Roleplay--------------");
    print("--------------------------------------\n");
    return 1;
    }


    public OnFilterScriptExit()
    {
    return 1;
    }


    #else


    main()
    {
    print("\n----------------------------------");
    print(" -----------SF~Roleplay------------");
    print("----------------------------------\n");
    }


    #endif


    public OnGameModeInit()
    {
    // Don't use these lines if it's a filterscript
    SetGameModeText("SF~Roleplay");

    ///////////////////////////////////////////////////////////////////////////////////////////////
    AddPlayerClass(0,-2764.7051,375.5004,6.3421,267.1458,0,0,0,0,0,0); // Zivi Spawn San fierro
    AddPlayerClass(1,-2764.7051,375.5004,6.3421,267.1458,0,0,0,0,0,0); // Zivi Spawn San fierro
    ///////////////////////////////////////////////////////////////////////////////////////////////
    AddStaticVehicle(522,-2755.2607,366.2484,3.9650,178.1681,41,29); // Sultan 1 zivi spawn
    AddStaticVehicle(451,-2755.1204,377.9802,3.9351,179.7162,41,29); // Sultan 2 zivi spawn
    AddStaticVehicle(541,-2755.0327,386.1199,3.9350,179.7901,41,29); // Sultan 3 zivi spawn
    AddStaticVehicle(599,-2761.8730,358.2021,4.1167,270.9337,41,29); // Nicos Ranger
    ///////////////////////////////////////////Yakuzza Autos/////////////////////////////////////
    AddStaticVehicle(461,-2177.7290,654.4451,49.1424,179.3401,3,3); // Yakuza Bike 1
    AddStaticVehicle(461,-2173.9084,653.9512,49.1428,179.5435,3,3); // Yakuza bike 2
    AddStaticVehicle(445,-2174.0552,635.5527,49.1429,179.5436,3,3); // Yakuza car 1
    AddStaticVehicle(445,-2174.0054,641.8347,49.1435,179.5434,3,3); // Yakuza car 2
    AddStaticVehicle(560,-2183.9048,646.0786,49.1429,87.5826,3,3); // Yakuza car 3
    AddStaticVehicle(560,-2200.1433,645.5710,49.1464,87.6562,3,3); // Yakuza car 4
    AddStaticVehicle(409,-2206.6187,650.4713,49.1411,180.9659,3,3); // Limo sine
    ///////////////////////////////////////////////////////////////////////////////////////////////
    ////////////////////////////////////////// Server Narichten ///////////////////////////////////

    SetTimer("ServerNaricht",300000,1);




    return 1;
    }


    public OnGameModeExit()
    {
    return 1;
    }


    public OnPlayerRequestClass(playerid, classid)
    {
    return 1;
    }




    public OnPlayerConnect(playerid)
    {
    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    new name[MAX_PLAYER_NAME];


    new Spielerdatei[64];
    GetPlayerName(playerid,name,sizeof(name));
    format(Spielerdatei,sizeof(Spielerdatei),"/Accounts/%s.ini",name);
    if(dini_Exists(Spielerdatei))
    {
    ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_INPUT,"Login","Dein Account wurde gefunden.Gib bitte das Passwort ein.","Login","Abbrechen");
    }
    else
    {
    ShowPlayerDialog(playerid,DIALOG_REGISTER,DIALOG_STYLE_INPUT,"Registrieren","Gib bitte das gewünschte Passwort ein.","Register","Abbrechen");
    }

    SendClientMessage(playerid,RED,"Willkommen auf dem Sf Roleplay Server wen du Hilfe Brauchst /help.");
    /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    /////////////////////////////////////////////////////////////~~Conectet Naricht~~////////////////////////////////////////////////////////



    return 1;
    }


    public OnPlayerDisconnect(playerid, reason)
    {
    SpielerSpeichern(playerid);
    return 1;
    }


    public OnPlayerSpawn(playerid)
    {

    return 1;
    }


    public OnPlayerDeath(playerid, killerid, reason)
    {

    return 1;
    }


    public OnVehicleSpawn(vehicleid)
    {
    return 1;
    }


    public OnVehicleDeath(vehicleid, killerid)
    {
    return 1;
    }


    public OnPlayerText(playerid, text[])
    {
    return 1;
    }


    public OnPlayerCommandText(playerid, cmdtext[])
    {


    new cmd[256];




    if (strcmp("/help", cmdtext, true, 10) == 0)
    {
    SendClientMessage(playerid,BLAU,"Geh Zum Arbeitsamt und such dir ein Job du Penner");
    SendClientMessage(playerid,BLAU,"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
    SendClientMessage(playerid,BLAU,"~~~~~~~~~~~~~~~~~~Kommt Bald xD~~~~~~~~~~~~~~~~");
    SendClientMessage(playerid,BLAU,"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
    SendClientMessage(playerid,BLAU,"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");

    return 1;
    }


    if (strcmp("/geld", cmdtext, true, 10) == 0)
    {
    if(!IsPlayerAdmin(playerid)) return 0;
    GivePlayerMoney(playerid,50000000);
    }


    if(strcmp( cmd, "/vc", true ) == 0 )
    {
    if(!IsPlayerAdmin(playerid)) return 0;
    new Float:X, Float:Y, Float:Z;
    new tmp[256];
    new created_vehicle_id;



    GetPlayerPos( playerid, X, Y, Z );


    created_vehicle_id = CreateVehicle( strval(tmp), X+2, Y+2, Z, 0, 0, 0, -1 );


    new msg[256];
    format(msg,256,"Created vehicle: %d",created_vehicle_id);
    SendClientMessage(playerid,0xAAAAAAAA,msg);


    return 1;
    }



    return 0;
    }


    public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
    {
    return 1;
    }


    public OnPlayerExitVehicle(playerid, vehicleid)
    {
    return 1;
    }


    public OnPlayerStateChange(playerid, newstate, oldstate)
    {
    return 1;
    }


    public OnPlayerEnterCheckpoint(playerid)
    {
    return 1;
    }


    public OnPlayerLeaveCheckpoint(playerid)
    {
    return 1;
    }


    public OnPlayerEnterRaceCheckpoint(playerid)
    {
    return 1;
    }


    public OnPlayerLeaveRaceCheckpoint(playerid)
    {
    return 1;
    }


    public OnRconCommand(cmd[])
    {
    return 1;
    }


    public OnPlayerRequestSpawn(playerid)
    {
    return 1;
    }


    public OnObjectMoved(objectid)
    {
    return 1;
    }


    public OnPlayerObjectMoved(playerid, objectid)
    {
    return 1;
    }


    public OnPlayerPickUpPickup(playerid, pickupid)
    {
    return 1;
    }


    public OnVehicleMod(playerid, vehicleid, componentid)
    {
    return 1;
    }


    public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
    {
    return 1;
    }


    public OnVehicleRespray(playerid, vehicleid, color1, color2)
    {
    return 1;
    }


    public OnPlayerSelectedMenuRow(playerid, row)
    {
    return 1;
    }


    public OnPlayerExitedMenu(playerid)
    {
    return 1;
    }


    public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
    {
    return 1;
    }


    public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
    {
    return 1;
    }


    public OnRconLoginAttempt(ip[], password[], success)
    {
    return 1;
    }


    public OnPlayerUpdate(playerid)
    {
    return 1;
    }


    public OnPlayerStreamIn(playerid, forplayerid)
    {
    return 1;
    }


    public OnPlayerStreamOut(playerid, forplayerid)
    {
    return 1;
    }


    public OnVehicleStreamIn(vehicleid, forplayerid)
    {
    return 1;
    }


    public OnVehicleStreamOut(vehicleid, forplayerid)
    {
    return 1;
    }


    public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
    {
    if(dialogid==DIALOG_LOGIN)
    {
    if(response==0)
    {
    Kick(playerid);
    SendClientMessage(playerid,RED,"Du hast den Vorgang abgebrochen.");
    return 1;
    }
    if(response==1)
    {
    if(!strlen(inputtext))
    {
    SendClientMessage(playerid,RED,"Das Passwort nicht lang genaug.");
    ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_INPUT,"Login","Dein Account wurde gefunden.Gib bitte das Passwort ein.","Login","Abbrechen");
    return 1;
    }
    else
    {
    Login(playerid,inputtext);
    return 1;


    } }
    }


    if(dialogid==DIALOG_REGISTER)
    {
    if(response==0)
    {
    Kick(playerid);
    SendClientMessage(playerid,RED,"Du hast den Vorgang abgebrochen.");
    return 1;
    }
    if(response==1)
    {
    if(!strlen(inputtext))
    {
    SendClientMessage(playerid,RED,"Das Passwort nicht lang genaug.");
    ShowPlayerDialog(playerid,DIALOG_REGISTER,DIALOG_STYLE_INPUT,"Registrieren","Gib bitte das gewünschte Passwort ein.","Register","Abbrechen");
    return 1;
    }
    else
    {
    Register(playerid,inputtext);
    return 1;
    } }
    }



    return 1;
    }


    public OnPlayerClickPlayer(playerid, clickedplayerid, source)
    {
    return 1;
    }


    public ServerNaricht()
    {
    SendClientMessageToAll(BLAU,"Server-Naricht");
    SendClientMessageToAll(BLAU,"Wen du noch kein Job hast komm zum Arbeitsamt und such dir einen!");
    SendClientMessageToAll(BLAU,"Wen du Hilfe brauchst schreib es einfach und ein Admin komm zu dir !");
    SendClientMessageToAll(BLAU,"Ende Server-Naricht");
    return 1;
    }








    stock Register(playerid,key[])
    {
    new Spielerdatei[64];
    new name [MAX_PLAYER_NAME];
    GetPlayerName(playerid,name,sizeof(name));
    format(Spielerdatei,sizeof(Spielerdatei),"/Accounts/%s.ini",name);
    dini_Create(Spielerdatei);
    dini_Set(Spielerdatei,"Passwort",key);
    SendClientMessage(playerid,BLAU,"Erfolgreich registriert.");
    SetPlayerScore(playerid,0);
    return 1;
    }
    stock Login(playerid,key[])
    {
    new Spielerdatei[64];
    new name [MAX_PLAYER_NAME];
    GetPlayerName(playerid,name,sizeof(name));
    format(Spielerdatei,sizeof(Spielerdatei),"/Accounts/%s.ini",name);
    if(!strcmp(key,dini_Get(Spielerdatei,"Passwort"),false))
    {
    LoadAccount(playerid);
    SendClientMessage(playerid,BLAU,"Erfolgreich eingeloggt.");
    return 1;
    }
    else
    {
    SendClientMessage(playerid,BLAU,"Falsches Passwort.");
    ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_INPUT,"Login","Dein Account wurde gefunden.Gib bitte das Passwort ein.","Login","Abbrechen");
    return 1;
    }
    }
    stock LoadAccount(playerid)
    {
    new Spielerdatei[64];
    new name [MAX_PLAYER_NAME];
    GetPlayerName(playerid,name,sizeof(name));
    format(Spielerdatei,sizeof(Spielerdatei),"/Accounts/%s.ini",name);
    SetPlayerScore(playerid,dini_Int(Spielerdatei,"Level"));
    GivePlayerMoney(playerid,dini_Int(Spielerdatei,"Geld"));
    return 1;
    }
    stock SpielerSpeichern(playerid)
    {
    new Spielerdatei[64];
    new name [MAX_PLAYER_NAME];
    GetPlayerName(playerid,name,sizeof(name));
    format(Spielerdatei,sizeof(Spielerdatei),"/Accounts/%s.ini",name);
    dini_IntSet(Spielerdatei,"Level",GetPlayerScore(playerid));
    dini_IntSet(Spielerdatei,"Geld",GetPlayerMoney(playerid));
    return 1;
    }



    stock ResetVariablen(playerid)
    {
    Spielerinfo[playerid][Adminlevel]=0;
    Spielerinfo[playerid][Fraktion]=0;




    return 1:
    }



    stock Float:AngleBetweenPoints(Float:fX1, Float:fY1, Float:fX2, Float:fY2)
    {
    new Float:angle = atan2(fY1 - fY2, fX1 - fX2) * 180.0 / 3.14;
    return angle;
    }




    hier viel spass damit hatte es selber mal i wann gemacht kp warum xd