How do i fix so when somone b casts /bg the other players can't see it, only players from guild.
Now when i do /bg the other players near me can see what i write to my guild since it appers on default.
Thanks
Now when i do /bg the other players near me can see what i write to my guild since it appers on default.
HTML:
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* " .. 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
doPlayerSendTextMessage(cid, 19, words)
return FALSE
end
HTML:
<talkaction words="/bg" event="script" value="guildcast.lua"/>
Thanks