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



error 035: argument type mismatch (argument 2) - NviDa - 20.04.2014

I wanted to make a simple command(/cmds)to show some of the commands in my server but I get error.
pawn Код:
CMD:cmds(playerid, params[])
{
    SendClientMessage(playerid,"Commands: /skin, /scar");
    return 1;
}
Error:

E:\Andrew\samp03z_svr_R1_win32\gamemodes\testserve r.pwn(142) : error 035: argument type mismatch (argument 2)


Re: error 035: argument type mismatch (argument 2) - Konstantinos - 20.04.2014

You forgot the colour as 2nd parameter.


Re: error 035: argument type mismatch (argument 2) - JeaSon - 20.04.2014

what konstantinos said you forgot the colour as 2nd parameter

fixed
pawn Код:
#define COLOR_GREY  (0xAFAFAFAA)
CMD:cmds(playerid, params[])
{
    SendClientMessage(playerid,COLOR_GREY,"Commands: /skin, /scar");
    return 1;
}



Re: error 035: argument type mismatch (argument 2) - NviDa - 20.04.2014

Great!Its done.
But I have question,how come I didn't get any error when I compiled this:
I haven't defined 0x0000FFFF like how I did #define COLOR_RED 0xAA3333AA
pawn Код:
CMD:armourme (playerid, params[])
{
 SetPlayerArmour(playerid,100);
 SendClientMessage(playerid,0x0000FFFF,"You have set your armour to 100");
 return 1;



Re: error 035: argument type mismatch (argument 2) - Bingo - 20.04.2014

Quote:
Originally Posted by NviDa
Посмотреть сообщение
Great!Its done.
But I have question,how come I didn't get any error when I compiled this:
I haven't defined 0x0000FFFF like how I did #define COLOR_RED 0xAA3333AA
pawn Код:
CMD:armourme (playerid, params[])
{
 SetPlayerArmour(playerid,100);
 SendClientMessage(playerid,0x0000FFFF,"You have set your armour to 100");
 return 1;
Hex codes can be used without defining as well.


Re: error 035: argument type mismatch (argument 2) - NviDa - 20.04.2014

Oh okay thanks!
Rep +


Re: error 035: argument type mismatch (argument 2) - RajatPawar - 20.04.2014

Quote:
Originally Posted by NviDa
Посмотреть сообщение
Great!Its done.
But I have question,how come I didn't get any error when I compiled this:
I haven't defined 0x0000FFFF like how I did #define COLOR_RED 0xAA3333AA
pawn Код:
CMD:armourme (playerid, params[])
{
 SetPlayerArmour(playerid,100);
 SendClientMessage(playerid,0x0000FFFF,"You have set your armour to 100");
 return 1;
More information on this one -

Hex codes start with '0x' and are a system of representing numbers, just like binary or decimal or the octal system. You can use hexadecimal numbers in PAWN or most languages using the prefix 0x. Defining hexadecimals is a common way for easily using colors you frequently need. This is easier to do -

pawn Код:
#define COLOR_SOME 0xFFAABB

SendClientMessage(playerid, COLOR_SOME, "Hi!");

....
Than this -

pawn Код:
SendClientMessage(playerid, ... /* Wait, what was the code again? */