Register Login system mit ShowPlayerDialog aber irdent wie funtzt es nicht

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
  • Hey,


    Ich hab ein Problem!
    Ich will ein Regsitersystem haben das über ShowPlayerDialog leuft, sprich ein Fenster wo man sich Einloggen ggf. Registrieren kann, aber das will nicht funktioniren!!
    Hier mal meine Cods


    new s[128];
    new loginname[MAX_PLAYER_NAME];
    GetPlayerName(playerid,loginname,MAX_PLAYER_NAME);
    format(s,sizeof(s),"Welcome back, %s!\n\nPlease login to continue!",loginname);
    ShowPlayerDialog(playerid,1,DIALOG_STYLE_INPUT,"Login to your account",s,"Login","Cancel");
    new string2[64];
    new playername2[MAX_PLAYER_NAME];
    GetPlayerName(playerid, playername2, sizeof(playername2));
    format(string2, sizeof(string2), "sAccounts/%s.linux", playername2);
    new File: UserFile = fopen(string2, io_read);
    if ( UserFile )
    {
    new PassData[256];
    new keytmp[256], valtmp[256];
    fread( UserFile , PassData , sizeof( PassData ) );
    keytmp = ini_GetKey( PassData );
    if( strcmp( keytmp , "Key" , true ) == 0 )
    {
    valtmp = ini_GetValue( PassData );
    strmid(PlayerInfo[playerid][pKey], valtmp, 0, strlen(valtmp)-1, 255);
    }
    if(strcmp(PlayerInfo[playerid][pKey],password, true ) == 0 )
    {
    new key[ 256 ] , val[ 256 ];
    new Data[ 256 ];
    while ( fread( UserFile , Data , sizeof( Data ) ) )
    {
    key = ini_GetKey( Data );
    if( strcmp( key , "Level" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pLevel] = strval( val ); }
    if( strcmp( key , "AdminLevel" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pAdmin] = strval( val ); }
    }
    fclose(UserFile);
    }
    else
    {
    SendClientMessage(playerid, COLOR_WHITE, "SERVER: Falsches Passwort - 4X Falsch = Autoban");
    fclose(UserFile);
    gPlayerLogTries[playerid] += 1;
    if(gPlayerLogTries[playerid] == 4) { Ban(playerid); }
    return 1;
    }
    if(WantedLevel[playerid] == 1) { WantedPoints[playerid] = 3; }
    else if(WantedLevel[playerid] == 2) { WantedPoints[playerid] = 5; }
    else if(WantedLevel[playerid] == 3) { WantedPoints[playerid] = 7; }
    else if(WantedLevel[playerid] == 4) { WantedPoints[playerid] = 9; }
    else if(WantedLevel[playerid] == 5) { WantedPoints[playerid] = 11; }
    else if(WantedLevel[playerid] == 6) { WantedPoints[playerid] = 13; }
    if(WantedLevel[playerid] < 6) { SetPlayerWantedLevel(playerid,WantedLevel[playerid]); }
    else { SetPlayerWantedLevel(playerid,6); }
    }
    gPlayerLogged[playerid] = 0;
    new p[128];
    new registername[MAX_PLAYER_NAME];
    GetPlayerName(playerid,registername,MAX_PLAYER_NAME);
    format(p,sizeof(p),"Welcom, %s!\n\nBitte Registriere dich doch!",registername);
    ShowPlayerDialog(playerid,1,DIALOG_STYLE_INPUT,"Registriere deinen Account",p,"Register","Cancel");
    new string3[64];
    new playername3[MAX_PLAYER_NAME];
    GetPlayerName(playerid, playername3, sizeof(playername3));
    format(string3, sizeof(string3), "sAccounts/%.linux", playername3);
    new File: hFile = fopen(string3, io_write);
    if (hFile)
    {
    strmid(PlayerInfo[playerid][pKey], password, 0, strlen(password), 255);
    new var[32];
    format(var, 32, "Key=%s\n", PlayerInfo[playerid][Key]);fwrite(hFile, var);
    format(var, 32, "Level=%d\n" , PlayerInfo[playerid][Level]);fwrite(hFile, var);
    format(var, 32, "AdminLevel=%d\n", PlayerInfo[playerid][Admin]);fwrite(hFile, var);
    fclose(hFile);
    }


    Hoffe ihr könnt mir helfen.


    Dank dir Breadfish das es dich gibt!! ^^

    Der Server: [GRG]Grand Racing Game wurde 2014 Eingestampft.
    Weitere Infos: Klick Mich

  • xD ich will halt sicheres zeug :P wolt ich schon immer xDD


    jo is bei onplayerconnect


    // wen ich runter stelle ist es zu klein definirt xD
    // kann keiner helfen oder so? ich peil langsam des ganze nichtmehr jetzt gibts sogar sachen wo ich mein ganzes script um schreiben muss -.- da währe zb das regi

    Der Server: [GRG]Grand Racing Game wurde 2014 Eingestampft.
    Weitere Infos: Klick Mich

    2 Mal editiert, zuletzt von [GRG]Linux ()

  • if(Security != 0)
    {
    SendClientMessage(playerid, COLOR_YELLOW, "Der host ist nicht Aktiv :).");
    Kick(playerid);
    return 1;
    }
    ActivePlayers[playerid]++;
    numplayers++;
    //new SelectChar[MAX_PLAYERS];
    SelectChar[playerid] = 0;
    HidePM[playerid] = 0;
    PhoneOnline[playerid] = 0;
    SelectCharID[playerid] = 0;
    SelectCharPlace[playerid] = 0;
    ChosenSkin[playerid] = 0;
    GettingJob[playerid] = 0;
    GuardOffer[playerid] = 999;
    GuardPrice[playerid] = 0;
    ApprovedLawyer[playerid] = 0;
    CallLawyer[playerid] = 0;
    WantLawyer[playerid] = 0;
    KickPlayer[playerid] = 0;
    CurrentMoney[playerid] = 0;
    UsedFind[playerid] = 0;
    UsedTazer[playerid] = 0;
    CP[playerid] = 0;
    Robbed[playerid] = 0;
    SpawnChange[playerid] = 1;
    CarOffer[playerid] = 999;
    CarPrice[playerid] = 0;
    CarID[playerid] = 0;
    CarCalls[playerid] = 0;
    RobbedTime[playerid] = 0;
    MoneyMessage[playerid] = 0;
    Condom[playerid] = 0;
    STDPlayer[playerid] = 0;
    SexOffer[playerid] = 999;
    SexPrice[playerid] = 0;
    TalkingLive[playerid] = 255;
    LiveOffer[playerid] = 999;
    TakingLesson[playerid] = 0;
    MapIconsShown[playerid] = 0;
    DrugOffer[playerid] = 999;
    PlayerCuffed[playerid] = 0;
    PlayerCuffedTime[playerid] = 0;
    DrugPrice[playerid] = 0;
    RegistrationStep[playerid] = 0;
    OnCK[playerid] = 999;
    GettingCK[playerid] = 999;
    DrugGram[playerid] = 0;
    ConnectedToPC[playerid] = 0;
    OrderReady[playerid] = 0;
    JailPrice[playerid] = 0;
    MedicTime[playerid] = 0;
    NeedMedicTime[playerid] = 0;
    MedicBill[playerid] = 0;
    GotHit[playerid] = 0;
    WantedPoints[playerid] = 0;
    GoChase[playerid] = 999;
    GetChased[playerid] = 999;
    PlacedNews[playerid] = 0;
    OnDuty[playerid] = 0;
    WantedLevel[playerid] = 0;
    TestFishes[playerid] = 0;
    BoxWaitTime[playerid] = 0;
    SchoolSpawn[playerid] = 0;
    ChangePos2[playerid][1] = 0;
    SafeTime[playerid] = 60;
    TransportDuty[playerid] = 0;
    PlayerTied[playerid] = 0;
    BusCallTime[playerid] = 0;
    TaxiCallTime[playerid] = 0;
    MedicCallTime[playerid] = 0;
    MechanicCallTime[playerid] = 0;
    ElektricCallTime[playerid] = 0;
    FindTimePoints[playerid] = 0;
    FindTime[playerid] = 0;
    JobDuty[playerid] = 0;
    Mobile[playerid] = 255;
    Music[playerid] = 0;
    BoxOffer[playerid] = 999;
    PlayerBoxing[playerid] = 0;
    Spectate[playerid] = 255;
    new randphone = 1000 + random(8999);
    PlayerInfo[playerid][pPnumber] = randphone;
    PlayerDrunk[playerid] = 0;
    PlayerDrunkTime[playerid] = 0;
    Unspec[playerid][sLocal] = 255;
    FishCount[playerid] = 0;
    WritingPaper[playerid] = 0;
    WritingPaperNumber[playerid] = 999;
    WritingLine[playerid] = 0;
    BringingPaper[playerid] = 0;
    GotPaper[playerid] = 0;
    PaperOffer[playerid] = 999;
    ConsumingMoney[playerid] = 0;
    LastCar[playerid] = 0;
    FirstSpawn[playerid] = 0;
    News[playerid] = 0;
    AllTextSee[playerid] = 0;
    Dice[playerid] = 0;
    Fam[playerid] = 0;
    Speedo[playerid] = 0;
    Gas[playerid] = 0;
    PlayerLogged[playerid] = 0;
    PlayerLogTries[playerid] = 0;
    PlayerAccount[playerid] = 0;
    PlayerSpawned[playerid] = 0;
    PlayerKarting[playerid] = 0;
    PlayerInKart[playerid] = 0;
    PlayerTazeTime[playerid] = 0;
    PlayerStoned[playerid] = 0;
    StartTime[playerid] = 0;
    TicketOffer[playerid] = 999;
    TicketMoney[playerid] = 0;
    MatsHolding[playerid] = 0;
    TutTime[playerid] = 0;
    PlayerMission[playerid] = 0;
    TaxiAccepted[playerid] = 999;
    BusAccepted[playerid] = 999;
    ElektricAccepted[playerid] = 999;
    PlayerInfo[playerid][Cash] = dollah;
    NoFuel[playerid] = 0;
    NoKey[playerid] = 0;
    HireCar[playerid] = 299;
    PlayersChannel[playerid] = 999;
    TransportValue[playerid] = 0;
    TransportMoney[playerid] = 0;
    TransportTime[playerid] = 0;
    TransportCost[playerid] = 0;
    TransportDriver[playerid] = 999;
    Locator[playerid] = 0;
    PlayerOnMission[playerid] = 0;
    MissionCheckpoint[playerid] = 0;
    WatchingTV[playerid] = 0;
    PlayerPaintballing[playerid] = 0;
    PlayerPaintballKills[playerid] = 0;
    ProposeOffer[playerid] = 999;
    MarryWitness[playerid] = 999;
    MarryWitnessOffer[playerid] = 999;
    MarriageCeremoney[playerid] = 0;
    ProposedTo[playerid] = 999;
    GotProposedBy[playerid] = 999;
    DivorceOffer[playerid] = 999;
    new s[128];
    new loginname[MAX_PLAYER_NAME];
    GetPlayerName(playerid,loginname,MAX_PLAYER_NAME);
    format(s,sizeof(s),"Welcome back, %s!\n\nPlease login to continue!",loginname);
    ShowPlayerDialog(playerid,1,DIALOG_STYLE_INPUT,"Login to your account",s,"Login","Cancel");
    new string2[64];
    new playername2[MAX_PLAYER_NAME];
    GetPlayerName(playerid, playername2, sizeof(playername2));
    format(string2, sizeof(string2), "sAccounts/%s.linux", playername2);
    new File: UserFile = fopen(string2, io_read);
    if ( UserFile )
    {
    new PassData[256];
    new keytmp[256], valtmp[256];
    fread( UserFile , PassData , sizeof( PassData ) );
    keytmp = ini_GetKey( PassData );
    if( strcmp( keytmp , "Key" , true ) == 0 )
    {
    valtmp = ini_GetValue( PassData );
    strmid(PlayerInfo[playerid][pKey], valtmp, 0, strlen(valtmp)-1, 255);
    }
    if(strcmp(PlayerInfo[playerid][pKey],password, true ) == 0 )
    {
    new key[ 256 ] , val[ 256 ];
    new Data[ 256 ];
    while ( fread( UserFile , Data , sizeof( Data ) ) )
    {
    key = ini_GetKey( Data );
    if( strcmp( key , "Level" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pLevel] = strval( val ); }
    if( strcmp( key , "AdminLevel" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pAdmin] = strval( val ); }
    }
    fclose(UserFile);
    }
    else
    {
    SendClientMessage(playerid, COLOR_WHITE, "SERVER: Falsches Passwort - 4X Falsch = Autoban");
    fclose(UserFile);
    gPlayerLogTries[playerid] += 1;
    if(gPlayerLogTries[playerid] == 4) { Ban(playerid); }
    return 1;
    }
    if(WantedLevel[playerid] == 1) { WantedPoints[playerid] = 3; }
    else if(WantedLevel[playerid] == 2) { WantedPoints[playerid] = 5; }
    else if(WantedLevel[playerid] == 3) { WantedPoints[playerid] = 7; }
    else if(WantedLevel[playerid] == 4) { WantedPoints[playerid] = 9; }
    else if(WantedLevel[playerid] == 5) { WantedPoints[playerid] = 11; }
    else if(WantedLevel[playerid] == 6) { WantedPoints[playerid] = 13; }
    if(WantedLevel[playerid] < 6) { SetPlayerWantedLevel(playerid,WantedLevel[playerid]); }
    else { SetPlayerWantedLevel(playerid,6); }
    }
    gPlayerLogged[playerid] = 0;
    new p[128];
    new registername[MAX_PLAYER_NAME];
    GetPlayerName(playerid,registername,MAX_PLAYER_NAME);
    format(p,sizeof(p),"Welcom, %s!\n\nBitte Registriere dich doch!",registername);
    ShowPlayerDialog(playerid,1,DIALOG_STYLE_INPUT,"Registriere deinen Account",p,"Register","Cancel");
    new string3[64];
    new playername3[MAX_PLAYER_NAME];
    GetPlayerName(playerid, playername3, sizeof(playername3));
    format(string3, sizeof(string3), "sAccounts/%.linux", playername3);
    new File: hFile = fopen(string3, io_write);
    if (hFile)
    {
    strmid(PlayerInfo[playerid][pKey], password, 0, strlen(password), 255);
    new var[32];
    format(var, 32, "Key=%s\n", PlayerInfo[playerid][Key]);fwrite(hFile, var);
    format(var, 32, "Level=%d\n" , PlayerInfo[playerid][Level]);fwrite(hFile, var);
    format(var, 32, "AdminLevel=%d\n", PlayerInfo[playerid][Admin]);fwrite(hFile, var);
    fclose(hFile);
    }


    ich weiß is noch nicht viel bin ja noch nicht mit mein script fertig :D hab gesagt wills weinachten raushauen ^^ da muss ich mich jetzt sputen ^^


    //kann niemand helfen?

    Der Server: [GRG]Grand Racing Game wurde 2014 Eingestampft.
    Weitere Infos: Klick Mich

    Einmal editiert, zuletzt von [GRG]Linux ()