SA-MP Forums Archive
Showing a name on a dialog! - 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: Showing a name on a dialog! (/showthread.php?tid=340795)



Showing a name on a dialog! - BleverCastard - 08.05.2012

I got this:
Код:
"Success!","You have successfully logged in as %s!","Ok","", GetName(playerid));
And I get this:
Код:
warning 202: number of arguments does not match definition



Re: Showing a name on a dialog! - FalconX - 08.05.2012

Quote:
Originally Posted by [MP]Ditch
Посмотреть сообщение
I got this:
Код:
"Success!","You have successfully logged in as %s!","Ok","", GetName(playerid));
And I get this:
Код:
warning 202: number of arguments does not match definition
pawn Код:
new Fname[MAX_PLAYER_NAME], Fstring[24+MAX_PLAYER_NAME]; // declaring new variables
GetPlayerName(playerid, Fname, sizeof(Fname));// getting the player name
format(Fstring, sizeof(Fstring), "You have succesfully logged in as %s", Fname); // formated string with the player name
ShowPlayerDialog(playerid,1,DIALOG_STYLE_MSGBOX,"Done",Fstring,"Okay",""); // change the dialogue id to your own.
Try this this will surely work.

-FalconX


Re: Showing a name on a dialog! - BleverCastard - 08.05.2012

Ok, It works, but if I type the right password, it says I logged in with then name, I press "Ok" and it show the other dialog box saying I have entered an invalid password. Help?!


Re: Showing a name on a dialog! - Blunt - 08.05.2012

Format the string of the text you want, then add it into the dialog.

Example
Код:
ShowPlayerDialog(playerid, DIALOG_LOGINSUCCESS, "Success", string, "Ok", "");



Re: Showing a name on a dialog! - BleverCastard - 08.05.2012

Код:
new Fstring[128];
					format(Fstring, sizeof(Fstring), "You have succesfully logged in as '%s'.", GetName(playerid));
					ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_MSGBOX,"Done",Fstring,"Okay","");
This is it.


Re: Showing a name on a dialog! - Ballu Miaa - 08.05.2012

Recommended Change for a better code.

Replace this
pawn Код:
new Fstring[128];
with this
pawn Код:
new Fstring[60];



Re: Showing a name on a dialog! - BleverCastard - 08.05.2012

Ok I sorted it out, but how would I get their password? because its hashed straight away, I only want their password for this(first login):
Код:
		format(Astring, sizeof(Astring), "You have successfully made an account \n\nAccount Name: %s\nPassword: %s", GetName(playerid), PlayerInfo[playerid][pPass]);
All works but doesn't show Password!


Re: Showing a name on a dialog! - FalconX - 08.05.2012

Quote:
Originally Posted by [MP]Ditch
Посмотреть сообщение
Ok I sorted it out, but how would I get their password? because its hashed straight away, I only want their password for this(first login):
Код:
		format(Astring, sizeof(Astring), "You have successfully made an account \n\nAccount Name: %s\nPassword: %s", GetName(playerid), PlayerInfo[playerid][pPass]);
All works but doesn't show Password!
inputtext?

-FalconX


Re: Showing a name on a dialog! - Joe Staff - 08.05.2012

You really shouldn't show the password, there's a reason passwords are censored when they're typed in.


Re: Showing a name on a dialog! - BleverCastard - 08.05.2012

Quote:
Originally Posted by Joe Staff
Посмотреть сообщение
You really shouldn't show the password, there's a reason passwords are censored when they're typed in.
It's only when they register, so if they did type there password wrong IE:1123 instead of 123, they can see that they made a mistake and write it down.