• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

[TalkAction] Guild Broadcast TFS 0.2

Stc

Hard Rocker
Joined
Aug 31, 2008
Messages
42
Reaction score
1
Location
Chile
Hello.
I modified this script to work properly in Tfs 0.2 (mystic Spirit)
this script send a message in red color to all player in the same guild.
you must be a leader or vice leder in the guild.

talkactions/talkactions.xml
Code:
<talkaction words="!bg" script="guildcast.lua"/>

talkactions/scripts/guildcast.lua
create a new script called guildcast.lua
Code:
function onSay(cid, words, param)
    local playerGuild = getPlayerGuildId(cid)
    if playerGuild > 0 then
        local playerGuildLevel = getPlayerGuildLevel(cid)
        if playerGuildLevel >= GUILDLEVEL_VICE then
            local players = getOnlinePlayers()
            local message = "[Guild " .. getPlayerGuildName(cid) .. "] " .. getCreatureName(cid) .. " [" .. getPlayerLevel(cid) .. "]:\n" .. param;
            for i,playerName in ipairs(players) do
                local player = getPlayerByName(playerName);
                if getPlayerGuildId(player) == playerGuild then
                    doPlayerSendTextMessage(player, MESSAGE_STATUS_WARNING, message);
                end
            end
            doPlayerSendCancel(cid, "Message sent to whole guild.");
        else
            doPlayerSendCancel(cid, "You have to be at least Vice-Leader to guildcast!");
        end
    else
        doPlayerSendCancel(cid, "Sorry, you're not in a guild.");
    end
    
    return TRUE
end

Now, you say !bg "text for the guild
:)

Finish :D

example of the text:
[Guild Power Abusers] Ozzy [223]:
hello this is a text example for the guild
____________________________________________

credits:
99.9% to Elf
0.1 to me

Reegards ;)
 
Back
Top