Jump to content

Script de Limpar Chat


Recommended Posts

ALGUM ERRO NO CONSOLE DIZ ASSIM attempt to call global 'isPlayerInACL'  (a nil value), como faço para resolver?
E também eu queria adicionar mais grupos que pudessem dar este comando /chat, exemplo Admin, Mod e outros

function limparchat(source)
    if isPlayerInACL (source, "Console") then
    outputChatBox ( "#FFFFFF", getRootElement(), 255, 255, 255, true )
    outputChatBox ( "#FFFFFF", getRootElement(), 255, 255, 255, true )
    outputChatBox ( "#FFFFFF", getRootElement(), 255, 255, 255, true )
    outputChatBox ( "#FFFFFF", getRootElement(), 255, 255, 255, true )
    outputChatBox ( "#FFFFFF", getRootElement(), 255, 255, 255, true )
    outputChatBox ( "#FFFFFF", getRootElement(), 255, 255, 255, true )
    outputChatBox ( "#FFFFFF", getRootElement(), 255, 255, 255, true )
    outputChatBox ( "#FFFFFF", getRootElement(), 255, 255, 255, true )
    outputChatBox ( "#FFFFFF", getRootElement(), 255, 255, 255, true )
    outputChatBox ( "#FFFFFF", getRootElement(), 255, 255, 255, true )
    outputChatBox ( "#FFFFFF", getRootElement(), 255, 255, 255, true )
    outputChatBox ( "#FFFFFF", getRootElement(), 255, 255, 255, true )
    outputChatBox ( "#FFFFFF", getRootElement(), 255, 255, 255, true )
    outputChatBox ( "#FFFFFF", getRootElement(), 255, 255, 255, true )
    outputChatBox ( "#FFFFFF", getRootElement(), 255, 255, 255, true )
    outputChatBox ( "#FFFFFF", getRootElement(), 255, 255, 255, true )
    outputChatBox ( "#FFFFFF", getRootElement(), 255, 255, 255, true )
    outputChatBox ( "#FFFFFF", getRootElement(), 255, 255, 255, true )
    outputChatBox ( "#FFFFFF", getRootElement(), 255, 255, 255, true )
    outputChatBox ( "#FFFFFF", getRootElement(), 255, 255, 255, true )
    outputChatBox( "#00FF00ᴏ ᴄʜᴀᴛ ғᴏɪ ʟɪᴍᴘᴏ ᴘᴏʀ #FFFF00"..getPlayerName(source).." #FF0000!!!", getRootElement(), 255, 255, 255, true)
    else
    outputChatBox ( "#00FF00Voce nao e da staff!!!", getRootElement(), 255, 255, 255, true )
    end
end
addCommandHandler( "chat", limparchat )

Edited by CouDev
Link to comment
--/> Exemplo para 2 Grupos ACL, Para Adicionar +, Adicione or isObjectInACLGroup ("user."..account, aclGetGroup ( "Console" )), igual abaixo :

function limparchat( source )
   local account = getAccountName(getPlayerAccount(source))
   if isObjectInACLGroup ("user."..account, aclGetGroup ( "Admin" )) or isObjectInACLGroup ("user."..account, aclGetGroup ( "Moderator" )) then
      outputChatBox (" ", root, 255, 255, 255, true )
      outputChatBox (" ", root, 255, 255, 255, true )
      outputChatBox (" ", root, 255, 255, 255, true )
      outputChatBox (" ", root, 255, 255, 255, true )
      outputChatBox (" ", root, 255, 255, 255, true )
      outputChatBox (" ", root, 255, 255, 255, true )
      outputChatBox (" ", root, 255, 255, 255, true )
      outputChatBox (" ", root, 255, 255, 255, true )
      outputChatBox (" ", root, 255, 255, 255, true )
      outputChatBox (" ", root, 255, 255, 255, true )
      outputChatBox (" ", root, 255, 255, 255, true )
      outputChatBox (" ", root, 255, 255, 255, true )
      outputChatBox (" ", root, 255, 255, 255, true )
      outputChatBox (" ", root, 255, 255, 255, true )
      outputChatBox (" ", root, 255, 255, 255, true )
      outputChatBox (" ", root, 255, 255, 255, true )
      outputChatBox (" ", root, 255, 255, 255, true )
      outputChatBox (" ", root, 255, 255, 255, true )
      outputChatBox (" ", root, 255, 255, 255, true )
      outputChatBox (" ", root, 255, 255, 255, true )
      outputChatBox (" ", root, 255, 255, 255, true )
      outputChatBox( "#00FF00ᴏ ᴄʜᴀᴛ ғᴏɪ ʟɪᴍᴘᴏ ᴘᴏʀ #FFFF00"..getPlayerName(source).." #FF0000!!!", root, 255, 255, 255, true)
      else
      outputChatBox ( "#00FF00Voce nao e da staff!!!", source, 255, 255, 255, true ) --/> Arrumado
   end
end
addCommandHandler( "chat", limparchat )

 

Edited by Angelo Pereira
Link to comment
addCommandHandler ("chat", function (thePlayer, cmd) 
	if (hasObjectPermissionTo (thePlayer, "command.mute", true)) then -- Se o jogador possuir permissão de mute, então: (Todos grupos padrões tem permissão de mute, então todos poderam usar o comando.)
		clearChatBox () -- Limpa o chat do servidor
		outputChatBox ("ᴏ ᴄʜᴀᴛ ғᴏɪ ʟɪᴍᴘᴏ ᴘᴏʀ #FFFF00"..getPlayerName(thePlayer).." #FF0000!!!", root, 0, 255, 0, true)
	else
		outputChatBox ("Voce nao e da staff!!!", thePlayer, 0, 255, 0)
	end
end)

 

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