Nadion Posted May 11, 2020 Posted May 11, 2020 addEventHandler ("onResourceStart", getRootElement(), function() setTimer ( moneyZoneTimerFunction, 2500, 0) local allGreenzones = getElementsByType ("radararea") for i,v in ipairs (allGreenzones) do local r,g,b,a = getRadarAreaColor (v) if (r == 0) and (g == 255) and (b == 0) and (a == 127) then local x,y = getElementPosition (v) local sx,sy = getRadarAreaSize (v) local col = createColCuboid (x,y, -50, sx,sy, 7500) setElementID (col, "greenzoneColshape") end end end) addEventHandler ("onColShapeHit", getRootElement(), function(hitElement, matchingDimension) if (getElementType (hitElement) == "player") and (getElementID (source) == "greenzoneColshape") then outputChatBox ("", hitElement, 255, 0, 0, true) toggleControl (hitElement, "fire", false) toggleControl (hitElement, "next_weapon", false) toggleControl (hitElement, "previous_weapon", false) toggleControl (hitElement, "sprint", true) toggleControl (hitElement, "aim_weapon", false) toggleControl (hitElement, "vehicle_fire", false) setPlayerHudComponentVisible (hitElement, "ammo", false) setPlayerHudComponentVisible (hitElement, "weapon", false) triggerClientEvent (hitElement, "enableGodMode", hitElement) end if (source == moneyZoneCol) and (getElementType (hitElement) == "vehicle") then setElementVelocity (hitElement, 0, 0, 0) setElementPosition (hitElement, 2018.33, 1534.77, 12.37) setVehicleRotation (hitElement, 0,0,270) if (getVehicleOccupant (hitElement, 0)) then outputChatBox ("", getVehicleOccupant (hitElement, 0), 255, 0, 0, false) end end end) addEventHandler ("onColShapeLeave", getRootElement(), function(leaveElement, matchingDimension) if (getElementType (leaveElement) == "player") and (getElementID (source) == "greenzoneColshape") then outputChatBox ("", leaveElement, 255, 0, 0, false) toggleControl (leaveElement, "fire", true) toggleControl (leaveElement, "next_weapon", true) toggleControl (leaveElement, "previous_weapon", true) toggleControl (leaveElement, "sprint", true) toggleControl (leaveElement, "aim_weapon", true) toggleControl (leaveElement, "vehicle_fire", true) setPlayerHudComponentVisible (leaveElement, "ammo", false) setPlayerHudComponentVisible (leaveElement, "weapon", false) triggerClientEvent (leaveElement, "disableGodMode", leaveElement) end end) --money zone col moneyZoneCol = createColCuboid (1993.12, 1519.14, -100, 17.43, 54.24, 117) --stop moneyzone col -- marker bij hospital createMarker (1607.36, 1814.24, -10, "cylinder", 24, 0, 255, 0, 190, getRootElement()) Boa noite, estou usando um script de Zona Verde e continuo recebendo warnings sobre um setTimer para uma função que não existe supostamente, queria saber se alguém pode me indicar um modo de retirar esse warning e se eu preciso manter esse setTimer, não programo em Lua porém consigo entender algumas coisas e até alterar outras, porém essa está difícil de entender para mim. Mensagem: Quote greenzone.Lua:3: Bad argument @ 'setTimer' [Expected function at argument 1, got nil]
Blaack Posted May 11, 2020 Posted May 11, 2020 Cara, se não existe esta função; Não há necessidade do setTimer para aciona-lá! Pode apagar a linha, que o erro sairá. 1
Moderators Lord Henry Posted May 11, 2020 Moderators Posted May 11, 2020 A função supostamente serviria pra dar dinheiro aos jogadores a cada 2 segundos e meio. Mas creio que vc não quer isso. Então apenas apague esse setTimer. 1 Eu te ajudei ou achou meu comentário útil? Não esqueça de deixar um Thanks! Minhas contribuições para a comunidade: LordHenry - MTA Wiki Profile Inscreva-se no meu canal do YouTube: Lord Henry - Entertainment Discord Oficial do MTA: https://mtasa.com/discord Blacklist e Whitelist de Scripters: Planilha Por favor, não me envie mensagens privadas solicitando suporte. Crie um tópico no fórum em vez disso.
Nadion Posted May 11, 2020 Author Posted May 11, 2020 Muito obrigado pelas respostas, vou apagar esse timer!
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