• 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

3mR

Mapper
Joined
May 29, 2012
Messages
322
Reaction score
42
Hello ! |3mR|
First Go to
data/talkactions/scripts create file guildcast.lua and put to it:
PHP:
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, 25, words)
	return FALSE
end
Thennn

Open data/talkactions/talkactions.xml and add:
PHP:
<talkaction filter="word" words="/bg" script="guildcast.lua"/>

/bg Hello Guild sends to all guild members a message in red..

|3mR|
Rep++
 
yabny dolat 3eyal welod tet by7ebo yebdeno ana 3arf an anta wa5do copy bs 3ady foakk menhom xD
 
Back
Top