Jump to content

block say


Recommended Posts

  • Other Languages Moderators

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
Link to comment

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
Link to comment

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...