Ir para conteúdo

Featured Replies

Postado
  • Autor
  Em 18/02/2016 em 20:34, Pandawan. disse:

Amigo, tente esse..
 

Mostrar conteúdo oculto

cara esse aqui o player manda uma mensagem e depois fica bloquiado, como se estivesse tomado o comando !mute, inclusive tutor..

 

 

 

 

  Em 18/02/2016 em 20:38, vankk disse:

@Pandawan

>>  if player:getCondition(CONDITION_CHANNELMUTEDTICKS, CONDITIONID_DEFAULT, CHANNEL_ADVERTISING) then

 

>>> CHANNEL_ADVERTISING

 

>>>> ADVERTISING

 

??? Queremos checar a condição do muted no channel help e não adversiting.

 

- tópico.


local CHANNEL_HELP = 7

local muted = Condition(CONDITION_CHANNELMUTEDTICKS, CONDITIONID_DEFAULT)
muted:setParameter(CONDITION_PARAM_SUBID, CHANNEL_HELP)
muted:setParameter(CONDITION_PARAM_TICKS, 120000)

function onSpeak(player, type, message)
	local playerAccountType = player:getAccountType()
	if player:getLevel() == 1 and playerAccountType == ACCOUNT_TYPE_NORMAL then
		player:sendCancelMessage("You may not speak into channels as long as you are on level 1.")
		return false
	end
	
	-- muted por tempo
	if player:getCondition(CONDITION_CHANNELEXAUSTTICKS, CONDITIONID_DEFAULT, CHANNEL_HELP) then
		player:sendCancelMessage("You may only ask a question once every two minutes.")
		return false
	end

	if playerAccountType < ACCOUNT_TYPE_TUTOR then	
		player:addCondition(muted)
	end

	if type == TALKTYPE_CHANNEL_Y then
		if playerAccountType >= ACCOUNT_TYPE_TUTOR or getPlayerFlagValue(player, PlayerFlag_TalkOrangeHelpChannel) then
			type = TALKTYPE_CHANNEL_O
		end
	elseif type == TALKTYPE_CHANNEL_O then
		if playerAccountType < ACCOUNT_TYPE_TUTOR and not getPlayerFlagValue(player, PlayerFlag_TalkOrangeHelpChannel) then
			type = TALKTYPE_CHANNEL_Y
		end
	elseif type == TALKTYPE_CHANNEL_R1 then
		if playerAccountType < ACCOUNT_TYPE_GAMEMASTER and not getPlayerFlagValue(player, PlayerFlag_CanTalkRedChannel) then
			if playerAccountType >= ACCOUNT_TYPE_TUTOR or getPlayerFlagValue(player, PlayerFlag_TalkOrangeHelpChannel) then
				type = TALKTYPE_CHANNEL_O
			else
				type = TALKTYPE_CHANNEL_Y
			end
		end
	end
	return type
end

 

Não funcionou, da pra falar sem parar do mesmo jeito

  • Respostas 12
  • Visualizações 1.1k
  • Created
  • Última resposta

Top Posters In This Topic

Postado

Você está testando com uma conta de GOD ou até mesmo com o god? Se sim, já achamos o problema, se não, eu removi a condição para adicionar o muted.

 

local CHANNEL_HELP = 7

local muted = Condition(CONDITION_CHANNELMUTEDTICKS, CONDITIONID_DEFAULT)
muted:setParameter(CONDITION_PARAM_SUBID, CHANNEL_HELP)
muted:setParameter(CONDITION_PARAM_TICKS, 120000)

function onSpeak(player, type, message)
	local playerAccountType = player:getAccountType()
	if player:getLevel() == 1 and playerAccountType == ACCOUNT_TYPE_NORMAL then
		player:sendCancelMessage("You may not speak into channels as long as you are on level 1.")
		return false
	end
	
	-- muted por tempo
	if player:getCondition(CONDITION_CHANNELEXAUSTTICKS, CONDITIONID_DEFAULT, CHANNEL_HELP) then
		player:sendCancelMessage("You may only ask a question once every two minutes.")
		return false
	end

	player:addCondition(muted)

	if type == TALKTYPE_CHANNEL_Y then
		if playerAccountType >= ACCOUNT_TYPE_TUTOR or getPlayerFlagValue(player, PlayerFlag_TalkOrangeHelpChannel) then
			type = TALKTYPE_CHANNEL_O
		end
	elseif type == TALKTYPE_CHANNEL_O then
		if playerAccountType < ACCOUNT_TYPE_TUTOR and not getPlayerFlagValue(player, PlayerFlag_TalkOrangeHelpChannel) then
			type = TALKTYPE_CHANNEL_Y
		end
	elseif type == TALKTYPE_CHANNEL_R1 then
		if playerAccountType < ACCOUNT_TYPE_GAMEMASTER and not getPlayerFlagValue(player, PlayerFlag_CanTalkRedChannel) then
			if playerAccountType >= ACCOUNT_TYPE_TUTOR or getPlayerFlagValue(player, PlayerFlag_TalkOrangeHelpChannel) then
				type = TALKTYPE_CHANNEL_O
			else
				type = TALKTYPE_CHANNEL_Y
			end
		end
	end
	return type
