MrDante Posted March 28, 2016 Share Posted March 28, 2016 (edited) First of all, I am Brazilian sorry for bad English 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 March 30, 2016 by Guest Link to comment
MrDante Posted March 28, 2016 Author Share Posted March 28, 2016 the group exist in acl? Yes! Link to comment
MrDante Posted March 28, 2016 Author Share Posted March 28, 2016 Well, I saw a business, who's in ComandoPolicia acl can type, but I want the message you are sending is for all the acl! Link to comment
Walid Posted March 28, 2016 Share Posted March 28, 2016 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
MrDante Posted March 28, 2016 Author Share Posted March 28, 2016 replace nick1 to nick herebefore 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 Link to comment
Walid Posted March 28, 2016 Share Posted March 28, 2016 Sorry i don't undrestand what you want exactly. Link to comment
MrDante Posted March 28, 2016 Author Share Posted March 28, 2016 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? Link to comment
Walid Posted March 28, 2016 Share Posted March 28, 2016 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
Anubhav Posted March 29, 2016 Share Posted March 29, 2016 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
MrDante Posted March 30, 2016 Author Share Posted March 30, 2016 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now