Quantcast
Channel: SA-MP Forums
Viewing all articles
Browse latest Browse all 18226

Dynamic colors, using hex code

$
0
0
So I'm setting up a chat col system for my faction system. I'm not really sure how to configure it.

When a faction message is sent, I have:
Code:

SendClientMessage(i, fInfo[Player[playerid][pFaction]][fChatColor], string);
Currently, a test faction's is
Code:

fChatColor=8D8DFF
but when I use the chat in game, it shows up in black.

How can I make a working command to set like a hex code-color?

I tried this but it didn't work. Not sure how to set it up, tbh.
PHP Code:

CMD:setfcolor(playeridparams[]) // Temporary command.
{
    new 
factioncolor;
    if(!
Player[playerid][pFaction])
        return 
SendClientMessage(playeridADM"ERROR:{FFFFFF} You're not in a faction.");

    if(
Player[playerid][pFacRank] < fInfo[Player[playerid][pFaction]][fEditPerms])
        return 
SendClientMessage(playeridADM"ERROR:{FFFFFF} You don't have access to this command.");
        
     if(
sscanf(params"ds"factioncolor))
        return 
SendClientMessage(playeridADM"FACTION USAGE:{FFFFFF} /setfcolor [ faction id ] [ hex code ]");
        
    
//format(color, "s[30]", fInfo[faction][fChatColor]);
    
fInfo[faction][fChatColor] = color;
    
SaveFaction(faction);
    
    
SendClientMessage(playeridADM"Done.");
    return 
1;



Viewing all articles
Browse latest Browse all 18226

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>