Autor: elf klik

Licencja: Rób co chcesz byle by nie zmieniać autora.

Skrypt działa na zasadzie, że lider lub vice lider guild pisze do członków swojej guild na czerwono “jak gm” lecz widza to tylko członkowie danej guild!

Teraz konkrety:

Część LUA

Wchodzimy do katalogu data/talkactions/scripts/ tworzymy plik guildcast.lua wklejmy do niego:

guildcast.lua
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

Teraz przechodzimy do data/talkactions/talkactions.xml i tak dodajemy linijkę:

<talkaction filter="word" words="/bg" script="guildcast.lua"/>

W grze lider guild urzywa to komendą /bg teskt

otspub/guild_broadcast_tfs_0.3._by_elf.txt · Last modified: 2010/04/28 15:42 by kielb
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki