SkillZNT Posted March 15, 2020 Share Posted March 15, 2020 (edited) Eu adicionei a função isObjectInACLGroup so que não foi fiz algo de errado help me Timer = {} ------------------------------------------------------------CARROS------------------------------------------------------------------------------------ local Veiculos = {474} -- IDs Carro = {} function CreateVehicle (source) local accName = getAccountName ( getPlayerAccount ( source ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "staff" ) ) if getElementData (source, "Pegou", true) then return outputChatBox ('#FFFFFFEspere #00ffff10 Segundos #FFFFFFpara pegar outro carro !', source,255,255,255,true) end if Carro[source] then destroyElement(Carro[source]) Carro[source] = nil end local x,y,z = getElementPosition (source) local Cars = Veiculos[math.random(#Veiculos)] Carro[source] = createVehicle (Cars,x,y,z) setElementData(Carro[source],"creator",source) warpPedIntoVehicle (source,Carro[source]) outputChatBox ('#000000[#00ffff/carro#000000] #bebebeVocê pegou um carro !', source, 255, 255, 255, true) setElementData (source, "Pegou",true) Timer[source] = setTimer(function(player) if isElement(player) then setElementData(player,"Pegou",nil) end Timer[source] = nil end,10000,1,source) end addCommandHandler ("carro", CreateVehicle) ------------------------------------------------------------CARROS------------------------------------------------------------------------------------ ------------------------------------------------------------MOTOS------------------------------------------------------------------------------------- local Veiculos = {461} -- IDs dos Ve?culos. Moto = {} local accName = getAccountName ( getPlayerAccount ( source ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "staff" ) ) if getElementData(source, "Pegou", true) then return outputChatBox ('#FFFFFFEspere #00ffff10 Segundos #FFFFFFpara pegar outra moto !',source,255,255,255,true) end if Moto[source] then destroyElement(Moto[source]) Moto[source] = nil end local x,y,z = getElementPosition (source) local Cars = Veiculos[math.random(#Veiculos)] Moto[source] = createVehicle (Cars,x,y,z) setElementData(Moto[source],"creator",source) warpPedIntoVehicle (source,Moto[source]) outputChatBox ('#000000[#00ffff/moto#000000] #bebebeVocê pegou uma moto !', source, 255, 255, 255, true) setElementData (source, "Pegou",true) Timer[source] = setTimer(function(player) if isElement(player) then setElementData(player,"Pegou",nil) end Timer[source] = nil end,10000,1,source) end addCommandHandler ("moto", CreateVehicle) ------------------------------------------------------------MOTOS------------------------------------------------------------------------------------- function onVehicleExplode() local creator = getElementData(source,"creator") if isElement(creator) then if Moto[creator] and isElement(Moto[creator]) then if Moto[creator] == source then destroyElement(source) Moto[creator] = nil end end if Carro[creator] and isElement(Carro[creator]) then if Carro[creator] == source then destroyElement(source) Carro[creator] = nil end end end end addEventHandler("onVehicleExplode",resourceRoot,onVehicleExplode) function onPlayerQuit() if Moto[source] then destroyElement(Moto[source]) Moto[source] = nil end if Carro[source] then destroyElement(Carro[source]) Carro[source] = nil end if Timer[source] then if isTimer(Timer[source]) then killTimer(Timer[source]) end Timer[source] = nil end end addEventHandler("onPlayerQuit",root,onPlayerQuit) Quem poder ajudar Edited March 15, 2020 by SkillZNT Link to comment
Other Languages Moderators Lord Henry Posted March 15, 2020 Other Languages Moderators Share Posted March 15, 2020 (edited) No seu servidor existe a ACL Group Staff? Normalmente é mais fácil apenas verificar se o player tem permissão para mutar. (permissão de Staff) function CreateVehicle (thePlayer) local accName = getAccountName (getPlayerAccount (thePlayer)) if isObjectInACLGroup ("user."..accName, aclGetGroup ("staff")) then if getElementData (thePlayer, "Pegou", true) then return outputChatBox ("Espere #00ffff10 Segundos #FFFFFFpara pegar outro carro!", thePlayer, 255, 255, 255, true) end if Carro[thePlayer] then destroyElement(Carro[thePlayer]) Carro[thePlayer] = nil end local x, y, z = getElementPosition (thePlayer) local Cars = Veiculos[math.random(#Veiculos)] Carro[thePlayer] = createVehicle (Cars, x, y, z) setElementData (Carro[thePlayer], "creator", thePlayer) warpPedIntoVehicle (thePlayer, Carro[thePlayer]) outputChatBox ("[#00ffff/carro#000000] #bebebeVocê pegou um carro!", thePlayer, 0, 0, 0, true) setElementData (thePlayer, "Pegou", true) Timer[thePlayer] = setTimer (function (player) if isElement (player) then setElementData (player, "Pegou", false) end Timer[player] = nil end, 10000, 1, thePlayer) end end addCommandHandler ("carro", CreateVehicle) Além disso, na sua primeira função está faltando um then na linha 8 e um end no final da função. Edited March 15, 2020 by Lord Henry 1 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