PDA

View Full Version : Showing a name on a dialog!


BleverCastard
08/05/2012, 05:20 PM
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

FalconX
08/05/2012, 05:29 PM
Ditch;1849456']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


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

BleverCastard
08/05/2012, 07:07 PM
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?!

Blunt
08/05/2012, 07:11 PM
Format the string of the text you want, then add it into the dialog.

Example
ShowPlayerDialog(playerid, DIALOG_LOGINSUCCESS, "Success", string, "Ok", "");

BleverCastard
08/05/2012, 07:13 PM
new Fstring[128];
format(Fstring, sizeof(Fstring), "You have succesfully logged in as '%s'.", GetName(playerid));
ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYL E_MSGBOX,"Done",Fstring,"Okay","");
This is it.

Ballu Miaa
08/05/2012, 07:18 PM
Recommended Change for a better code.

Replace this new Fstring[128];
with this new Fstring[60];

BleverCastard
08/05/2012, 07:25 PM
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!

FalconX
08/05/2012, 07:30 PM
Ditch;1849835']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

Joe Staff
08/05/2012, 07:32 PM
You really shouldn't show the password, there's a reason passwords are censored when they're typed in.

BleverCastard
08/05/2012, 07:35 PM
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.