Ir para conteúdo

Featured Replies

Resolvido por Linus

Ir para solução
  • Respostas 35
  • Visualizações 6.8k
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • function onSay(cid, words, param) local player = Player(cid) local m = string.explode(param, ",") local target = Player(m[1]) local time = tonumber(m[2]) if player:getAccountType() < ACCOUNT

  • Em data/talkactions crie um arquivo com nome Muteplayer.lua e cole isso dentro :   Adicione essa tag em talkactions.xml : Em data/creatureevents crie um arquivo com nome Mute_check e cole isso de

  • mute.lua : function onSay(cid, words, param) local CHANNEL_HELP = 7 local player = Player(cid) local storage = 456112 if words == "/mute" then local mute = param:split(",") if mute[1] ==

Postado
function onSay(cid, words, param)

	local player = Player(cid)
	local m = string.explode(param, ",")
	local target = Player(m[1])
	local time = tonumber(m[2])

	if player:getAccountType() < ACCOUNT_TYPE_TUTOR  then
		return false
	end

	if time == nil then
		player:sendCancelMessage("Invalid param specified.")
		return false
	end

	if target == nil then
		player:sendCancelMessage("A player with that name is not online.")
		return false
	end

	if target:getAccountType() ~= ACCOUNT_TYPE_NORMAL then
		player:sendCancelMessage("You can only mutate a normal player.")
		return false
	end

	if time == 0 and time >= 360 then
		player:sendCancelMessage("you can only mute for a maximum of 360 minutes")
		return false
	end

	local condition = Condition(CONDITION_MUTED)
	condition:setParameter(CONDITION_PARAM_TICKS, time*60*1000)

	target:doaddCondition(condition)
	target:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have been muted by " .. player:getName() .. " , to "..time.. " minutes.")
	player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You muted " .. target:getName() .." to "..time.." minutes.")
end

	<talkaction words="/mute" separator=" " script="ARQUIVO.lua" />

Editado por Linus (veja o histórico de edições)

Postado
  • Autor

Não funcionou, deu erro na script.

 

[WARNING] - Event : : checkscript] can not load script: scripts/mute.lua

data/talkaction/scripts/mute.lua :37:  'end' expected (to close 'function' at line 1) near '<eof>


UP

Editado por arthur122222 (veja o histórico de edições)

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo