error 035: argument type mismatch (argument 4)
#1

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.

pawn Код:
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 © 1997-2006, ITB CompuPhase


5 Errors.
Reply
#2

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

Your ShowPlayerDialog call is totally wrong. The arguments of ShowPlayerDialog are:
pawn Код:
(playerid, dialogid, style, caption[], info[], button1[], button2[])
Let's take the first Dialog as an example:

pawn Код:
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 though. Example of using color embedding in your case:

pawn Код:
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 https://sampwiki.blast.hk/wiki/Hex_colours.
Reply
#4

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

EDIT :

Check color embedding : Color Embedding on SA-MP Wiki
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)