SendClientMessage: Argument type mismatch with Color -
Deroxi - 26.05.2017
So when I try to compile my small command (Givecash) I get the error: error 035: argument type mismatch (argument 2) I know this has something to do with my Colors, but I have no idea what.
Script:
PHP код:
#define COL_RED "{F81414}"
CMD:givecash(playerid, params[])
{
new targetid, money;
if(sscanf(params,"ui",targetid, money)) return SendClientMessage(playerid, COL_RED ,"SYNTAX: /givecash <PlayerID> <Amount>");
if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COL_RED,"ERROR: That player is not connected!");
GivePlayerMoney(targetid,money);
return 1;
}
Could someone tell me what I did wrong?
Re: SendClientMessage: Argument type mismatch with Color -
rolex - 26.05.2017
don't need
{} and
""
just add "0x" before and "FF" or "AA" after color code.
as:
PHP код:
#define COL_RED 0xF81414AA
Re: SendClientMessage: Argument type mismatch with Color -
fatlirmorina - 26.05.2017
#define COL_RED 0xCC3300FF
Re: SendClientMessage: Argument type mismatch with Color -
Deroxi - 26.05.2017
Worked, thanks!
Re: SendClientMessage: Argument type mismatch with Color -
Deroxi - 26.05.2017
It worked altough this doesnt work anymore:
PHP код:
#define COL_WHITE 0xFFFFFF
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_WHITE"Login",""COL_WHITE"Type your password below to login.","Login","Quit");
Which gives me this error: error 001: expected token: "-string end-", but found "-identifier-"
Re: SendClientMessage: Argument type mismatch with Color -
Wary - 26.05.2017
don't use ""
use {color code without 0x and ff}
Re: SendClientMessage: Argument type mismatch with Color -
Deroxi - 26.05.2017
It does include return 1;
PHP код:
public OnPlayerConnect(playerid)
{
if(fexist(UserPath(playerid)))
{
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_WHITE"Login",""COL_WHITE"Type your password below to login.","Login","Quit");
}
else
{
ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,""COL_WHITE"Registering...",""COL_WHITE"Type your password below to register a new account.","Register","Quit");
}
return 1;
}
Re: SendClientMessage: Argument type mismatch with Color -
mongi - 26.05.2017
Quote:
Originally Posted by Deroxi
It worked altough this doesnt work anymore:
PHP код:
#define COL_WHITE 0xFFFFFF
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_WHITE"Login",""COL_WHITE"Type your password below to login.","Login","Quit");
Which gives me this error: error 001: expected token: "-string end-", but found "-identifier-"
|
In the Dialogs you need to use {F81414}, but in the SendClientMessage you should use 0xFFFFFF
Either define the colors for SendClientMessage or for the dialogs. You may define for both (More lines)
Re: SendClientMessage: Argument type mismatch with Color -
Wary - 26.05.2017
use -1 or {FFFFF}