Jump to content

Tenho Duvidas No chat RP


Recommended Posts

Gostaria de saber como faço para adicionar grupos ACL nestes chat Help-me

function MensagemTwitter(source, cmd, ...) 
    local MessagemT = table.concat ( { ... }, " " )
    local name = getPlayerName(source); 
for _,v in ipairs(getElementsByType("player")) do 
    outputChatBox("#00BFFF[ Twitter ] #FFFFFF "..name.." #FFFFFF: #00BFFF"..MessagemT,v, 255, 255, 255, true) --efeito no chat
    end 
end 
addCommandHandler("Twitter",  MensagemTwitter)
  
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)
  
function MensagemRP(source, cmd, ...) 
    local MessagemFRP = table.concat ( { ... }, " " ); 
    local name = getPlayerName(source); 
	local getID = getElementData(source, "ID") or "n.a"
for _,v in ipairs(getElementsByType("player")) do 
    outputChatBox("#A9A9A9[ @Global ]#ffffff "..name.." #A9A9A9(ID:"..getID..") #A9A9A9 ❱ #ffffff"..MessagemFRP,v, 255, 255, 255, true) --efeito no chat
    end 
end 
addCommandHandler("forarp",  MensagemRP)

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 
) 



addEventHandler("onPlayerJoin", getRootElement(),  
function() 
  bindKey(source, "u", "down", "chatbox", "Twitter") --bind
end 
) 

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




addEventHandler("onPlayerJoin", getRootElement(),  
function() 
  bindKey(source, "i", "down", "chatbox", "forarp") --bind
end 
) 

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

 

Link to post

Tente isso , usando isObjectInACLGroup .

function MensagemTwitter(source, cmd, ...) 
    local MessagemT = table.concat ( { ... }, " " )
    local name = getPlayerName(source); 
        for _,v in ipairs(getElementsByType("player")) do 
            local account = getAccountName(getPlayerAccount(source))
                if isObjectInACLGroup ( "user." .. account, aclGetGroup ( "Console" ) ) then
                    outputChatBox("#00BFFF[ Twitter ] #FFFFFF Console - "..name.." #FFFFFF: #00BFFF"..MessagemT,v, 255, 255, 255, true)
                else if isObjectInACLGroup ( "user." .. account, aclGetGroup ( "Admin" ) ) then
                    outputChatBox("#00BFFF[ Twitter ] #FFFFFF Administrador - "..name.." #FFFFFF: #00BFFF"..MessagemT,v, 255, 255, 255, true)
                end
            end 
    end
end 
addCommandHandler("Twitter",  MensagemTwitter) 

Depois é so repetir , o código adicionado para respectivos chats .

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
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...