end

 

discord.pngDiscord: vankk #7765

Precisando de ajuda? Entre em contato comigo via Discord.

 

Muitos vêm seus muitos dias de glória, mas poucos vêm seus muitos dias de luta.

Postado
Mostrar conteúdo oculto

Veja agora, meu caro... @77mateus77

Mail_Gmail.pngpandawan.contatot@gmail.com

4e7ooc0.jpg

Postado
  • Autor
  Em 19/02/2016 em 00:58, vankk disse:

Você está testando com uma conta de GOD ou até mesmo com o god? Se sim, já achamos o problema, se não, eu removi a condição para adicionar o muted.

 


local CHANNEL_HELP = 7

local muted = Condition(CONDITION_CHANNELMUTEDTICKS, CONDITIONID_DEFAULT)
muted:setParameter(CONDITION_PARAM_SUBID, CHANNEL_HELP)
muted:setParameter(CONDITION_PARAM_TICKS, 120000)

function onSpeak(player, type, message)
	local playerAccountType = player:getAccountType()
	if player:getLevel() == 1 and playerAccountType == ACCOUNT_TYPE_NORMAL then
		player:sendCancelMessage("You may not speak into channels as long as you are on level 1.")
		return false
	end
	
	-- muted por tempo
	if player:getCondition(CONDITION_CHANNELEXAUSTTICKS, CONDITIONID_DEFAULT, CHANNEL_HELP) then
		player:sendCancelMessage("You may only ask a question once every two minutes.")
		return false
	end

	player:addCondition(muted)

	if type == TALKTYPE_CHANNEL_Y then
		if playerAccountType >= ACCOUNT_TYPE_TUTOR or getPlayerFlagValue(player, PlayerFlag_TalkOrangeHelpChannel) then
			type = TALKTYPE_CHANNEL_O
		end
	elseif type == TALKTYPE_CHANNEL_O then
		if playerAccountType < ACCOUNT_TYPE_TUTOR and not getPlayerFlagValue(player, PlayerFlag_TalkOrangeHelpChannel) then
			type = TALKTYPE_CHANNEL_Y
		end
	elseif type == TALKTYPE_CHANNEL_R1 then
		if playerAccountType < ACCOUNT_TYPE_GAMEMASTER and not getPlayerFlagValue(player, PlayerFlag_CanTalkRedChannel) then
			if playerAccountType >= ACCOUNT_TYPE_TUTOR or getPlayerFlagValue(player, PlayerFlag_TalkOrangeHelpChannel) then
				type = TALKTYPE_CHANNEL_O
			else
				type = TALKTYPE_CHANNEL_Y
			end
		end
	end
	return type
end

 

Não, estava testando com player normal mesmo

  Em 19/02/2016 em 01:06, Pandawan. disse:
Mostrar conteúdo oculto

Veja agora, meu caro... @77mateus77

Cara ficou perfeito, so gostaria de aumentar o tempo para 2 minutos,mas tem um probleminha, o tutor tbm ta sendo bloquiado a cada 10 segundos, gostaria que o tutor pudesse envia normal

Postado

Em relação ao tutor é um pouco mais complicado, visto que a partir do TFS 1 os account type são somente 1; 2; 3...
Vou dar uma olhada direitinho e tento te dar uma resposta o mais breve possível, isso dai é só a correção do tempo para 2 minutos.

Mostrar conteúdo oculto


___________________________________________________________________________________________________________
Editando com a correção do exhausted tutor, porém, não tenho como testar. Logo, está abaixo a tentativa de corrigir:

Mostrar conteúdo oculto

Qualquer coisa estou a disposição, abraço!

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

Mail_Gmail.pngpandawan.contatot@gmail.com

4e7ooc0.jpg

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.

Conteúdo Similar

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.7k

Informação Importante

Confirmação de Termo