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



Error "argument type mismatch (argument 2)" - OMonger - 25.01.2015

I keep getting this error, and am unsure on how to fix it. "C:\Users\Oli\Desktop\samp scripts\gangwars\gamemodes\gangwar.pwn(204) : error 035: argument type mismatch (argument 2)", the line that the error is coming from is this:

command(helpme, playerid, params[])
{
new help[255], string[128];
if(sscanf(params, "z", help))
{
SendClientMessage(playerid, COLOR_WHITE, "SYNTAX: /helpme [message]");
}
else
{
format(string, sizeof(string), "{FE2EC8}[HELP]: {FFFFFF}%s (%d){FE2EC8}: %s", playerid, help);
SendToStaff(COLOR_PINK, string);
SendClientMessage(playerid, YELLOW, "Your question was sent to the Staff team, await a reply.");
}
return 1;
}

Thanks.


Re: Error "argument type mismatch (argument 2)" - zaibaslr2 - 25.01.2015

pawn Код:
if(sscanf(params, "s", help))



Re: Error "argument type mismatch (argument 2)" - OMonger - 25.01.2015

The problem still persists after changing it to: "if(sscanf(params, "s", help))"


Re: Error "argument type mismatch (argument 2)" - zaibaslr2 - 25.01.2015

Which line is error line?


Re: Error "argument type mismatch (argument 2)" - OMonger - 25.01.2015

The error line remains on 204. Which is the first SendClientMessage line.


Re: Error "argument type mismatch (argument 2)" - zaibaslr2 - 25.01.2015

Show me the line itself, not number of line.


Re: Error "argument type mismatch (argument 2)" - OMonger - 25.01.2015

{
SendClientMessage(playerid, COLOR_WHITE, "SYNTAX: /helpme [message]");
}

That is the line it appears on.


Re: Error "argument type mismatch (argument 2)" - zaibaslr2 - 25.01.2015

Have you defined #COLOR_WHITE?
By the way, -1 is also white, so you can use
pawn Код:
SendClientMessage(playerid,-1,"Message");



Re: Error "argument type mismatch (argument 2)" - OMonger - 25.01.2015

Quote:
Originally Posted by zaibaslr2
Посмотреть сообщение
Have you defined #COLOR_WHITE?
By the way, -1 is also white, so you can use
pawn Код:
SendClientMessage(playerid,-1,"Message");
I changed "COLOR_WHITE" to -1, thanks for the reference.


Re: Error "argument type mismatch (argument 2)" - zaibaslr2 - 25.01.2015

Quote:
Originally Posted by OMonger
Посмотреть сообщение
I changed "COLOR_WHITE" to -1, thanks for the reference.
Did it fix your problem?