PDA

View Full Version : error 035: argument type mismatch (argument 4)


Cxnnor
14/08/2012, 05:08 PM
I'm new to scripting, and I am completely stuck on "error 035: argument type mismatch (argument 4)" it comes up on my Dialog Responses.

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
switch( dialogid )
{
case DIALOG_REGISTER:
{
if(!response) return Kick(playerid);
if(response)
{
if(!strlen(inputtext))return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, COLOR_WHITE, "Registering", COLOR_RED, "You have entered an incorrect password./n", COLOR_WHITE, "Type your password below to register a new account.", "Register", "Quit"); // 429
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"data");
INI_WriteInt(File,"Password",udb_hash(inputtext));
INI_WriteInt(File,"Money",0);
INI_WriteInt(File,"Admin",0);
INI_WriteInt(File,"Kills",0);
INI_WriteInt(File,"Deaths",0);
INI_Close(File);
}
}

case DIALOG_LOGIN:
{
if (!response)return Kick(playerid);
if(response)
{
if(udb_hash(inputtext) == PlayerInfo[playerid][pPass])
{
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
ShowPlayerDialog(playerid, DIALOG_SUCCESS_2, DIALOG_STYLE_MSGBOX, COLOR_WHITE, "Success!", COLOR_GREEN, "You have successfully loggged in!", "Okay", "Exit"); // 449
}
else
{
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, COLOR_WHITE, "Login", COLOR_RED, "You have entered an incorrect password./n", COLOR_WHITE, "Type your desired password below, to login.","Login","Quit"); // 453.
}
return 1;
}
}
}
return 1;
}

C:\Users\Ian\Desktop\Development\0.3E - SCRIPT #2\gamemodes\LSCNR.pwn(429) : error 035: argument type mismatch (argument 4)
C:\Users\Ian\Desktop\Development\0.3E - SCRIPT #2\gamemodes\LSCNR.pwn(449) : error 035: argument type mismatch (argument 4)
C:\Users\Ian\Desktop\Development\0.3E - SCRIPT #2\gamemodes\LSCNR.pwn(453) : error 035: argument type mismatch (argument 4)
C:\Users\Ian\Desktop\Development\0.3E - SCRIPT #2\gamemodes\LSCNR.pwn(471) : error 027: invalid character constant
C:\Users\Ian\Desktop\Development\0.3E - SCRIPT #2\gamemodes\LSCNR.pwn(471) : error 027: invalid character constant
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


5 Errors.

BigBaws
14/08/2012, 05:40 PM
Get us the lines of this Errors

C:\Users\Ian\Desktop\Development\0.3E - SCRIPT #2\gamemodes\LSCNR.pwn(429) : error 035: argument type mismatch (argument 4)
C:\Users\Ian\Desktop\Development\0.3E - SCRIPT #2\gamemodes\LSCNR.pwn(449) : error 035: argument type mismatch (argument 4)
C:\Users\Ian\Desktop\Development\0.3E - SCRIPT #2\gamemodes\LSCNR.pwn(453) : error 035: argument type mismatch (argument 4)
C:\Users\Ian\Desktop\Development\0.3E - SCRIPT #2\gamemodes\LSCNR.pwn(471) : error 027: invalid character constant
C:\Users\Ian\Desktop\Development\0.3E - SCRIPT #2\gamemodes\LSCNR.pwn(471) : error 027: invalid character constant

[KHK]Khalid
14/08/2012, 05:45 PM
Your ShowPlayerDialog call is totally wrong. The arguments of ShowPlayerDialog (http://wiki.sa-mp.com/wiki/ShowPlayerDialog) are:
(playerid, dialogid, style, caption[], info[], button1[], button2[])

Let's take the first Dialog as an example:

ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, COLOR_WHITE, "Registering", COLOR_RED, "You have entered an incorrect password./n", COLOR_WHITE, "Type your password below to register a new account.", "Register", "Quit");

There are no parameters for colors in ShowPlayerDialog, you can use color embedding (http://wiki.sa-mp.com/wiki/Color_Embedding) though. Example of using color embedding in your case:


ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, "{FFFFFF}Registering", "{FF0000}You have entered an incorrect password./n{FFFFFF}Type your password below to register a new account.", "Register", "Quit");


// FFFFFF = White
// FF0000 = Red


For more hex colors codes go to http://wiki.sa-mp.com/wiki/Hex_colours.

Eony
14/08/2012, 05:49 PM
You didn't follow the proper syntax of the functions located at lines 429, 449 and 453. Must be ShowPlayerDialog, check this :
ShowPlayerDialog on SA-MP Wiki (http://wiki.sa-mp.com/wiki/ShowPlayerDialog)

EDIT :

Check color embedding : Color Embedding on SA-MP Wiki (http://wiki.sa-mp.com/wiki/Color_Embedding)