Sign in to follow this  
Dadinho2828

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 

Share this post


Link to post

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.mtasa.com/forum/97-portuguese-português/

This would be the appropriate section: https://forum.mtasa.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

Share this post


Link to post

@Dadinho2828 favor veja as regras do fórum antes de postar.

E coloque seu código na formatação adequada. Clique no botão <> para fazer isso.

UqAT5Nh.png

Share this post


Link to post

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

Share this post


Link to post

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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.