Jump to content

[ SOLVED ] show only message to acl


MrDante

Recommended Posts

First of all, I am Brazilian sorry for bad English :oops:

Hello guys I have a problem, I want the next when the player enter the message to everyone in such a acl, however I do not know what you can do to work, I tried, from a look

  
function PedirReforco(thePlayer) 
for k, nick in pairs(getElementsByType("player")) do 
    local x, y, z = getElementPosition(thePlayer) 
    local sx, sy, sz = getElementPosition(nick) 
    local dist =  getDistanceBetweenPoints3D(x, y, z, sx, sy, sz) 
    local location = getZoneName ( x, y, z ) 
     local nick1 = getPlayerName(nick) 
    local accName = getAccountName ( getPlayerAccount ( nick ) ) 
     local NickChamador = getPlayerName( thePlayer ) 
     if isObjectInACLGroup ("user."..accName, aclGetGroup ( "ComandosPolicia") ) then 
    outputChatBox ("#000000[#ff0000POLICIA#000000] #c1c1c1O jogador "..NickChamador.." pediu reforços mais proximo de "..location.." a "..math.floor(dist).." Km/H.", nick1, 255, 255, 255, true) 
end 
end 
end 
addCommandHandler("reforço",  PedirReforco) 

Edited by Guest
Link to comment

replace nick1 to nick here

before

outputChatBox ("#000000[#ff0000POLICIA#000000] #c1c1c1O jogador "..NickChamador.." pediu reforços mais proximo de "..location.." a "..math.floor(dist).." Km/H.", nick1, 255, 255, 255, true) 

after

outputChatBox ("#000000[#ff0000POLICIA#000000] #c1c1c1O jogador "..NickChamador.." pediu reforços mais proximo de "..location.." a "..math.floor(dist).." Km/H.", nick, 255, 255, 255, true) 

Link to comment
replace nick1 to nick here

before

outputChatBox ("#000000[#ff0000POLICIA#000000] #c1c1c1O jogador "..NickChamador.." pediu reforços mais proximo de "..location.." a "..math.floor(dist).." Km/H.", nick1, 255, 255, 255, true) 

after

outputChatBox ("#000000[#ff0000POLICIA#000000] #c1c1c1O jogador "..NickChamador.." pediu reforços mais proximo de "..location.." a "..math.floor(dist).." Km/H.", nick, 255, 255, 255, true) 

I've done that, but as I said, who's in ComandosPolicia acl can type, I want to appear to everyone who is in the acl, not for those who are in acl :oops:

Link to comment

Try this

function PedirReforco(thePlayer) 
    if thePlayer and isElement(thePlayer) then  
    local x, y, z = getElementPosition(thePlayer) 
    local location = getZoneName ( x, y, z ) 
    for index, players in pairs(getElementsByType("player")) do 
    local accName = getAccountName (getPlayerAccount (players)) 
    if isObjectInACLGroup ("user."..accName, aclGetGroup ("ComandosPolicia")) then 
        local NickChamador = getPlayerName(players) 
        local sx, sy, sz = getElementPosition(players) 
        local dist =  getDistanceBetweenPoints3D(x, y, z, sx, sy, sz) 
        outputChatBox ("#000000[#ff0000POLICIA#000000] #c1c1c1O jogador "..NickChamador.." pediu reforços mais proximo de "..location.." a "..math.floor(dist).." Km/H.", players, 255, 255, 255, true) 
        end 
    end 
end 
end      
addCommandHandler("reforço",  PedirReforco) 

Link to comment
  
function PedirReforco(thePlayer) 
    if thePlayer and isElement(thePlayer) then 
        local x, y, z = getElementPosition(thePlayer) 
        local location = getZoneName ( x, y, z ) 
        for index, players in pairs(getElementsByType("player")) do 
            local acc = getPlayerAccount (players) 
  
            if (not isGuestAccount( acc ) ) then 
                local accName = getAccountName( acc ) 
                if isObjectInACLGroup ("user."..accName, aclGetGroup ("ComandosPolicia")) then 
                    local NickChamador = getPlayerName(players) 
                    local sx, sy, sz = getElementPosition(players) 
                    local dist =  getDistanceBetweenPoints3D(x, y, z, sx, sy, sz) 
                    outputChatBox ("#000000[#ff0000POLICIA#000000] #c1c1c1O jogador "..NickChamador.." pediu reforços mais proximo de "..location.." a "..math.floor(dist).." Km/H.", players, 255, 255, 255, true) 
                end 
            end 
        end 
    end 
end     
addCommandHandler("reforco",  PedirReforco) 
  

Use /reforco

Remember:

1. You should be logged in.

Link to comment
  
function PedirReforco(thePlayer) 
    if thePlayer and isElement(thePlayer) then 
        local x, y, z = getElementPosition(thePlayer) 
        local location = getZoneName ( x, y, z ) 
        for index, players in pairs(getElementsByType("player")) do 
            local acc = getPlayerAccount (players) 
  
            if (not isGuestAccount( acc ) ) then 
                local accName = getAccountName( acc ) 
                if isObjectInACLGroup ("user."..accName, aclGetGroup ("ComandosPolicia")) then 
                    local NickChamador = getPlayerName(players) 
                    local sx, sy, sz = getElementPosition(players) 
                    local dist =  getDistanceBetweenPoints3D(x, y, z, sx, sy, sz) 
                    outputChatBox ("#000000[#ff0000POLICIA#000000] #c1c1c1O jogador "..NickChamador.." pediu reforços mais proximo de "..location.." a "..math.floor(dist).." Km/H.", players, 255, 255, 255, true) 
                end 
            end 
        end 
    end 
end     
addCommandHandler("reforco",  PedirReforco) 
  

Use /reforco

Remember:

1. You should be logged in.

Thanks, It worked!

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