SA-MP Forums Archive
colors problems - 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: colors problems (/showthread.php?tid=623278)



colors problems - GabiXx - 29.11.2016

I use this:
PHP код:
#define COL_WHITE "{FFFFFF}"
#define COL_RED "{F81414}"
#define COL_GREEN "{00FF22}"
#define COL_LIGHTBLUE "{00CED1}"
#define COL_GOLD "{B8860B}"
#define COL_TOM "{FF6347}"
CMD:setadmin(playerid, params[])
{
    new 
pID, value;
    if(!
IsPlayerAdmin(playerid)) return 0;
    else if(
sscanf(params, "ui", pID, value)) return SendClientMessage(playerid, COL_GOLD, "Foloseste: /setadmin [id] [level]");
    else if(
value < 0 || value > 6) return SendClientMessage(playerid, COL_GOLD, "Nivele valabile valabile: 0-6");
    else if(
pID == INVALID_PLAYER_ID) return SendClientMessage(playerid, COL_TOM, "Jucatorul nu este conectat.");
    else
    {
        new 
string[128], string1[128], target[MAX_PLAYER_NAME], pName[MAX_PLAYER_NAME];
        
GetPlayerName(playerid, pName, sizeof(pName));
        
GetPlayerName(pID, target, sizeof(target));
        
format(string, sizeof(string), "I-ai setat lui %s admin level %i", target, value);
        
SendClientMessage(playerid, COL_GOLD, string);
        
format(string, sizeof(string), "Nivelul tau de admin a fost setat la %i de %s", value, pName);
        
SendClientMessage(pID, COL_GOLD, string1);
        
PlayerInfo[pID][pAdmin] = value;
    }
    return 
1;
} 
When i add COL_GOLD or COL_TOM i get error 035: argument type mismatch (argument 2) on that lane


Re: colors problems - BiosMarcel - 29.11.2016

You defined Strings and not Colors

You should do it like that:

PHP код:
#define COLOR_GREY 0xAFAFAFAA 



Re: colors problems - GabiXx - 29.11.2016

Thanks


Re: colors problems - Micko123 - 30.11.2016

Or you can do it like this
PHP код:
#define COL_GOLD "{B8860B}" 
format(string, sizeof(string), ""COL_GOLD"Nivelul tau de admin a fost setat la %i de %s", value, pName); 
        
SendClientMessage(pID, -1, string1);