SA-MP Forums Archive
hide the password - 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: hide the password (/showthread.php?tid=362142)



hide the password - $mooth - 23.07.2012

ow do i hide the password?
i know there is an dialog_style_password. But where do i put it, cuz it just dont work.

Код:
// This callback gets called when a player interacts with a dialog
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
	// Select the proper dialog to process
	switch (dialogid)
	{
		case DialogRegister: Dialog_Register(playerid, response, inputtext); // The "Register"-dialog
		case DialogLogin: Dialog_Login(playerid, response, inputtext); // The "Login"-dialog
Want it to be like
••••••••
insted of
password


Re: hide the password - Matz - 23.07.2012

Probably you're using a define for short code, check your top of script.


Re: hide the password - LaGrande - 23.07.2012

pawn Код:
ShowPlayerDialog(playerid, dialogid, DIALOG_STYLE_PASSWORD,"Login Account", "Enter your password below","Login","");
use it like under If(fexist) or according to ur script


Re: hide the password - $mooth - 23.07.2012

this is the difine i have
Quote:

#define GameModeName "My server name is here"




Re: hide the password - $mooth - 23.07.2012

this is my dialog

The GM:
Quote:

// This callback gets called when a player interacts with a dialog
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
// Select the proper dialog to process
switch (dialogid)
{
case DialogRegister: Dialog_Register(playerid, response, inputtext); // The "Register"-dialog
case DialogLogin: Dialog_Login(playerid, response, inputtext); // The "Login"-dialog

The include dialog:
Quote:

Dialog_Register(playerid, response, inputtext[])
{
new file[100], Name[MAX_PLAYER_NAME]; // Setup local variables
GetPlayerName(playerid, Name, sizeof(Name)); // Get the playername
format(file, sizeof(file), PlayerFile, Name); // Construct the complete filename for this player's account

switch (response) // Check which button was clicked
{
case 1: // Player clicked "Register"
{
// Check if the player entered a password
if(strlen(inputtext)>0)
{
// Store the password
format(APlayerData[playerid][PlayerPassword], 50, "%s", inputtext);

// Create the file and save default data to it, then reload it (so all data is put into the correct place)
PlayerFile_Create(playerid);
PlayerFile_Load(playerid);

// Send a message to the client to inform him that his account has been registered
SendClientMessage(playerid, 0xFFFFFFFF, TXT_AccountRegistered);
APlayerData[playerid][LoggedIn] = true; // The player has logged in properly
}
else
{
SendClientMessage(playerid, 0xFFFFFFFF, TXT_WrongPassword);
Kick(playerid);
}
}
case 0: // Player clicked "Cancel"
{
// Show a message that the player must be registered to play on this server
SendClientMessage(playerid, 0xFFFFFFFF, TXT_PlayerMustRegister);
// Kick the player
Kick(playerid);
}
}

return 1;
}




Re: hide the password - Rudy_ - 23.07.2012

Use Udb hash...
pawn Код:
/*Credits to Dracoblue*/
stock udb_hash(buf[]) {
    new length=strlen(buf);
    new s1 = 1;
    new s2 = 0;
    new n;
    for (n=0; n<length; n++)
    {
       s1 = (s1 + buf[n]) % 65521;
       s2 = (s2 + s1)     % 65521;
    }
    return (s2 << 16) + s1;
}



Re: hide the password - nickdodd25 - 23.07.2012

Quote:
Originally Posted by $mooth
Посмотреть сообщение
this is my dialog

The GM:



The include dialog:
I see your using the ppc script, go to onplayerconnect(playerid) and then look below it, there you should find the Login dialog and the Registration dialog. Just put DIALOG_STYLE_PASSWORD in place of DIALOG_STYLE_INPUT.


Re: hide the password - TheArcher - 23.07.2012

Quote:
Originally Posted by Rudy_
Посмотреть сообщение
Use Udb hash...
pawn Код:
/*Credits to Dracoblue*/
stock udb_hash(buf[]) {
    new length=strlen(buf);
    new s1 = 1;
    new s2 = 0;
    new n;
    for (n=0; n<length; n++)
    {
       s1 = (s1 + buf[n]) % 65521;
       s2 = (s2 + s1)     % 65521;
    }
    return (s2 << 16) + s1;
}
MD5 or Whirpool is more secure.


Re: hide the password - Pinguinn - 23.07.2012

Read this because it tells you where to put it and more