Jump to content
  • 0

Problema


muresan_emanuel2001

Question

Am adaugat un sistem de login admin, care dupa ce ai bagat parola de logare, iti mai cere un cod.

Problema e urmatoare, daca dai ESC, iti inchide dialogul, si poti sa folosesti contul.

Daca bagi codul de admin gresit, primesti kick, daca dai enter si nu scrii nimic, primesti kick.

Totul functioneaza normal cu exceptia codului..

Ondialogresponse:

if(dialogid == 6969)
    {
        if(!response)//Daca playerul nu raspunde
        {
            KickEx(playerid, "Ai refuzat sa bagi codul? Ai primit kick smechere.");
        }
        else
        {
            new inputpass[64];
            format(inputpass, sizeof(inputpass), "1234");
            if(strcmp(inputtext, inputpass, true) == 0)
            {
                new numeadmin[MAX_PLAYER_NAME], stringZ[24+MAX_PLAYER_NAME];
                GetPlayerName(playerid, numeadmin, sizeof(numeadmin));
                format(stringZ, sizeof(stringZ), "[Admin] %s s-a conectat pe server.", numeadmin);
                SendClientMessageToAll(0xC4C4C4FF, stringZ);
                SendClientMessage(playerid, COLOR_WHITE, "Te-ai conectat cu succes ;)");
                SecuritateAdmin[playerid] = true;
            }
            else//Daca greseste codul primeste kick
            {
                new numeadmin[MAX_PLAYER_NAME], stringZ[24+MAX_PLAYER_NAME];
                GetPlayerName(playerid, numeadmin, sizeof(numeadmin));
                format(stringZ, sizeof(stringZ), "[KICK] %s a fost dat afara de catre gardian deoarece a gresit codul secret.", numeadmin);
                SendClientMessage(playerid, COLOR_WHITE, "Ai primit kick deoarece nu ai introdus codul corect !");
                KickEx(playerid, "Conectare esuata ca admin !");
            }
            return 1;
        }
    }

Link to comment
Share on other sites

13 answers to this question

Recommended Posts

  • 0

if(PlayerInfo[playerid][pAdmin] >= 1)
          {
            if(!SecuritateAdmin[playerid])
            {
                  ShowPlayerDialog(playerid, 6969, DIALOG_STYLE_PASSWORD, "Admin Login", "** Esti smecher? Descifreaza: asjak!@$5168", "Login", "");
            }
        }

Link to comment
Share on other sites

  • 0

 

Inlocuieste asta

if(!response)//Daca playerul nu raspunde
        {
            KickEx(playerid, "Ai refuzat sa bagi codul? Ai primit kick smechere.");
        }

Cu asa

if(!response)//Daca playerul nu raspunde
        {
            Kick(playerid);

return 1;
        }

 

 

Apoi asta

 

else//Daca greseste codul primeste kick
            {
                new numeadmin[MAX_PLAYER_NAME], stringZ[24+MAX_PLAYER_NAME];
                GetPlayerName(playerid, numeadmin, sizeof(numeadmin));
                format(stringZ, sizeof(stringZ), "[KICK] %s a fost dat afara de catre gardian deoarece a gresit codul secret.", numeadmin);
                SendClientMessage(playerid, COLOR_WHITE, "Ai primit kick deoarece nu ai introdus codul corect !");
                KickEx(playerid, "Conectare esuata ca admin !");
            }
            return 1;

Cu asta

 

 

 

 

else//Daca greseste codul primeste kick
            {
                SendClientMesaage (playerid,-1,"ai gresit codul");

ShowPlayerDialog(playerid, 6969, DIALOG_STYLE_PASSWORD, "Admin Login", "** Esti smecher? Descifreaza: asjak!@$5168", "Login", "");
            }
            return 1;
Edited by Mister

 

    __  ____      __           
   /  |/  (_)____/ /____  _____
  / /|_/ / / ___/ __/ _ \/ ___/
 / /  / / (__  ) /_/  __/ /    
/_/  /_/_/____/\__/\___/_/     
SERVICII SCRIPTING DE CALITATE
Pagina     Scripting     pawn
Link to comment
Share on other sites

  • 0

Atunci inlocuiesti asa daca vrei sa primeasca kick cand greseste codul

 

else//Daca greseste codul primeste kick             {              

Kick  (playerid );

}             return 1;

 

    __  ____      __           
   /  |/  (_)____/ /____  _____
  / /|_/ / / ___/ __/ _ \/ ___/
 / /  / / (__  ) /_/  __/ /    
/_/  /_/_/____/\__/\___/_/     
SERVICII SCRIPTING DE CALITATE
Pagina     Scripting     pawn
Link to comment
Share on other sites

  • 0

Cand apesi esc se apeleaza If (!response)

Iar tu la if ! Response ai kick

Incearca sa modifici dialogul din asta

ShowPlayerDialog(playerid, 6969, DIALOG_STYLE_PASSWORD, "Admin Login", "** Esti smecher? Descifreaza: asjak!@$5168", "Login", "");

 

In asta

 

ShowPlayerDialog(playerid, 6969, DIALOG_STYLE_PASSWORD, "Admin Login", "** Esti smecher? Descifreaza: asjak!@$5168", "Login", "back");

 

    __  ____      __           
   /  |/  (_)____/ /____  _____
  / /|_/ / / ___/ __/ _ \/ ___/
 / /  / / (__  ) /_/  __/ /    
/_/  /_/_/____/\__/\___/_/     
SERVICII SCRIPTING DE CALITATE
Pagina     Scripting     pawn
Link to comment
Share on other sites

  • 0

Singura chestie care imi vine in minte e ca ai mai definit dialogul acela. Pune la inceputul publicului ondialogresponse

Si modifica si 6969 in 9919 poate se incurca idurile intre ele

 

    __  ____      __           
   /  |/  (_)____/ /____  _____
  / /|_/ / / ___/ __/ _ \/ ___/
 / /  / / (__  ) /_/  __/ /    
/_/  /_/_/____/\__/\___/_/     
SERVICII SCRIPTING DE CALITATE
Pagina     Scripting     pawn
Link to comment
Share on other sites

  • 0

Macar ai dat compilare? Ca nu are cum sa nu iti mearga

OFF: Nu se stie niciodata nivelul de cunostinte al utilizatorului

Edited by Mister

 

    __  ____      __           
   /  |/  (_)____/ /____  _____
  / /|_/ / / ___/ __/ _ \/ ___/
 / /  / / (__  ) /_/  __/ /    
/_/  /_/_/____/\__/\___/_/     
SERVICII SCRIPTING DE CALITATE
Pagina     Scripting     pawn
Link to comment
Share on other sites

  • 0
3 minutes ago, muresan_emanuel2001 said:

Sunt..avansat spre expert, nu le am cu dialogurile, atata tot.

Logic ca am dat compile, scriptez pe gm meu, pornit de la GTA-RP :))

 

Avansat spre expert zici?! Se vede :) nici eu nu ma consider avansat spre expert :))

Avansat spre expert inseamna mai mult decat ce crezi tu, sa poti face mysql si ini fara sa te incurci la nimic sa stii c++ ca altfel nu prea ai sanse in pawno decat prin munca

Incearca sa pui dialogul sub DialogResponse si sa ii schimbi idul 

Edited by Mister

 

    __  ____      __           
   /  |/  (_)____/ /____  _____
  / /|_/ / / ___/ __/ _ \/ ___/
 / /  / / (__  ) /_/  __/ /    
/_/  /_/_/____/\__/\___/_/     
SERVICII SCRIPTING DE CALITATE
Pagina     Scripting     pawn
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.