[Talkaction Pedido] Guildcast.lua

buzurck
em Lixeira Pública

buzurck

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 09/05/09Posts: 16Char no Tibia: Jon Keltera

Eae galera

Eu to com uma talkaction q serve pros vice-lideres e lider falarem em broadcast para todos da guild

 

Eu tentei modifica-lo para adicionar um exhaust nesse script, mas eu n to conseguindo

Se alguem souber com adicionar o exhaust, ajeita ae pra mim plix, vou postar o script em baixo

 

Resumindo:

 

Tipo: Talkaction (apenas talkaction, n quero mods)

Nome: guildcast.lua

Adicionar: para poder usar denovo tem q esperar o Exhaust de 30 segundos

 

Script:

 

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

 

aguardo uma resposta

vlw

________

tinfer

Time changes everything that you dreamed
avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 31/10/10Posts: 33
local config = {
s = 11548, -- n mexa
exhau = 30 -- tempo em segundos
}

function onSay(cid, words, param)
if (getPlayerStorageValue(cid, config.s) <= os.time()) then 
       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
                       setPlayerStorageValue(cid,config.s,os.time()+config.exhau) 
                       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
       else
       doPlayerSendCancel(cid, "wait " .. config.exhau .. " seconds to send next message.")
       end
       doPlayerSendTextMessage(cid, 25, words) 
       return FALSE 
end



natsusign1.png

"You hate it but you know respect you’ve got to give me..."

buzurck

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 09/05/09Posts: 16Char no Tibia: Jon Keltera

vlw manu, foi mais ou menos isso q eu tentei xD

 

REP+

Só mais uma coisa:

 

A msg está aparecendo no default tambem

Eu keria q aparecesse apenas em MESSAGE_STATUS_WARNING

 

Então o que eu faço pra fazer com q a msg "!guild bla bla bla" não apareça no default, mas apareça apenas como MESSAGE_STATUS_WARNING?

 

Aguardo uma resposta, vlw

________

99611572

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 14/07/11Posts: 2

Como eu coloco esse aki com exhaustion ?

 

 

 

------ Script By MatheusMkalo for Xtibia.com Users -------

local configs = {

cobrar = "sim", ------ Use sim ou nao para cobrar.

sovip = "nao", ------ Se somente vip players poderam usar o comando

price = 1000, ------ Preço a pagar se o cobrar estiver ativado

need_item = "nao", -- se precisa de item para usar ("yes" or "no")

item = 2123

}

function onSay(cid, words, param)

local nada = {" "}

 

if table.isStrIn(param, nada) or param == "" then

doPlayerSendCancel(cid,"Voce precisa falar alguma coisa.")

return TRUE

end

 

if (configs.sovip == "sim") and getPlayerVipDays(cid) == 0 then

doPlayerSendCancel(cid,"Você não possui vip.")

return TRUE

end

 

if (configs.need_item == "sim") and getPlayerItemCount(cid,configs.item) < 1 then

doPlayerSendCancel(cid,"Você não tem o item " .. getItemNameById(configs.item) .. ".")

return TRUE

end

 

 

if configs.cobrar == "sim" and not doPlayerRemoveMoney(cid,tonumber(configs.price)) then

doPlayerSendCancel(cid,"Você não tem dinheiro suficiente.")

return TRUE

end

 

doBroadcastMessage(""..getCreatureName(cid).." ["..getPlayerLevel(cid).."]: " .. param .. "", MESSAGE_INFO_DESCR)

return TRUE

end

:XTibia_smile:

CoLoRaDo

Colorado Das Glórias, o Orgulho do Brasil
avatar
Barão
Barão

INFOS

Grupo: BarãoRegistrado: 27/04/09Posts: 242Gênero: MasculinoChar no Tibia: Askators

vlw manu, foi mais ou menos isso q eu tentei xD

 

REP+

Só mais uma coisa:

 

A msg está aparecendo no default tambem

Eu keria q aparecesse apenas em MESSAGE_STATUS_WARNING

 

Então o que eu faço pra fazer com q a msg "!guild bla bla bla" não apareça no default, mas apareça apenas como MESSAGE_STATUS_WARNING?

 

Aguardo uma resposta, vlw

 

estou com o mesmo problema está aparecendo no Default como arrumar isso?