SendClientMessage: Argument type mismatch with Color
#1

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(playeridparams[])
{
    new 
targetidmoney;
    if(
sscanf(params,"ui",targetidmoney)) return SendClientMessage(playeridCOL_RED ,"SYNTAX: /givecash <PlayerID> <Amount>");
    if(!
IsPlayerConnected(targetid)) return SendClientMessage(playeridCOL_RED,"ERROR: That player is not connected!");
    
GivePlayerMoney(targetid,money);
    return 
1;

Could someone tell me what I did wrong?
Reply
#2

don't need {} and ""

just add "0x" before and "FF" or "AA" after color code.

as:
PHP код:
 #define COL_RED 0xF81414AA 
Reply
#3

#define COL_RED 0xCC3300FF
Reply
#4

Worked, thanks!
Reply
#5

It worked altough this doesnt work anymore:
PHP код:
#define COL_WHITE 0xFFFFFF
ShowPlayerDialog(playeridDIALOG_LOGINDIALOG_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-"
Reply
#6

don't use ""
use {color code without 0x and ff}
Reply
#7

It does include return 1;

PHP код:
public OnPlayerConnect(playerid)
{
    if(
fexist(UserPath(playerid)))
    {
        
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra true, .extra playerid);
          
ShowPlayerDialog(playeridDIALOG_LOGINDIALOG_STYLE_INPUT,""COL_WHITE"Login",""COL_WHITE"Type your password below to login.","Login","Quit");
    }
    else
    {
         
ShowPlayerDialog(playeridDIALOG_REGISTERDIALOG_STYLE_INPUT,""COL_WHITE"Registering...",""COL_WHITE"Type your password below to register a new account.","Register","Quit");
    }
    return 
1;

Reply
#8

Quote:
Originally Posted by Deroxi
Посмотреть сообщение
It worked altough this doesnt work anymore:
PHP код:
#define COL_WHITE 0xFFFFFF
ShowPlayerDialog(playeridDIALOG_LOGINDIALOG_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)
Reply
#9

use -1 or {FFFFF}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)