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

Solved TFS 1.0 "Broadcast Script"

Tovar

Brak V
Joined
Jul 26, 2008
Messages
347
Reaction score
8
I was doing some tests in the server and when I send a broadcast " /b " it sends in the server log this.

test.png


the other player online send the msg too, don't understand why.

This is the script

Code:
function onSay(cid, words, param)
    if not getPlayerFlagValue(cid, PlayerFlag_CanBroadcast) then
        return true
    end

    local player = Player(cid)
    print("> " .. player:getName() .. " broadcasted: \"" .. param .. "\".")
    for _, tmpPlayer in ipairs(Game.getPlayers()) do
        player:channelSay(tmpPlayer, TALKTYPE_BROADCAST, param, 0)
    end
    return false
end
 
looks like flags are bugged somehow

try this:
Code:
function onSay(cid, words, param)
if not Player(cid):getGroup():getAccess() then
     return false
   end

local player = Player(cid)
print("> " .. player:getName() .. " broadcasted: \"" .. param .. "\".")
for _, tmpPlayer in ipairs(Game.getPlayers()) do
player:channelSay(tmpPlayer, TALKTYPE_BROADCAST, param, 0)
end
return false
end
 
Fixed, can close it... That's happened because I have a mix between the last sources and the distribution posted by Printer. I need to update some files, I'll think on it in the future. Thanks Ninja.
 
Back
Top