Jump to content

[ SOLVED ] show only message to acl


MrDante

Recommended Posts

Posted (edited)

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

cd3JDcN.png?1

Posted

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) 

Do not yield your back to your enemy, might feel something strange in your ass.

Two things are infinite the universe and human stupidity and i'm not sure about the universe.

UF: IsTextInGridList | GetGridListRowIndexFromText | Table.removeValue | removeHex | dxDrawTriangle

Skype: SaSuki102 | About Me | Youtube channel | Lua Tips & Tricks | Lua Strings | Lua Tables | Lua Operators

Posted
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:

cd3JDcN.png?1

Posted

Sorry i don't undrestand what you want exactly.

Do not yield your back to your enemy, might feel something strange in your ass.

Two things are infinite the universe and human stupidity and i'm not sure about the universe.

UF: IsTextInGridList | GetGridListRowIndexFromText | Table.removeValue | removeHex | dxDrawTriangle

Skype: SaSuki102 | About Me | Youtube channel | Lua Tips & Tricks | Lua Strings | Lua Tables | Lua Operators

Posted
Sorry i don't undrestand what you want exactly.

I want the player type it /reforço and the message goes to everyone who is in the acl ComandosPolicia

Understood?

cd3JDcN.png?1

Posted

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) 

Do not yield your back to your enemy, might feel something strange in your ass.

Two things are infinite the universe and human stupidity and i'm not sure about the universe.

UF: IsTextInGridList | GetGridListRowIndexFromText | Table.removeValue | removeHex | dxDrawTriangle

Skype: SaSuki102 | About Me | Youtube channel | Lua Tips & Tricks | Lua Strings | Lua Tables | Lua Operators

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

Posted
  
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!

cd3JDcN.png?1

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