Error "argument type mismatch (argument 2)"
#1

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.
Reply
#2

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

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

Which line is error line?
Reply
#5

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

Show me the line itself, not number of line.
Reply
#7

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

That is the line it appears on.
Reply
#8

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

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.
Reply
#10

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


Forum Jump:


Users browsing this thread: 2 Guest(s)