SA-MP Forums Archive
Help with password system - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Help with password system (/showthread.php?tid=535017)



Help with password system - Supermaxultraswag - 01.09.2014

Sup, I made registration with this lesson https://sampforum.blast.hk/showthread.php?tid=273088 . Can you show how to make the password change system with GUI table? Or just give Example how to make it?


Re: Help with password system - K9IsGodly - 01.09.2014

Quote:
Originally Posted by Supermaxultraswag
Посмотреть сообщение
Sup, I made registration with this lesson https://sampforum.blast.hk/showthread.php?tid=273088 . Can you show how to make the password change system with GUI table? Or just give Example how to make it?
I don't fully understand what you mean, can you possibly explain a bit more what you mean by GUI table?


Re: Help with password system - SanAndreasMP - 01.09.2014

GUI Table - you mean Dialogs? If yes, you can do it like this :

pawn Код:
COMMAND:changepassword(playerid, params[])
{
      ShowPlayerDialog(playerid, dialogid, DIALOG_STYLE_INPUT, "Password Changer", "Enter your new password :","Okay","Cancel");
      return true;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
     switch(dialogid)
     {
           case dialogid:
           {
                if(strlen(inputtext) >= 64) return SendClientMessage(playerid, color, "You can't go higher than 64 letter.");
                {
                      new
                            string[50],
                            pass[50;
                      format(PlayerInfo[playerid][pPass], sizeof(pass), "%s", inputtext);
                      format(string, sizeof(string), "Password has been changed to %s", inputtext);
                      PlayerInfo[playerid][pPass] = udb_hash(inputtext);
                }
           }
      }
      return true;
}