Faction Color.
#1

Hello, I got a command which sets a color of a faction in the colum "Factions" the row is called "Color".

I have this faction chat.

pawn Код:
CMD:f(playerid, params[]) return cmd_faction(playerid, params);
CMD:faction(playerid, params[])
{
    new text[128];
    new color3;
    new factionid;
    Factions[factionid][fColor] = color3;
    if(sscanf(params,"s[128]",text)) return SyntaxMSG(playerid, "(/f)action [ooc chat]");
    if(PlayerInfo[playerid][pFaction] == 0) return SCM(playerid, COLOR_LIGHTRED, "Invalid faction.");
    if(Factions[PlayerInfo[playerid][pFaction]][fChatON] == 0) return SCM(playerid, COLOR_WHITE, "The OOC faction chat has been disabled by the leader.");
    if(strlen(text) > MAXLEN)
    {
        new pos = MAXLEN;
        if(pos < MAXLEN-1) pos = MAXLEN;
        format(msg, sizeof(msg), "**(( %s %s: %.*s ... ))**", GetRankName(playerid), GetNameEx(playerid), pos, text);
        if(PlayerInfo[playerid][pFaction] == LSPD)
            SendFactionMessage(PlayerInfo[playerid][pFaction], COLOR_LSPDNEW, msg);
        if(PlayerInfo[playerid][pFaction] == LSFD)
            SendFactionMessage(PlayerInfo[playerid][pFaction], FACTION_OOC, msg);
        format(msg, sizeof(msg), "**(( %s %s: ... %s ))**", GetRankName(playerid), GetNameEx(playerid), text[pos]);
        if(PlayerInfo[playerid][pFaction] == LSPD)
            SendFactionMessage(PlayerInfo[playerid][pFaction], COLOR_LSPDNEW, msg);
        if(PlayerInfo[playerid][pFaction] == LSFD)
            SendFactionMessage(PlayerInfo[playerid][pFaction], FACTION_OOC, msg);
    }
    else if(PlayerInfo[playerid][pFaction] == 3)
    {
        format(msg, sizeof(msg), "**(( %s %s: %s ))**", GetRankName(playerid), GetNameEx(playerid), text);
        SendFactionMessage(PlayerInfo[playerid][pFaction], color3, msg);
    }
    else
    {
        format(msg, sizeof(msg), "**(( %s %s: %s ))**", GetRankName(playerid), GetNameEx(playerid), text);
        if(PlayerInfo[playerid][pFaction] == LSPD)
            SendFactionMessage(PlayerInfo[playerid][pFaction], COLOR_LSPDNEW, msg);
        if(PlayerInfo[playerid][pFaction] == LSFD)
            SendFactionMessage(PlayerInfo[playerid][pFaction], FACTION_OOC, msg);
    }
    return 1;
}

Is there a way to use the color that is stored in my DB in the SendFactionMessage? And I am talking about faction number 3.
Reply


Messages In This Thread
Faction Color. - by Biess - 28.12.2014, 13:17
Re: Faction Color. - by Biess - 28.12.2014, 14:36
Re: Faction Color. - by Vince - 28.12.2014, 15:08
Re: Faction Color. - by Biess - 28.12.2014, 15:18
Re: Faction Color. - by Biess - 29.12.2014, 19:01
Re: Faction Color. - by Write - 29.12.2014, 19:06
Re: Faction Color. - by Biess - 29.12.2014, 19:09
Re: Faction Color. - by Write - 29.12.2014, 19:14
Re: Faction Color. - by Biess - 29.12.2014, 19:19
Re: Faction Color. - by Write - 29.12.2014, 19:42

Forum Jump:


Users browsing this thread: 1 Guest(s)