Forum

> > CS2D > Scripts > Hc Chat Settings
Forums overviewCS2D overview Scripts overviewLog in to reply

English Hc Chat Settings

10 replies
To the start Previous 1 Next To the start

old Hc Chat Settings

Man Of Steel
User Off Offline

Quote
Hi everyone,

Guys, anybody can help me?
i want to change some Chat settings in Hc Admin Script, i hope somebody will help me

i want, if VIP or high rank than that change his chat colors so only their Message Color change and tag color always show in White and Players name color show according their team colors

Example: if Player (VIP Or High rank than that) playing in terrorist team and if he will send message so his name show in Terrorist team color and tag show in white color and if he change his chat colors so only Message Color change.

Please help

old Re: Hc Chat Settings

Man Of Steel
User Off Offline

Quote
Hey But where is code there? i want terrorist and counter terrorist own separate colors to show.

Maybe all work in this code, i changed some setting but players team colors always change together when i change my chat colour.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
function hc.chat.say_hook(p, text)
    if text == "rank" then
        return 0
    end

    local team = player(p, "team")

    if team == hc.SPEC or tonumber(game("sv_gamemode")) == hc.NORMAL and
            player(p, "health") == 0 then
    -- Spectating players and dead players in normal mode can't talk
    -- to living players.
        return 0
    end

    hc.chat.check_for_smileys(p, text)

    if hc.is_vip(p) then
        local colour_name = hc.get_player_property(p, hc.chat.COLOUR_PROP_NAME)
        local colour

        if colour_name then
            colour = hc.chat.COLOURS[colour_name]
            if colour and type(colour) == "table" then
                colour = colour[team]
            elseif not colour or colour == "nil" then
                return 0
            end
        else
            return 0
        end

        local title = colour .. player(p, "name")
        local show_tag = hc.get_player_property(p, hc.chat.TAG_PROP_NAME)

        if show_tag == nil or show_tag == hc.chat.ON then
            local tag = hc.chat.SAY_TAGS[hc.get_level(p)]
            title = title .. " ©255255255»" .. tag .. "«" .. colour

        end

        text = hc.strip_end(text, "[©@]C", 2)

        if player(p, "health") == 0 then
            msg(title .. " *DEAD*: " .. text)
        else
            msg(title .. ": " .. text)
        end
        return 1
    end
    return 0
end

old Re: Hc Chat Settings

apex2d
User Off Offline

Quote
What do you mean by this?
user Man Of Steel has written
Hey But where is code there? i want terrorist and counter terrorist own separate colors to show.

Maybe all work in this code, i changed some setting but players team colors always change together when i change my chat colour.


i might have the code that you need, send me a pm maybe i can help

old Re: Hc Chat Settings

G3tWr3ck3d
User Off Offline

Quote
Inside
1
hc/modules/chat.lua

Search for function
1
hc.chat.say_hook(p, text)

Replace the whole function with the following

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
function hc.chat.say_hook(p, text)
    if text == "rank" then
        return 0
    end

    local team = player(p, "team")

    hc.chat.check_for_smileys(p, text)

    if hc.is_vip(p) then
        local colour_name = hc.get_player_property(p, hc.chat.COLOUR_PROP_NAME)
        local colour

        if colour_name then
            colour = hc.chat.COLOURS[colour_name]
            if colour and type(colour) == "table" then
                colour = colour[team]
            elseif not colour or colour == "nil" then
				colour = hc.SPEC_YELLOW
            end
        else
            return 0
        end

		local title = hc.WHITE

        local show_tag = hc.get_player_property(p, hc.chat.TAG_PROP_NAME)
				
        if show_tag == nil or show_tag == hc.chat.ON then
            local tag = hc.chat.SAY_TAGS[hc.get_level(p)]
			
			title = title .. "»" .. tag .. "« " .. hc.user.COLOURS[team] .. player(p, "name")
		elseif show_tag == nil or show_tag == hc.chat.ON and colour == "nil" then
			title = title .. "»" .. tag .. "« " .. hc.user.COLOURS[team] .. player(p, "name")
		elseif show_tag == nil or show_tag == hc.chat.OFF then
			title = hc.user.COLOURS[team] .. player(p, "name")
        end

        text = hc.strip_end(text, "[©@]C", 2)

		if team == hc.SPEC or tonumber(game("sv_gamemode")) == hc.NORMAL and 
			player(p, "health") == 0 then
			-- Spectating players and dead players in normal mode can't talk
			-- to living players.			
			return 0
		else
			msg(title .. ": " .. colour .. text)
		end
        return 1
    end
    return 0
end

I tested, so it should work for you aswell.
edited 1×, last 22.05.19 04:58:43 pm
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview