More colors in DarkRP chat.

Hello.
I had problem with colors in DarkRP chat.
They are too few.

I just want to make “chat” prefix(something like (OOC) and (PM)) and Nickname different colors.
Also I don’t want to spend a lot of time for it.
Any ideas?

First thing’s first - chat tags are ugly. I don’t recommend them. Especially if you’re making the OOC, PM, Advert, ect. different colors. That’d just be a cluster-fuck of colors.

But to answer your question, not sure how you’d REPLACE the DarkRP chat - just look at other custom chats and take it from there.

But, there’s a string somewhere that has OOC in it. You’d have to change the color there.

/Solved

It’s very bad way but you can do this with all DarkRP chat commands.

Clientside:



local function recChat()
	
	local FClr = Color(net.ReadUInt(8), net.ReadUInt(8), net.ReadUInt(8))
	local FTXT = net.ReadString()
	local SClr = Color(net.ReadUInt(8), net.ReadUInt(8), net.ReadUInt(8))
	local STXT = net.ReadString()
	local TClr = Color(net.ReadUInt(8), net.ReadUInt(8), net.ReadUInt(8))
	local TTXT = net.ReadString()
	
	local White = Color(255, 255, 255)
	
	chat.AddText(White, "[", FClr, FTXT, White, "] ", SClr, STXT, TClr, ": " .. TTXT)
	
end
net.Receive("SendChatToPlayer", recChat)


Serverside:



util.AddNetworkString("SendChatToPlayer")

local function SendChat(Receiver, FClr, FTXT, SClr, STXT, TClr, TTXT)
	net.Start("SendChatToPlayer")
        net.WriteUInt(FClr.r, 8)
        net.WriteUInt(FClr.g, 8)
        net.WriteUInt(FClr.b, 8)
        net.WriteString(FTXT)
		net.WriteUInt(SClr.r, 8)
		net.WriteUInt(SClr.g, 8)
		net.WriteUInt(SClr.b, 8)
		net.WriteString(STXT)
		net.WriteUInt(TClr.r, 8)
		net.WriteUInt(TClr.g, 8)
		net.WriteUInt(TClr.b, 8)
		net.WriteString(TTXT)
	net.Send(Receiver)
end

local function PrivMessage(ply, args)
    local namepos = string.find(args, " ")
    if not namepos then
        DarkRP.notify(ply, 1, 4, DarkRP.getPhrase("invalid_x", "argument", ""))
        return ""
    end

    local name = string.sub(args, 1, namepos - 1)
    local msg = string.sub(args, namepos + 1)

    if msg == "" then
        DarkRP.notify(ply, 1, 4, DarkRP.getPhrase("invalid_x", "argument", ""))
        return ""
    end

    local target = DarkRP.findPlayer(name)

    if target then
        local col = team.GetColor(ply:Team())
		ply:EmitSound("buttons/weapon_confirm.wav")
        SendChat(target, Color(255, 255, 0), "Личное сообщение", col, ply:Nick(), Color(255, 190, 0), msg, ply)
		target:EmitSound("buttons/weapon_confirm.wav")
    else
        DarkRP.notify(ply, 1, 4, DarkRP.getPhrase("could_not_find", tostring(name)))
    end

    return ""
end
DarkRP.defineChatCommand("prm", PrivMessage)


The best and most faster idea which I’ve got.