Jump to content

CHAT ANONIMO


Recommended Posts

Olá eu sou dono de um servidor de mta

mas tem um players que aproveitam do chat anonimo pra fazer spam e xingar uns a os outro

quero saber como faço para os apenas os staffs verem quem pode ver o anonimo

  
function MensagemAnon(source, cmd, ...) 
    local MessagemANS = table.concat ( { ... }, " " ); 
for _,v in ipairs(getElementsByType("player")) do 
    outputChatBox("#ffffff[ #696969 Anônimo #ffffff] #696969"..MessagemANS,v, 255, 255, 255, true)  --efeito no chat
    end 
end 
addCommandHandler("Ans",  MensagemAnon)

addEventHandler("onPlayerJoin", getRootElement(),  
function() 
  bindKey(source, "k", "down", "chatbox", "Ans")--bind
end 

addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), function() 
  for index,player in pairs(getElementsByType("player")) do 
        bindKey(player,"k", "down", "chatbox", "Ans") --bind
  end 
end 

Link to comment
  • Administrators

Hello and welcome to the forums!

Please use the Portuguese language section if you do not want to get help through English language. https://forum.multitheftauto.com/forum/97-portuguese-português/

This would be the appropriate section: https://forum.multitheftauto.com/forum/127-programação-em-Lua/ In your case we'll move your thread there, so you won't have to create another. Stick to this and receive the help needed. :)

@Dadinho2828

Link to comment

Coloque isso em baixo do seu outputChat
 

			  if getElementData(v, "AnonymousAdmin") == true then
			  outputChatBox("#FFFFFF[AnonimoAdmin]: "..getPlayerName(source).." Falou: #bebebe"..MessagemANS, v, 255,255,255, true)
			  else
			  end

e la em baixo,nas ultimas linhas do seu script,coloque isso:
 

function showChatAdmin(source)
local bcc = getAccountName(getPlayerAccount(source))
     if isObjectInACLGroup("user."..bcc, aclGetGroup("Admin")) or isObjectInACLGroup("user."..bcc, aclGetGroup("Console")) then
	 if getElementData(source, "AnonymousAdmin") == false then
	 setElementData(source, "AnonymousAdmin", true)
	 outputChatBox("Você ativou o Anonymous Admin.", source, 255,255,255, true)
	 else
	 setElementData(source, "AnonymousAdmin", false)
	 outputChatBox("Você desativou o Anonymous Admin.", source, 255,255,255, true)
	 end
     end
end
addCommandHandler("anadm", showChatAdmin)

Espero ter ajudado

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