Jump to content

block say


Recommended Posts

  • Moderators
Posted (edited)

Não. Pois se fizer isso não será mais possível falar no chat normal também.

Quando vc aperta T e escreve alguma mensagem, vc está internamente usando o comando /say

Se você está querendo evitar Spam, só usar um setTimer. Quando o jogador enviar uma mensagem, verifica se existe esse timer, se existir, cancela o envio da mensagem com cancelEvent no evento onPlayerChat. Se não tiver o timer, manda a mensagem normalmente e cria o timer.

Edited by Lord Henry

Eu te ajudei ou achou meu comentário útil? Não esqueça de deixar um Thanksspacer.png

Minhas contribuições para a comunidade: LordHenry - MTA Wiki Profile
Inscreva-se no meu canal do YouTube: Lord Henry - Entertainment
Discord Oficial do MTA: https://mtasa.com/discord
Blacklist e Whitelist de Scripters: Planilha

Por favor, não me envie mensagens privadas solicitando suporte. Crie um tópico no fórum em vez disso.

Posted

Pode verificar o isConsoleActive

Cliente:

local consoleActive = false
addEventHandler("onClientRender", root,
	function()
		if (consoleActive ~= isConsoleActive()) then
			consoleActive = isConsoleActive()
			setElementData(localPlayer,"consoleActive",consoleActive)
		end
	end
)

Server:

addEventHandler("onPlayerCommand", root,
	function(cmd)
		if (cmd ~= "say") then return end
		if getElementData(source,"consoleActive") then
			cancelEvent()
			outputChatBox("*Uso inválido!", source, 255, 0, 0)
		end
	end
)

 

  • Like 1
  • Thanks 2

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...