Jump to content

Question

Posted

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;
        }
    }

13 answers to this question

Recommended Posts

  • 0
Posted

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

  • 0
Posted (edited)

 

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
  • 0
Posted

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
  • 0
Posted

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
  • 0
Posted

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
  • 0
Posted (edited)
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • 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.