• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

[SOLVED] colored Broadcasting talkaction

Nekiro

Legendary OT User
TFS Developer
Joined
Sep 7, 2015
Messages
2,758
Solutions
127
Reaction score
2,277
Helo, does someone have working colored Broadcasting for TFS 1.2? I mean /b command for example green.
 
Alw said: /B green, hej

Code:
local color = {
    ['green'] = MESSAGE_INFO_DESCR,
    ['blue'] = MESSAGE_STATUS_CONSOLE_BLUE,
    ['orange'] = MESSAGE_STATUS_CONSOLE_ORANGE,
    ['white'] = MESSAGE_EVENT_ADVANCE,
}


function onSay(player, words, param)
    if not getPlayerFlagValue(player, PlayerFlag_CanBroadcast) then
        return true
    end
    local split = param:split(",")

    if color[split[1]] == nil then
        player:sendCancelMessage("Wrong color")
        return false
    end

    broadcastMessage(split[2], color[split[1]])

    return false
end

regards Alw
 
Back
Top