warning 202: number of arguments does not match definition
#1

I'm trying to put a string inside a dialog. can you please help me a little? thank you!

Код:
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "{00CC66}Account Login", "Type your password below to login your account \n\nName: %s(%d)", "Login", "Rename",GetName(playerid), playerid);
Reply
#2

Hello kampuman, as long as I know you need to use the format() function to format the string before pass it to the ShowPlayerDialog function, example:

new string[128];

format(string, sizeof(string), "Type your password below to login your account \n\nName: %s(%d)", GetName(playerid), playerid);

ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "{00CC66}Account Login", string, "Login", "Rename");

ps.: The error (number of arguments does not match definition) means that the ShowPlayerDialog expects 7 params and you passed 9 ....
Reply
#3

Quote:
Originally Posted by welderlourenco
Посмотреть сообщение
Hello kampuman, as long as I know you need to use the format() function to format the string before pass it to the ShowPlayerDialog function, example:

new string[128];

format(string, sizeof(string), "Type your password below to login your account \n\nName: %s(%d)", GetName(playerid), playerid);

ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "{00CC66}Account Login", string, "Login", "Rename");

ps.: The error (number of arguments does not match definition) means that the ShowPlayerDialog expects 7 params and you passed 9 ....
wow thanks mate! yes its working good. but I'm having problem after adding GetIp(playerid), the ip is not showing from the dialog

Код:
	new string[128];
	format(string, sizeof(string), "Type your password below to login your account \n\nName: %s (%d) \nIP: %s", GetName(playerid), playerid), GetIp(playerid);
	ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "{00CC66}Account Login", string, "Login", "Rename");
    return 1;
Reply
#4

Hello again, use the GetPlayerIp(playerid, name[], len) https://sampwiki.blast.hk/wiki/GetPlayerIp to get the ip address from a player. The second parameter is the variable name where to store the player ip, passed by reference.

new ip[15], string[128];

GetPlayerIp(playerid, ip, sizeof(ip));

format(string, sizeof(string), "Type your password below to login your account \n\nName: %s (%d) \nIP: %s", GetName(playerid), playerid, ip);

ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "{00CC66}Account Login", string, "Login", "Rename");
Reply
#5

Quote:
Originally Posted by welderlourenco
Посмотреть сообщение
Hello again, use the GetPlayerIp(playerid, name[], len) https://sampwiki.blast.hk/wiki/GetPlayerIp to get the ip address from a player. The second parameter is the variable name where to store the player ip, passed by reference.

new ip[15], string[128];

GetPlayerIp(playerid, ip, sizeof(ip));

format(string, sizeof(string), "Type your password below to login your account \n\nName: %s (%d) \nIP: %s", GetName(playerid), playerid, ip);

ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "{00CC66}Account Login", string, "Login", "Rename");
YES! Good job mate! It's all working nice. Hope you can still help me next time I gave you +rep but I think it wont show up until I get 25+ posts lol.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)