RO

/mute Apenas no help

Por roriscrave, 26 de jul. de 2015 em Scripts

otserv
52
9.8k
Luga03L
05 de agosto de 2015 às 12:12

Tenta assim:

 

 

local CHANNEL_HELP = 7
local storage = 456112
local minutes = 3 -- tempo em minutos para mutar o player

local condition = createConditionObject(CONDITION_MUTED)
setConditionParam(condition, CONDITION_PARAM_SUBID, CHANNEL_HELP)
setConditionParam(condition, CONDITION_PARAM_TICKS, minutes * 60 * 1000)

function onSay(cid, words, param)
	if words == "/mute" then
		local mute = string.explode(string.lower(param), ",")
		local target = getPlayerByName(mute[1])

		if target == false then
			doPlayerSendCancel(cid, "Jogador nao encontrado ou nao esta online.")
			return false
		end

		doAddCondition(target, condition)
		doPlayerSendTextMessage(target, MESSAGE_INFO_DESCR, "Você foi mutado por " .. minutes .. " minutos.")
		setPlayerStorageValue(target, storage, 1)
		return false
	elseif words == "/unmute" then
		local remove = getPlayerByName(param)

		if remove == false then
			doPlayerSendCancel(cid, "Jogador nao encontrado ou nao esta online.")
			return false
		end

		if getPlayerStorageValue(remove, storage) == 1 then
			doRemoveCondition(remove, CONDITION_MUTED, CONDITIONID_DEFAULT, CHANNEL_HELP)
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você desmutou o jogador " .. getCreatureName(remove) .. ".")
			setPlayerStorageValue(target, storage, -1)
		else
			doPlayerSendCancel(cid, "O jogador " .. getCreatureName(remove) .. " nao esta mutado.")
		end
	end
	return false
end

 

 

Agora use apenas /mute Player

Att.

Agora não está acontecendo absolutamente nada!

BrunoB
05 de agosto de 2015 às 13:39

Agora não está acontecendo absolutamente nada!

local CHANNEL_HELP = 7

Está correto com o id do seu channel?

05 de agosto de 2015 às 14:26

 

Em channels.xml, especifique um número para conditionId, como conditionId = "4" e use a talkaction assim


 

 

Deu esse erro amigo:

[05/08/2015 14:19:43] [Error - TalkAction Interface] 
[05/08/2015 14:19:43] data/talkactions/scripts/muteplayer.lua:onSay
[05/08/2015 14:19:43] Description: 
[05/08/2015 14:19:43] (luaSetConditionParam) This function can only be used while loading the script.

[05/08/2015 14:19:44] [Error - TalkAction Interface] 
[05/08/2015 14:19:44] data/talkactions/scripts/muteplayer.lua:onSay
[05/08/2015 14:19:44] Description: 
[05/08/2015 14:19:44] (luaDoAddCondition) Condition not found

E aqui como está o channels.xml

<?xml version="1.0" encoding="UTF-8"?>
<channels>
    <channel id="1" name="Party"/>
    <channel id="2" name="Equipe" access="1"/>
    <channel id="3" name="Rule Violations" logged="yes"/>
    <channel id="4" name="Bate Papo" level="2"/>
    <channel id="5" name="Trade" level="8" muted="120" conditionId="2" conditionMessage="Wait 2 minutes."/>
    <channel id="9" name="Help" logged="yes" muted="120" conditionId="4" conditionMessage="Wait 2 minutes."/>
    <channel id="65535" name="Private Chat Channel"/>
</channels>


local CHANNEL_HELP = 7

Está correto com o id do seu channel?

 

Coloquei ID 7, e ID 9 para testar...

aparece essa mensagem pro player

14:24 Você foi mutado por 3 minutos.

mas ele não é mutado em nenhum channel

BrunoB
05 de agosto de 2015 às 14:56

Deu esse erro amigo:

Tenta assim:

 

local CHANNEL_HELP = 9
local storage = 456112
local tempo = 3 -- tempo em minutos

local condition = createConditionObject(CONDITION_MUTED, CHANNEL_HELP)
setConditionParam(condition, CONDITION_PARAM_TICKS, tempo * 60 * 1000)

function onSay(cid, words, param)
	if words == "/mute" then
		local target = getPlayerByName(param)
		if not target then
			doPlayerSendCancel(cid, "Jogador nao encontrado ou nao esta online.")
			return false
		end

		doAddCondition(target, condition)
		doPlayerSendTextMessage(target, MESSAGE_INFO_DESCR, "Você foi mutado por " .. tempo .. " minutos.")
		setPlayerStorageValue(target, storage, 1)
		return true
	elseif words == "/unmute" then
		local remove = getPlayerByName(param)

		if remove == false then
			doPlayerSendCancel(cid, "Jogador nao encontrado ou nao esta online.")
			return false
		end

		if getPlayerStorageValue(remove, storage) == 1 then
			doRemoveCondition(remove, CONDITION_MUTED, CHANNEL_HELP)
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você desmutou o jogador " .. getCreatureName(remove) .. ".")
			setPlayerStorageValue(target, storage, -1)
		else
			doPlayerSendCancel(cid, "O jogador " .. getCreatureName(remove) .. " nao esta mutado.")
		end
		return true
	end
end

 

 

E usa o comando /mute Jogador

Editado Agosto 5 por Bruno Minervino

Luga03L
05 de agosto de 2015 às 17:43

Tenta assim:

 

 

local CHANNEL_HELP = 9
local storage = 456112
local tempo = 3 -- tempo em minutos

local condition = createConditionObject(CONDITION_MUTED, CHANNEL_HELP)
setConditionParam(condition, CONDITION_PARAM_TICKS, tempo * 60 * 1000)

