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

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

You forgot the colour as 2nd parameter.
Reply
#3

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;
}
Reply
#4

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;
Reply
#5

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

Oh okay thanks!
Rep +
Reply
#7

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? */
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)