• 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!

TFS 1.X+ Broadcast message is not workiing

johnsamir

Advanced OT User
Joined
Oct 13, 2009
Messages
844
Solutions
6
Reaction score
150
Location
Nowhere
Hello I'm using nekiro tfs 1.3 and brodcast message is not working.My account gm is type 5 and the player has group id 3, others commands like give level works, but brodcast doesn't, the message does not appears at all in default channel nor in the game window either. i have tested with otcv8, mehah otclient, and edubart otclient in none on them is being displayed the message and i don't have errors in console when using it
this is the function
Lua:
function onSay(player, words, param)
    if not player:hasFlag(PlayerFlag_CanBroadcast) then
        return true
    end

    print("> " .. player:getName() .. " broadcasted: \"" .. param .. "\".")
    for _, targetPlayer in ipairs(Game.getPlayers()) do
        targetPlayer:sendPrivateMessage(player, param, TALKTYPE_BROADCAST)
    end
    return false
end
 
Solution
Normal (red) broadcast message:

Lua:
function onSay(player, words, param)
    if not player:getGroup():getAccess() then
        return true
    end

    if player:getAccountType() < ACCOUNT_TYPE_GOD then
        return false
    end

    print("> " .. player:getName() .. " broadcasted: \"" .. param .. "\".")
    for _, targetPlayer in ipairs(Game.getPlayers()) do
        targetPlayer:sendPrivateMessage(player, param, TALKTYPE_BROADCAST)
    end
    return false
end

White broadcast text without name showing:

Lua:
function onSay(player, words, param)
    if not player:getGroup():getAccess() then
        return true
    end

    if player:getAccountType() < ACCOUNT_TYPE_GOD then
        return false
    end

    print("> " ...
Normal (red) broadcast message:

Lua:
function onSay(player, words, param)
    if not player:getGroup():getAccess() then
        return true
    end

    if player:getAccountType() < ACCOUNT_TYPE_GOD then
        return false
    end

    print("> " .. player:getName() .. " broadcasted: \"" .. param .. "\".")
    for _, targetPlayer in ipairs(Game.getPlayers()) do
        targetPlayer:sendPrivateMessage(player, param, TALKTYPE_BROADCAST)
    end
    return false
end

White broadcast text without name showing:

Lua:
function onSay(player, words, param)
    if not player:getGroup():getAccess() then
        return true
    end

    if player:getAccountType() < ACCOUNT_TYPE_GOD then
        return false
    end

    print("> " .. player:getName() .. " broadcasted: \"" .. param .. "\".")
    for _, targetPlayer in ipairs(Game.getPlayers()) do
        targetPlayer:sendTextMessage(MESSAGE_EVENT_ADVANCE, param)
    end
    return false
end
 
Solution
Back
Top