SA-MP Forums Archive
argument type mismatch ?? - 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: argument type mismatch ?? (/showthread.php?tid=612922)



argument type mismatch ?? - b0b - 22.07.2016

error 035: argument type mismatch (argument 2) I get this all time

All lines,.

PHP код:
COMMAND:help(playeridparams[])
{
    if(
PlayerLoggedIn[playerid] == true)
    {
        
SCM(playeridCOL_WHITE"__________________HELP__________________");
        
SCM(playeridCOL_GREEN"CMDS");
        
SCM(playeridCOL_GREEN"CMDS");
        
SCM(playeridCOL_WHITE"_______________________________________");
          return 
0;




Re: argument type mismatch ?? - AndySedeyn - 22.07.2016

COL_WHITE is by convention probably defined as an embedded color code:
PHP код:
{FFFFFF// white 
Embedded color codes can only be used in the middle of strings, hence them being embedded:
PHP код:
""COL_WHITE"This is white\n"COL_GREEN"While this is green." 
Colors as function arguments must be in their hexadecimal form:
PHP код:
0xFFFFFFFF //white 
In your case, you should define the color with its hexadecimal value:
PHP код:
#define COLOR_WHITE 0xFFFFFFFF 



Re: argument type mismatch ?? - Stinged - 22.07.2016

You have a missing bracket ( } ) above return 0;
Also, it should be return 1; or else it will show "SERVER: Unknown command."


Re: argument type mismatch ?? - b0b - 22.07.2016

Okey now i get this fixey !! But now : error 030: compound statement not closed at the end of file (started at line 671)


Re: argument type mismatch ?? - K0P - 22.07.2016

Код:
COMMAND:help(playerid, params[]) 
{ 
    if(PlayerLoggedIn[playerid] == true) 
    { 
        SCM(playerid, 0xFFFFFFFF, "__________________HELP__________________"); 
        SCM(playerid, 0x33AA33AA, "CMDS"); 
        SCM(playerid, 0x33AA33AA, "CMDS"); 
        SCM(playerid, 0xFFFFFFFF, "_______________________________________"); 
        return 0;
    } 
}



Re: argument type mismatch ?? - FuNkYTheGreat - 22.07.2016

@K0P ur command wont work because ur returning 0
Try this b0b
Код:
COMMAND:help(playerid, params[]) 
{ 
    if(PlayerLoggedIn[playerid] == true) 
    { 
        SCM(playerid, 0xFFFFFFFF, "__________________HELP__________________"); 
        SCM(playerid, 0x33AA33AA, "CMDS"); 
        SCM(playerid, 0x33AA33AA, "CMDS"); 
        SCM(playerid, 0xFFFFFFFF, "_______________________________________"); 
        return 1;
    } 
}



Re: argument type mismatch ?? - Stinged - 22.07.2016

If you return something inside an if statement, it will ask give you a warning for not returning anything outside.
You should return 1; before adding the last bracket.