FbzinnN Posted May 2, 2021 Posted May 2, 2021 local LojinhaDsujo = math.random(1000, 3500) Caixas = { --LS [1] = {2080.4318847656,2057.5776367188,11.0546875}; [2] = {1106.7760009766,-1365.8386230469,13.973905563354}; } Marker = {} Roubando = { [1] = false; [2] = false; } function CriarMarkers() for i, MarkerTable in pairs(Caixas) do Marker[i] = createMarker(MarkerTable[1], MarkerTable[2], MarkerTable[3] -1, "cylinder", 1.2, 255,0, 0, 0) end end addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), CriarMarkers) function roubarCaixa(source) if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(source)), aclGetGroup("Everyone")) then for ii, vv in pairs(Marker) do if (isElementWithinMarker(source, vv)) then inn = ii end end for i, MarkerTable in pairs(Caixas) do if (i == inn) then if Roubando[i] then return triggerClientEvent(source, "serverNotifys2", root, "Essa loja já foi roubada recentemente !", "error") end local xp, yp, zp = getElementPosition(source) local x, y, z = getElementPosition(MarkerTable) local dist = getDistanceBetweenPoints3D(xp, yp, zp, x, y, z) if (dist >= 5) then return end Roubando[i] = true if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(source)), aclGetGroup("Policial")) then triggerClientEvent(source, "serverNotifys2", root, "Uma lojinha está sendo assaltada !", "error") end setPedAnimation(source, "SHOP", "SHP_Gun_Aim", 15000, true, false, false, false) setTimer(function() triggerClientEvent(source, "FB:TempoPainelAtivadoLojinha", getRootElement()) setPedAnimation(source) triggerClientEvent(source, "serverNotifys2", root, "Não vá para longe você esta assaltando uma lojinha", "error") setTimer(function() triggerClientEvent("serverNotifys2", root, "Uma lojinha foi assaltada !", "error") setTimer(function() if (isElement(source)) then local xp, yp, zp = getElementPosition(source) local dist = getDistanceBetweenPoints3D(xp, yp, zp, x, y, z) if (dist <= 25) then givePlayerMoney(source, LojinhaDsujo) end setTimer(function() setTimer(function() Roubando[i] = false end, 600000, 1) end, 600000, 1) end, 1000, 1) end, 180000, 1) end, 15000, 1) end end else triggerClientEvent(source, "serverNotifys2", root, "Você não tem permissão para assaltar essa loja", "error") end end addCommandHandler("assaltar", roubarCaixa)
Moderators Tut Posted May 2, 2021 Moderators Posted May 2, 2021 Thread's been moved into the Portuguese scripting section 1
Other Languages Moderators androksi Posted May 2, 2021 Other Languages Moderators Posted May 2, 2021 Olá. "MarkerTable" não é um marker, por isso é impossível obter a posição do elemento. 1
FbzinnN Posted May 2, 2021 Author Posted May 2, 2021 Andr0xy mais vc tem alguma ideia de como eu posso fazer isso algum tipo de dica ?
Other Languages Moderators androksi Posted May 3, 2021 Other Languages Moderators Posted May 3, 2021 (edited) Da forma que você está fazendo, acredito que alterando de: MarkerTable Para: Marker[i] Resolveria o problema. Edited May 3, 2021 by andr0xy
FbzinnN Posted May 4, 2021 Author Posted May 4, 2021 (edited) deu não vou tentar de outra forma Edited May 4, 2021 by FbzinnN
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