SA-MP Forums Archive
Im having a problem - 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: Im having a problem (/showthread.php?tid=598644)



Im having a problem - RuNBoY - 15.01.2016

Hello i have a warning

warning 202: number of arguments does not match definition

and the code is

Код:
public OnPlayerConnect(playerid)
{
	new pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid,pName,24);
    new Y, M, D;
    new H, G, S;
    getdate(Y, M, D);
    gettime(H, G, S);
    if(fexist(Path(playerid)))
    {
        INI_ParseFile(Path(playerid),"loadaccount_%s", .bExtra = true, .extra = playerid);
        ShowPlayerDialog(playerid,dlogin,DIALOG_STYLE_INPUT,"Login","Welcome back %s. This account is registered. \nInsert your password to login to your account","Login","Quit",pName);
    }
    else 
    {
        ShowPlayerDialog(playerid,dregister,DIALOG_STYLE_INPUT,"Register","Welcome! This account is not registered.\nEnter your own password to create a new account.","Register","Quit");
		return 1;
  	}
   	return 1;
}
I don't understan whats not working there.


Re: Im having a problem - lucamsx - 15.01.2016

Which line is it?


Re: Im having a problem - RuNBoY - 15.01.2016

ShowPlayerDialog(playerid,dlogin,DIALOG_STYLE_INPU T,"Login","Welcome back %s. This account is registered. \nInsert your password to login to your account","Login","Quit",pName);


Re: Im having a problem - lucamsx - 15.01.2016

you can't format a string inside ShowPlayerDialog.
Код:
format(string, sizeof(string), "Welcome back %s. This account is registered. Insert your password to login to your account", pName);
ShowPlayerDialog(playerid, dlogin, DIALOG_STYLE_INPUT, "Login", string, "Login", "Quit");



Re: Im having a problem - RuNBoY - 15.01.2016

but it worked before i added pName

now it shows 5 errors


Re: Im having a problem - Sew_Sumi - 15.01.2016

Quote:
Originally Posted by RuNBoY
Посмотреть сообщение
but it worked before i added pName

now it shows 5 errors
How Lucam posted, is how you should go about it.

Post up your 5 errors, as they may not be related to this issue.