Dialog
#1

Hi I've creating a dialog for %s but it's not work

Код:
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,"{D55064}Account Authentication","{ffffff}Zeno's {007CFF}Cops {FFFFFF}And {FF0000}Robbers\n\n{27FF00}Account %s.\n\n{FFFFFF}Please enter a password below:","Login", "Quit",rname);
I've just placed a %s for show player name but they given me a warring

Код:
warning 202: number of arguments does not match definition
Reply
#2

ShowPlayerDialog does not support formatting.

You need to declare an Array to store the string in, format it using format() and then pass the array to the function:

Код:
new text[150]; // The text is about 120 characters long, adding the name (24 characters max) will sum up to 144 characters, so the array must be at least that big
format(text, sizeof(text), "{ffffff}Zeno's {007CFF}Cops {FFFFFF}And {FF0000}Robbers\n\n{27FF00}Account %s.\n\n{FFFFFF}Please enter a password below:", rname); // format the text array

ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, "{D55064}Account Authentication", text, "Login", "Quit");
Reply
#3

Thank you worked!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)