JohwXD Posted January 13, 2019 Share Posted January 13, 2019 meu objetivo é que apenas players na Acl STAFF possam dar o comando /carros, alguém pode me ajudar ? function limpa (jog,cmdo,distancia) local acc = getPlayerAccount (jog) if isObjectInACLGroup ( "user." ..getAccountName(acc), aclGetGroup ( "Staff" ) ) then for _,carro in ipairs (getElementsByType('vehicle')) do local px, py, pz = getElementPosition (jog) local cx, cy, cz = getElementPosition (carro) local distanciaC = getDistanceBetweenPoints3D (px, py, pz, cx, cy, cz) if (distancia == nil ) then if (distanciaC < 100) then destroyElement (carro) end elseif ( distanciaC < tonumber(distancia)) then destroyElement (carro) end end else outputChatBox ( "#000000[#ff0000Você não é da staff#000000] !", jog, 255, 0, 0) end addCommandHandler ('carros', limpa) fileDelete() Link to comment
Jonas^ Posted January 13, 2019 Share Posted January 13, 2019 (edited) Oi, você tem que fechar o if da verificação de staff coloque um end em baixo da linha 17 tente assim: function limpa (jog, cmd, distancia) local acc = getPlayerAccount (jog) if isObjectInACLGroup ( "user." ..getAccountName(acc), aclGetGroup ( "Staff" ) ) then for _, carro in ipairs (getElementsByType('vehicle')) do local px, py, pz = getElementPosition (jog) local cx, cy, cz = getElementPosition (carro) local distanciaC = getDistanceBetweenPoints3D (px, py, pz, cx, cy, cz) if (distancia == nil ) then if (distanciaC < 100) then destroyElement (carro) end elseif ( distanciaC < tonumber(distancia)) then destroyElement (carro) end end else outputChatBox ( "#000000[#ff0000Você não é da staff#000000] !", jog, 255, 0, 0) end end addCommandHandler ('carros', limpa) ative o /debugscript 3 e se der algum erro me mostre aqui Edited January 13, 2019 by OverKILL 1 Link to comment
JohwXD Posted January 13, 2019 Author Share Posted January 13, 2019 Obrigado, Funcionou Link to comment
Jonas^ Posted January 13, 2019 Share Posted January 13, 2019 3 minutes ago, JohwXD said: Obrigado, Funcionou De nada xD. 1 Link to comment
Other Languages Moderators Lord Henry Posted January 13, 2019 Other Languages Moderators Share Posted January 13, 2019 Sempre que for programar ou testar seus scripts, deixe o /debugscript 3 ativado. Esse problema teria sido detectado e vc poderia ter corrigido na mesma hora. 1 1 Link to comment
Matheus Henrick Posted January 13, 2019 Share Posted January 13, 2019 41 minutes ago, Lord Henry said: Sempre que for programar ou testar seus scripts, deixe o /debugscript 3 ativado. Esse problema teria sido detectado e vc poderia ter corrigido na mesma hora. Deveria explicar melhor 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