Showing a name on a dialog!
#1

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
Reply
#2

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
Reply
#3

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?!
Reply
#4

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

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

Код:
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.
Reply
#6

Recommended Change for a better code.

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

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!
Reply
#8

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
Reply
#9

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

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.
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)