function onSay(cid, words, param)
	if words == "/mute" then
		local target = getPlayerByName(param)
		if not target then
			doPlayerSendCancel(cid, "Jogador nao encontrado ou nao esta online.")
			return false
		end

		doAddCondition(target, condition)
		doPlayerSendTextMessage(target, MESSAGE_INFO_DESCR, "Você foi mutado por " .. tempo .. " minutos.")
		setPlayerStorageValue(target, storage, 1)
		return true
	elseif words == "/unmute" then
		local remove = getPlayerByName(param)

		if remove == false then
			doPlayerSendCancel(cid, "Jogador nao encontrado ou nao esta online.")
			return false
		end

		if getPlayerStorageValue(remove, storage) == 1 then
			doRemoveCondition(remove, CONDITION_MUTED, CHANNEL_HELP)
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você desmutou o jogador " .. getCreatureName(remove) .. ".")
			setPlayerStorageValue(target, storage, -1)
		else
			doPlayerSendCancel(cid, "O jogador " .. getCreatureName(remove) .. " nao esta mutado.")
		end
		return true
	end
end

 

 

E usa o comando /mute Jogador

 

Eu testei, e ele mutou o player! mas foi em todos os canais e também quando desloga... o player perde o mute!

BrunoB
05 de agosto de 2015 às 17:51

Eu testei, e ele mutou o player! mas foi em todos os canais e também quando desloga... o player perde o mute!

Tenta assim:

 

local CHANNEL_HELP = 9
local storage = 456112
local tempo = 3 -- tempo em minutos

local condition = createConditionObject(CONDITION_MUTED)
setConditionParam(condition, CONDITION_PARAM_SUBID, CHANNEL_HELP)
setConditionParam(condition, CONDITION_PARAM_TICKS, tempo * 60 * 1000)

function onSay(cid, words, param)
	if words == "/mute" then
		local target = getPlayerByName(param)
		if not target then
			doPlayerSendCancel(cid, "Jogador nao encontrado ou nao esta online.")
			return false
		end

		doAddCondition(target, condition)
		doPlayerSendTextMessage(target, MESSAGE_INFO_DESCR, "Você foi mutado por " .. tempo .. " minutos.")
		setPlayerStorageValue(target, storage, 1)
		return true
	elseif words == "/unmute" then
		local remove = getPlayerByName(param)

		if remove == false then
			doPlayerSendCancel(cid, "Jogador nao encontrado ou nao esta online.")
			return false
		end

		if getPlayerStorageValue(remove, storage) == 1 then
			doRemoveCondition(remove, CONDITION_MUTED, CHANNEL_HELP)
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você desmutou o jogador " .. getCreatureName(remove) .. ".")
			setPlayerStorageValue(target, storage, -1)
		else
			doPlayerSendCancel(cid, "O jogador " .. getCreatureName(remove) .. " nao esta mutado.")
		end
		return true
	end
end

 

 

Se funfar, eu faço a parte do login, para corrigir isso de relogar.

Luga03L
05 de agosto de 2015 às 18:00

Agora não dá erro! nem o player é mutado!

06 de agosto de 2015 às 23:48

acho que nao é possivel n

SkyLighS
07 de agosto de 2015 às 00:26

Em channels.xml, especifique um número para conditionId, como conditionId = "4" e use a talkaction assim

function onSay(cid, words, param, channel, condition)
	if(param == '') then
		doPlayerSendTextMessage(cid, 21, "explaining the talkaction")
		return true
	end

	local t = string.explode(param, ",")
	player = getPlayerByName(t[1])
	local condition = createConditionObject(CONDITION_MUTED)
	
	if(not t[2] or t[2] == '') then
		doPlayerSendTextMessage(cid, 21, "explaining the talkaction")
	end
	
	if t[2] then
		time = tonumber(t[2]*1000) -- 10*1000 is 10 seconds.
		if(isPlayer(player) == TRUE and getPlayerGroupId(cid) > getPlayerGroupId(player) and getPlayerFlagValue(player, PLAYERFLAG_CANNOTBEMUTED) == false) then
            setConditionParam(condition, CONDITION_PARAM_SUBID, 4)
			doAddCondition(player, condition)
			doPlayerSendTextMessage(player, MESSAGE_STATUS_WARNING, "You have been muted by " .. getPlayerName(cid) .. " for " .. t[2] .. " seconds.")
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, getCreatureName(player) .. " has been muted for " .. t[2] .. " seconds.")
		else
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. t[1] .. " is not currently online or cannot be muted.")
		end
	end
			return true
 	end
leandrozeraL
07 de agosto de 2015 às 00:45

preciso desse script tb

07 de agosto de 2015 às 01:00

 

Em channels.xml, especifique um número para conditionId, como conditionId = "4" e use a talkaction assim


 

 

da esse error:

[07/08/2015 00:58:24] [Error - TalkAction Interface] 
[07/08/2015 00:58:24] data/talkactions/scripts/muteplayer.lua:onSay
[07/08/2015 00:58:24] Description: 
[07/08/2015 00:58:24] (luaSetConditionParam) This function can only be used while loading the script.

[07/08/2015 00:58:24] [Error - TalkAction Interface] 
[07/08/2015 00:58:24] data/talkactions/scripts/muteplayer.lua:onSay
[07/08/2015 00:58:24] Description: 
[07/08/2015 00:58:24] (luaDoAddCondition) Condition not found
leandrozeraL
08 de agosto de 2015 às 00:31

up

10 de agosto de 2015 às 04:21

up

NickbhzN
11 de agosto de 2015 às 11:55

up

narutomaniacosN
13 de agosto de 2015 às 15:51

up