Search the Community
Showing results for tags 'portugues'.
-
Boa noite, Eu estou com uma HUD da Internet, porém o DINHEIRO QUE ESTÁ NO BANCO NAO fica na HUD alguem poderia me ajudar ja tentei pesquisar mas nao achei nada..... CODIGO HUD function dxDrawHud () local avatarSelec = getElementData(getLocalPlayer(), "avatar") if not avatarSelec then avatarSelec = 2 end local SaldoBank = getElementData(localPlayer, "banco:Saldo") or 0 local vida = getElementHealth ( getLocalPlayer() ) + 0.40000152596 local armor = math.floor (getPedArmor ( getLocalPlayer())) local stat = getPedStat ( getLocalPlayer(), 24 ) local oxgen = math.floor(getPedOxygenLevel(getLocalPlayer())) oxigenio = getPedOxygenLevel ( getLocalPlayer() ) --local money = string.format("%010d", getPlayerMoney(getLocalPlayer())) local money1 = string.format("%011d", getPlayerMoney(getLocalPlayer())) local money2 = getPlayerMoney(getLocalPlayer()) local procurado = getPlayerWantedLevel(getLocalPlayer()) local ammo = getPedAmmoInClip (localPlayer,getPedWeaponSlot(localPlayer)) local ammo1 = getPedTotalAmmo(localPlayer)-getPedAmmoInClip(localPlayer) local money = convertNumber(getPlayerMoney(getLocalPlayer())) [CODIGO BANK] --[[ ################################################ # # # SCRIPT PRODUZIDO POR: # # FACEBOOK.COM/VAZERNMTA # # # # # ################################################ ]] local dxfont0_fonte = dxCreateFont("font/fonte.ttf", 11) local dxfont1_fonte = dxCreateFont("font/fonte.ttf", 13) atmTxd = engineLoadTXD("models/atm/kmb_atmx.txd") engineImportTXD(atmTxd, 2942) bankTxd = engineLoadTXD("models/bank/lanblokd.txd") engineImportTXD(bankTxd, 4005) local bankBot = createPed(150, 359.71246, 173.56975, 1008.38281, -90) local atm1 = createObject(2942, 359.86437, 188.99635, 1008.04281) local atm2 = createObject(2942, 360.86437, 188.99635, 1008.04281) local atm3 = createObject(2942, 361.86437, 188.99635, 1008.04281) local atm4 = createObject(2942, 1928.58215, -1768.56689, 13.14688, 0, 0, 90) local atm5 = createObject(2942, 1815.18152, -1557.53162, 13.08579, 0, 0, 70) local atm6 = createObject(2942, 1682.24341, -1272.46252, 14.41477, 0, 0, 0) local atm7 = createObject(2942, 1051.96143, -1131.20642, 23.42813, 0, 0, 0) local atm8 = createObject(2942, 537.36407, -1740.75659, 11.87771, 0, 0, 180) setElementInterior(atm1, 3) setElementDimension(atm1, 2) setElementInterior(atm2, 3) setElementDimension(atm2, 2) setElementInterior(atm3, 3) setElementDimension(atm3, 2) setElementInterior(bankBot, 3) setElementDimension(bankBot, 2) setElementFrozen(bankBot, true) function convertNumber ( number ) local formatted = number while true do formatted, k = string.gsub(formatted, "^(-?%d+)(%d%d%d)", '%1,%2') if ( k==0 ) then break end end return formatted end function isEventHandlerAdded( sEventName, pElementAttachedTo, func ) if type( sEventName ) == 'string' and isElement( pElementAttachedTo ) and type( func ) == 'function' then local aAttachedFunctions = getEventHandlers( sEventName, pElementAttachedTo ) if type( aAttachedFunctions ) == 'table' and #aAttachedFunctions > 0 then for i, v in ipairs( aAttachedFunctions ) do if v == func then return true end end end end return false end function dxDrawLinedRectangle( x, y, width, height, color, _width, postGUI ) _width = _width or 1 dxDrawLine ( x, y, x+width, y, color, _width, postGUI ) -- Top dxDrawLine ( x, y, x, y+height, color, _width, postGUI ) -- Left dxDrawLine ( x, y+height, x+width, y+height, color, _width, postGUI ) -- Bottom return dxDrawLine ( x+width, y, x+width, y+height, color, _width, postGUI ) -- Right end local szx,szy = guiGetScreenSize() local tx, ty, tz = 1411.80339, -1699.87390, 13.53949 local sz = tz-2.5 local marker = createMarker (tx, ty, sz, "cylinder", 1, 241, 155, 0, 0) local screenW, screenH = guiGetScreenSize() local resW, resH = 1360,768 local x, y = (screenW/resW), (screenH/resH) local l_0_1 = false local l_0_2, l_0_3 = guiGetScreenSize() local l_0_4 = dxCreateScreenSource(l_0_2, l_0_3) grid = Grid(x*497, y*400, x*325, y*162) colum = grid:addColumn("Jogadores", x*200) grid:setVisible(false) function playersGrid() grid:clear() for i, player in pairs(getElementsByType("player")) do if (player ~= localPlayer) then grid:addItem(colum, getPlayerName(player):gsub("#%x%x%x%x%x%x", "")) end end end addEventHandler("onClientPlayerQuit", root, playersGrid) addEventHandler("onClientPlayerJoin", root, playersGrid) addEventHandler("onClientResourceStart", resourceRoot, playersGrid) addEventHandler("onClientPlayerChangeNick", root, playersGrid) addEventHandler("onClientRender", root, function() if l_0_1 then dxUpdateScreenSource(l_0_4) dxDrawImage(0, 0, l_0_2, l_0_3, l_0_4) end end ) addEventHandler ( "onClientRender", root, function ( ) vx, vy, vz = getElementPosition(marker) scX, scY = getScreenFromWorldPosition(vx, vy, vz+3.5) cx,cy,cz,clx,cly,clz,crz,cfov = getCameraMatrix() dist = getDistanceBetweenPoints3D(cx, cy, cz, vx, vy, vz+3.5) if scX then largura, altura = 626, 350 Tx = scX-(5000/dist)*szx/626/largura*cfov Ty = scY-(100/dist)*szy/350/altura*cfov Tw = (5000/dist)*szx/400/largura*cfov Th = (5000/dist)*szy/400/altura*cfov if dist < 80.0 then if (isLineOfSightClear(cx, cy, cz, vx, vy, vz+1.5, true, false, false)) then if not isElementWithinMarker(localPlayer, marker) then --dxDrawText("$", Tx, Ty, Tw, Th + 40, tocolor(255, 255, 255, math.abs(math.sin(getTickCount()/700))*200), 1.00, dxfont1_fonte, "left", "top", false, false, true, true, false) --dxDrawText("Loja de #f19b00vida #ffffffe #f19b00colete", Tx, Ty + 120, Tw, Th + 40, tocolor(255, 255, 255, math.abs(math.sin(getTickCount()/700))*200), 1.00, dxfont2_fonte, "left", "top", false, false, true, true, false) dxDrawImage ( Tx, Ty, Tw, Th, "gfx/joinIcon.png",0,0,0,tocolor(255,255,255,255)) end end end end end) function cancelPedDamage(attacker) cancelEvent() end addEventHandler("onClientPedDamage", bankBot, cancelPedDamage) function caixaUI() local money = convertNumber(getPlayerMoney(localPlayer)) local bankMoney = convertNumber(getElementData(localPlayer, "Bank:Royal")) exports["fx_blur"]:dxDrawBluredRectangle(0, 0, screenW, screenH, tocolor(255, 255, 255, 255)) dxDrawImage(x*0, y*0, x*1360, y*768,"gfx/ui/bg.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawImage(x*0, y*0, x*1360, y*768,"gfx/ui/bg2.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawImage(x*0, y*0, x*1360, y*768, isCursorOnElement(x*464, y*366, x*93, y*95) and "gfx/ui/t_button2.png" or "gfx/ui/t_button.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawImage(x*0, y*0, x*1360, y*768, isCursorOnElement(x*625, y*366, x*93, y*95) and "gfx/ui/d_button2.png" or "gfx/ui/d_button.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawImage(x*0, y*0, x*1360, y*768, isCursorOnElement(x*778, y*366, x*93, y*95) and "gfx/ui/r_button2.png" or "gfx/ui/r_button.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawText(getPlayerName(localPlayer):gsub("#%x%x%x%x%x%x", ""), x*310, y*158, x*406, y*182, tocolor(0, 0, 0, 127), 1.00, dxfont0_fonte, "left", "top", false, false, false, true, false) dxDrawText("R$ "..money, x*339, y*189, x*426, y*213, tocolor(0, 0, 0, 127), 1.00, dxfont0_fonte, "left", "top", false, false, false, false, false) dxDrawText("R$ "..bankMoney, x*340, y*216, x*427, y*240, tocolor(0, 0, 0, 127), 1.00, dxfont0_fonte, "left", "top", false, false, false, false, false) if getElementData(localPlayer, "Notification") then dxDrawText("[Erro] "..getElementData(localPlayer, "Notification"), x*240, y*680, x*706, y*441, tocolor(255, 0, 0, 255), 1.00, dxfont0_fonte, "left", "top", false, false, false, false, false) end if getElementData(localPlayer, "Notification:S") then dxDrawText("[Sucesso] "..getElementData(localPlayer, "Notification:S"), x*240, y*680, x*706, y*441, tocolor(0, 255, 0, 255), 1.00, dxfont0_fonte, "left", "top", false, false, false, false, false) end end function acessingUI() exports["fx_blur"]:dxDrawBluredRectangle(0, 0, screenW, screenH, tocolor(255, 255, 255, 255)) dxDrawImage(x*0, y*0, x*1360, y*768,"gfx/ui/bg1.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) end function depositUI() local money = convertNumber(getPlayerMoney(localPlayer)) local bankMoney = convertNumber(getElementData(localPlayer, "Bank:Royal")) exports["fx_blur"]:dxDrawBluredRectangle(0, 0, screenW, screenH, tocolor(255, 255, 255, 255)) dxDrawImage(x*0, y*0, x*1360, y*768,"gfx/ui/bg.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawImage(x*0, y*0, x*1360, y*768,"gfx/ui/bgd.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawText(getPlayerName(localPlayer):gsub("#%x%x%x%x%x%x", ""), x*310, y*158, x*406, y*182, tocolor(0, 0, 0, 127), 1.00, dxfont0_fonte, "left", "top", false, false, false, true, false) dxDrawText("R$ "..money, x*339, y*189, x*426, y*213, tocolor(0, 0, 0, 127), 1.00, dxfont0_fonte, "left", "top", false, false, false, false, false) dxDrawText("R$ "..bankMoney, x*340, y*216, x*427, y*240, tocolor(0, 0, 0, 127), 1.00, dxfont0_fonte, "left", "top", false, false, false, false, false) dxDrawRectangle(x*402, y*564, x*540, y*56, isCursorOnElement(x*502, y*564, x*320, y*56) and tocolor(0, 84, 131, 255) or tocolor(0, 112, 175, 255), false) createEditBox("2", 0.379, 0.443, 0.22, 0.06, true, "", false, 7, "arial", false, 1, {0, 0, 0, 127 }, true, { 0, 0, 0, 55 }, 1, true, 60, true, "Digite o valor", { 0, 0, 0, 127 }, true, 1, "arial", true, true, {0, 0, 0}, false) dxDrawText(" Cancelar", x*619, y*580, x*706, y*441, --[[isCursorOnElement(x*502, y*401, x*320, y*56) and]] tocolor(255, 255, 255, 255)--[[ or tocolor(0, 0, 0, 127)]], 1.00, dxfont1_fonte, "left", "top", false, false, false, false, false) dxDrawRectangle(x*402, y*480, x*540, y*56, isCursorOnElement(x*502, y*480, x*320, y*56) and tocolor(0, 84, 131, 255) or tocolor(0, 112, 175, 255), false) dxDrawText(" Depositar", x*619, y*497, x*706, y*441, --[[isCursorOnElement(x*502, y*401, x*320, y*56) and]] tocolor(255, 255, 255, 255)--[[ or tocolor(0, 0, 0, 127)]], 1.00, dxfont1_fonte, "left", "top", false, false, false, false, false) if getElementData(localPlayer, "Notification") then dxDrawText("[Erro] "..getElementData(localPlayer, "Notification"), x*240, y*680, x*706, y*441, tocolor(255, 0, 0, 255), 1.00, dxfont0_fonte, "left", "top", false, false, false, false, false) end if getElementData(localPlayer, "Notification:S") then dxDrawText("[Sucesso] "..getElementData(localPlayer, "Notification:S"), x*240, y*680, x*706, y*441, tocolor(0, 255, 0, 255), 1.00, dxfont0_fonte, "left", "top", false, false, false, false, false) end end function sacUI() local money = convertNumber(getPlayerMoney(localPlayer)) local bankMoney = convertNumber(getElementData(localPlayer, "Bank:Royal")) exports["fx_blur"]:dxDrawBluredRectangle(0, 0, screenW, screenH, tocolor(255, 255, 255, 255)) dxDrawImage(x*0, y*0, x*1360, y*768,"gfx/ui/bg.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawImage(x*0, y*0, x*1360, y*768,"gfx/ui/bgr.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawText(getPlayerName(localPlayer):gsub("#%x%x%x%x%x%x", ""), x*310, y*158, x*406, y*182, tocolor(0, 0, 0, 127), 1.00, dxfont0_fonte, "left", "top", false, false, false, true, false) dxDrawText("R$ "..money, x*339, y*189, x*426, y*213, tocolor(0, 0, 0, 127), 1.00, dxfont0_fonte, "left", "top", false, false, false, false, false) dxDrawText("R$ "..bankMoney, x*340, y*216, x*427, y*240, tocolor(0, 0, 0, 127), 1.00, dxfont0_fonte, "left", "top", false, false, false, false, false) dxDrawRectangle(x*402, y*564, x*540, y*56, isCursorOnElement(x*502, y*564, x*320, y*56) and tocolor(0, 84, 131, 255) or tocolor(0, 112, 175, 255), false) createEditBox("3", 0.379, 0.443, 0.22, 0.06, true, "", false, 7, "arial", false, 1, {0, 0, 0, 127 }, true, { 0, 0, 0, 55 }, 1, true, 60, true, "Digite o valor", { 0, 0, 0, 127 }, true, 1, "arial", true, true, {0, 0, 0}, false) dxDrawText(" Cancelar", x*619, y*580, x*706, y*441, --[[isCursorOnElement(x*502, y*401, x*320, y*56) and]] tocolor(255, 255, 255, 255)--[[ or tocolor(0, 0, 0, 127)]], 1.00, dxfont1_fonte, "left", "top", false, false, false, false, false) dxDrawRectangle(x*402, y*480, x*540, y*56, isCursorOnElement(x*502, y*480, x*320, y*56) and tocolor(0, 84, 131, 255) or tocolor(0, 112, 175, 255), false) dxDrawText(" Retirar", x*619, y*497, x*706, y*441, --[[isCursorOnElement(x*502, y*401, x*320, y*56) and]] tocolor(255, 255, 255, 255)--[[ or tocolor(0, 0, 0, 127)]], 1.00, dxfont1_fonte, "left", "top", false, false, false, false, false) if getElementData(localPlayer, "Notification") then dxDrawText("[Erro] "..getElementData(localPlayer, "Notification"), x*240, y*680, x*706, y*441, tocolor(255, 0, 0, 255), 1.00, dxfont0_fonte, "left", "top", false, false, false, false, false) end if getElementData(localPlayer, "Notification:S") then dxDrawText("[Sucesso] "..getElementData(localPlayer, "Notification:S"), x*240, y*680, x*706, y*441, tocolor(0, 255, 0, 255), 1.00, dxfont0_fonte, "left", "top", false, false, false, false, false) end end function transUI() local money = convertNumber(getPlayerMoney(localPlayer)) local bankMoney = convertNumber(getElementData(localPlayer, "Bank:Royal")) exports["fx_blur"]:dxDrawBluredRectangle(0, 0, screenW, screenH, tocolor(255, 255, 255, 255)) dxDrawImage(x*0, y*0, x*1360, y*768,"gfx/ui/bg.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawImage(x*0, y*0, x*1360, y*768,"gfx/ui/bgt.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawText(getPlayerName(localPlayer):gsub("#%x%x%x%x%x%x", ""), x*310, y*158, x*406, y*182, tocolor(0, 0, 0, 127), 1.00, dxfont0_fonte, "left", "top", false, false, false, true, false) dxDrawText("R$ "..money, x*339, y*189, x*426, y*213, tocolor(0, 0, 0, 127), 1.00, dxfont0_fonte, "left", "top", false, false, false, false, false) dxDrawText("R$ "..bankMoney, x*340, y*216, x*427, y*240, tocolor(0, 0, 0, 127), 1.00, dxfont0_fonte, "left", "top", false, false, false, false, false) dxDrawRectangle(x*402, y*564, x*540, y*56, isCursorOnElement(x*502, y*564, x*320, y*56) and tocolor(0, 84, 131, 255) or tocolor(0, 112, 175, 255), false) createEditBox("1", 0.379, 0.443, 0.22, 0.06, true, "", false, 7, "arial", false, 1, {0, 0, 0, 127 }, true, { 0, 0, 0, 55 }, 1, true, 60, true, "Digite o valor", { 0, 0, 0, 127 }, true, 1, "arial", true, true, {0, 0, 0}, false) dxDrawText("Transferir", x*619, y*580, x*706, y*441, --[[isCursorOnElement(x*502, y*401, x*320, y*56) and]] tocolor(255, 255, 255, 255)--[[ or tocolor(0, 0, 0, 127)]], 1.00, dxfont1_fonte, "left", "top", false, false, false, false, false) if getElementData(localPlayer, "Notification") then dxDrawText("[Erro] "..getElementData(localPlayer, "Notification"), x*240, y*680, x*706, y*441, tocolor(255, 0, 0, 255), 1.00, dxfont0_fonte, "left", "top", false, false, false, false, false) end if getElementData(localPlayer, "Notification:S") then dxDrawText("[Sucesso] "..getElementData(localPlayer, "Notification:S"), x*240, y*680, x*706, y*441, tocolor(0, 255, 0, 255), 1.00, dxfont0_fonte, "left", "top", false, false, false, false, false) end end function render() local screenx, screeny, worldx, worldy, worldz = getCursorPosition() local px, py, pz = getCameraMatrix() local hit, x, y, z, elementHit = processLineOfSight ( px, py, pz, worldx, worldy, worldz ) local tx, ty, tz = getElementPosition(localPlayer) local rx, ry, rz = getElementPosition(atm1) local rx2, ry2, rz2 = getElementPosition(atm2) local rx3, ry3, rz3 = getElementPosition(atm3) local rx4, ry4, rz4 = getElementPosition(atm4) local rx5, ry5, rz5 = getElementPosition(atm5) local rx6, ry6, rz6 = getElementPosition(atm6) local rx7, ry7, rz7 = getElementPosition(atm7) local rx8, ry8, rz8 = getElementPosition(atm8) local distancia = getDistanceBetweenPoints3D(tx, ty, tz, rx, ry, rz) local distancia2 = getDistanceBetweenPoints3D(tx, ty, tz, rx2, ry2, rz2) local distancia3 = getDistanceBetweenPoints3D(tx, ty, tz, rx3, ry3, rz3) local distancia4 = getDistanceBetweenPoints3D(tx, ty, tz, rx4, ry4, rz4) local distancia5 = getDistanceBetweenPoints3D(tx, ty, tz, rx5, ry5, rz5) local distancia6 = getDistanceBetweenPoints3D(tx, ty, tz, rx6, ry6, rz6) local distancia7 = getDistanceBetweenPoints3D(tx, ty, tz, rx7, ry7, rz7) local distancia8 = getDistanceBetweenPoints3D(tx, ty, tz, rx8, ry8, rz8) if not isEventHandlerAdded("onClientRender", root, caixaUI) then if (distancia <= 1.5) then if not isEventHandlerAdded("onClientRender", root, caixaUI) then if not isEventHandlerAdded("onClientRender", root, depositUI) then if not isEventHandlerAdded("onClientRender", root, sacUI) then if not isEventHandlerAdded("onClientRender", root, transUI) then if not isEventHandlerAdded("onClientRender", root, acessingUI) then if hit then if elementHit == atm1 then addEventHandler("onClientRender", root, acessingUI) setElementFrozen(localPlayer, true) setTimer(function() if not isEventHandlerAdded("onClientRender", root, caixaUI) then addEventHandler("onClientRender", root, caixaUI) end removeEventHandler("onClientRender", root, acessingUI) showCursor(true) setElementFrozen(localPlayer, false) setElementData(localPlayer, "Notification", false) setElementData(localPlayer, "Notification:S", false) showChat(false) end, 2500, 1) end end end end end end end end if (distancia2 <= 1.5) then if not isEventHandlerAdded("onClientRender", root, caixaUI) then if hit then if not isEventHandlerAdded("onClientRender", root, depositUI) then if not isEventHandlerAdded("onClientRender", root, transUI) then if not isEventHandlerAdded("onClientRender", root, acessingUI) then if not isEventHandlerAdded("onClientRender", root, sacUI) then if elementHit == atm2 then addEventHandler("onClientRender", root, acessingUI) setElementFrozen(localPlayer, true) setTimer(function() if not isEventHandlerAdded("onClientRender", root, caixaUI) then addEventHandler("onClientRender", root, caixaUI) end removeEventHandler("onClientRender", root, acessingUI) showCursor(true) setElementFrozen(localPlayer, false) setElementData(localPlayer, "Notification", false) setElementData(localPlayer, "Notification:S", false) showChat(false) end, 2500, 1) end end end end end end end end if (distancia3 <= 1.5) then if not isEventHandlerAdded("onClientRender", root, caixaUI) then if not isEventHandlerAdded("onClientRender", root, depositUI) then if not isEventHandlerAdded("onClientRender", root, transUI) then if not isEventHandlerAdded("onClientRender", root, sacUI) then if not isEventHandlerAdded("onClientRender", root, acessingUI) then if hit then if elementHit == atm3 then addEventHandler("onClientRender", root, acessingUI) setElementFrozen(localPlayer, true) setTimer(function() if not isEventHandlerAdded("onClientRender", root, caixaUI) then addEventHandler("onClientRender", root, caixaUI) end removeEventHandler("onClientRender", root, acessingUI) showCursor(true) setElementFrozen(localPlayer, false) setElementData(localPlayer, "Notification", false) setElementData(localPlayer, "Notification:S", false) showChat(false) end, 2500, 1) end end end end end end end end if (distancia4 <= 1.5) then if not isEventHandlerAdded("onClientRender", root, caixaUI) then if not isEventHandlerAdded("onClientRender", root, depositUI) then if not isEventHandlerAdded("onClientRender", root, transUI) then if not isEventHandlerAdded("onClientRender", root, acessingUI) then if not isEventHandlerAdded("onClientRender", root, sacUI) then if hit then if elementHit == atm4 then addEventHandler("onClientRender", root, acessingUI) setElementFrozen(localPlayer, true) setTimer(function() if not isEventHandlerAdded("onClientRender", root, caixaUI) then addEventHandler("onClientRender", root, caixaUI) end removeEventHandler("onClientRender", root, acessingUI) showCursor(true) setElementFrozen(localPlayer, false) setElementData(localPlayer, "Notification", false) setElementData(localPlayer, "Notification:S", false) showChat(false) end, 2500, 1) end end end end end end end end if (distancia5 <= 1.5) then if not isEventHandlerAdded("onClientRender", root, caixaUI) then if not isEventHandlerAdded("onClientRender", root, depositUI) then if not isEventHandlerAdded("onClientRender", root, transUI) then if not isEventHandlerAdded("onClientRender", root, acessingUI) then if not isEventHandlerAdded("onClientRender", root, sacUI) then if hit then if elementHit == atm5 then addEventHandler("onClientRender", root, acessingUI) setElementFrozen(localPlayer, true) setTimer(function() if not isEventHandlerAdded("onClientRender", root, caixaUI) then addEventHandler("onClientRender", root, caixaUI) end removeEventHandler("onClientRender", root, acessingUI) showCursor(true) setElementFrozen(localPlayer, false) setElementData(localPlayer, "Notification", false) setElementData(localPlayer, "Notification:S", false) showChat(false) end, 2500, 1) end end end end end end end end if (distancia6 <= 1.5) then if not isEventHandlerAdded("onClientRender", root, caixaUI) then if not isEventHandlerAdded("onClientRender", root, depositUI) then if not isEventHandlerAdded("onClientRender", root, transUI) then if not isEventHandlerAdded("onClientRender", root, acessingUI) then if not isEventHandlerAdded("onClientRender", root, sacUI) then if hit then if elementHit == atm6 then addEventHandler("onClientRender", root, acessingUI) setElementFrozen(localPlayer, true) setTimer(function() if not isEventHandlerAdded("onClientRender", root, caixaUI) then addEventHandler("onClientRender", root, caixaUI) end removeEventHandler("onClientRender", root, acessingUI) showCursor(true) setElementFrozen(localPlayer, false) setElementData(localPlayer, "Notification", false) setElementData(localPlayer, "Notification:S", false) showChat(false) end, 2500, 1) end end end end end end end end if (distancia7 <= 1.5) then if not isEventHandlerAdded("onClientRender", root, caixaUI) then if not isEventHandlerAdded("onClientRender", root, depositUI) then if not isEventHandlerAdded("onClientRender", root, transUI) then if not isEventHandlerAdded("onClientRender", root, sacUI) then if not isEventHandlerAdded("onClientRender", root, acessingUI) then if hit then if elementHit == atm7 then addEventHandler("onClientRender", root, acessingUI) setElementFrozen(localPlayer, true) setTimer(function() if not isEventHandlerAdded("onClientRender", root, caixaUI) then addEventHandler("onClientRender", root, caixaUI) end removeEventHandler("onClientRender", root, acessingUI) showCursor(true) setElementFrozen(localPlayer, false) setElementData(localPlayer, "Notification", false) setElementData(localPlayer, "Notification:S", false) showChat(false) end, 2500, 1) end end end end end end end end if (distancia8 <= 1.5) then if not isEventHandlerAdded("onClientRender", root, caixaUI) then if not isEventHandlerAdded("onClientRender", root, depositUI) then if not isEventHandlerAdded("onClientRender", root, transUI) then if not isEventHandlerAdded("onClientRender", root, sacUI) then if not isEventHandlerAdded("onClientRender", root, acessingUI) then if hit then if elementHit == atm8 then addEventHandler("onClientRender", root, acessingUI) setElementFrozen(localPlayer, true) setTimer(function() if not isEventHandlerAdded("onClientRender", root, caixaUI) then addEventHandler("onClientRender", root, caixaUI) end removeEventHandler("onClientRender", root, acessingUI) showCursor(true) setElementFrozen(localPlayer, false) setElementData(localPlayer, "Notification", false) setElementData(localPlayer, "Notification:S", false) showChat(false) end, 2500, 1) end end end end end end end end end end addEventHandler("onClientClick", root, render) local rootElement = getRootElement() local screenWidth, screenHeight = guiGetScreenSize() local maxrange = 20 function dxDrawTextOnElement(TheElement,text,height,distance,R,G,B,alpha,size,font, ...) local x, y, z = getElementPosition(TheElement) local x2, y2, z2 = getCameraMatrix() local distance = distance or 20 local height = height or 1 local value1 = 2 local value2 = 2 if (isLineOfSightClear(x, y, z+2, x2, y2, z2, ...)) then local sx, sy = getScreenFromWorldPosition(x, y, z+height) if(sx) and (sy) then local distanceBetweenPoints = getDistanceBetweenPoints3D(x, y, z, x2, y2, z2) if(distanceBetweenPoints < distance) then dxDrawText(text, sx+value1, sy+value2, sx, sy, tocolor(R or 255, G or 255, B or 255, alpha or 255), (size or 1)-(distanceBetweenPoints / distance), font or "arial", "center", "center", false, false, false, true, false) end end end end function wolrdTexts() dxDrawTextOnElement(bankBot,"Atendente #1066e7(BOT)",1,20,255,255,255,255,1.5,"default") dxDrawTextOnElement(atm1,"Clique para utilizar ",1,20,255,255,255,255,1.5,"default") dxDrawTextOnElement(atm2,"Clique para utilizar ",1,20,255,255,255,255,1.5,"default") dxDrawTextOnElement(atm3,"Clique para utilizar ",1,20,255,255,255,255,1.5,"default") dxDrawTextOnElement(atm4,"Clique para utilizar ",1,20,255,255,255,255,1.5,"default") dxDrawTextOnElement(atm5,"Clique para utilizar ",1,20,255,255,255,255,1.5,"default") dxDrawTextOnElement(atm6,"Clique para utilizar ",1,20,255,255,255,255,1.5,"default") dxDrawTextOnElement(atm7,"Clique para utilizar ",1,20,255,255,255,255,1.5,"default") dxDrawTextOnElement(atm8,"Clique para utilizar ",1,20,255,255,255,255,1.5,"default") end addEventHandler("onClientRender",rootElement, wolrdTexts) function closePanel(_,state) if isEventHandlerAdded("onClientRender", root, caixaUI) then if state == "down" then if isCursorOnElement(x*1068, y*94, x*36, y*38) then showCursor(false) showChat(true) setElementData(localPlayer, "Notification", false) setElementData(localPlayer, "Notification:S", false) playSound("sfx/hit.mp3", false) removeEventHandler("onClientRender", root, caixaUI) end end end if isEventHandlerAdded("onClientRender", root, transUI) then if state == "down" then if isCursorOnElement(x*1068, y*94, x*36, y*38) then showCursor(false) setElementData(localPlayer, "Notification", false) setElementData(localPlayer, "Notification:S", false) showChat(true) playSound("sfx/hit.mp3", false) grid:setVisible(false) removeEventHandler("onClientRender", root, transUI) changeVisibility("1", false) end end end if isEventHandlerAdded("onClientRender", root, depositUI) then if state == "down" then if isCursorOnElement(x*1068, y*94, x*36, y*38) then showCursor(false) showChat(true) playSound("sfx/hit.mp3", false) setElementData(localPlayer, "Notification", false) setElementData(localPlayer, "Notification:S", false) changeVisibility("2", false) removeEventHandler("onClientRender", root, depositUI) end end end if isEventHandlerAdded("onClientRender", root, sacUI) then if state == "down" then if isCursorOnElement(x*1068, y*94, x*36, y*38) then showCursor(false) setElementData(localPlayer, "Notification", false) setElementData(localPlayer, "Notification:S", false) showChat(true) playSound("sfx/hit.mp3", false) removeEventHandler("onClientRender", root, sacUI) changeVisibility("3", false) end end end if isEventHandlerAdded("onClientRender", root, sacUI) then if state == "down" then if isCursorOnElement(x*502, y*564, x*320, y*56) then playSound("sfx/hit.mp3", false) removeEventHandler("onClientRender", root, sacUI) addEventHandler("onClientRender", root, caixaUI) changeVisibility("3", false) end end end if isEventHandlerAdded("onClientRender", root, depositUI) then if state == "down" then if isCursorOnElement(x*502, y*564, x*320, y*56) then playSound("sfx/hit.mp3", false) removeEventHandler("onClientRender", root, depositUI) addEventHandler("onClientRender", root, caixaUI) changeVisibility("2", false) end end end end addEventHandler("onClientClick", root, closePanel) function uiButtons(_,state) if isEventHandlerAdded("onClientRender", root, caixaUI) then if state == "down" then if not isEventHandlerAdded("onClientRender", root, transUI) or isEventHandlerAdded("onClientRender", root, depositUI) or isEventHandlerAdded("onClientRender", root, sacUI) then if isCursorOnElement(x*464, y*366, x*93, y*95) then -- trans playSound("sfx/hit.mp3", false) removeEventHandler("onClientRender", root, caixaUI) addEventHandler("onClientRender", root, transUI) grid:setVisible(true) changeVisibility("1", true) end end if not isEventHandlerAdded("onClientRender", root, depositUI) or isEventHandlerAdded("onClientRender", root, sacUI) or isEventHandlerAdded("onClientRender", root, transUI) then if isCursorOnElement(x*625, y*366, x*93, y*95) then -- deposit playSound("sfx/hit.mp3", false) removeEventHandler("onClientRender", root, caixaUI) addEventHandler("onClientRender", root, depositUI) changeVisibility("2", true) end end if not isEventHandlerAdded("onClientRender", root, sacUI) or isEventHandlerAdded("onClientRender", root, depositUI) or isEventHandlerAdded("onClientRender", root, transUI) then if isCursorOnElement(x*778, y*366, x*93, y*95) then -- sac playSound("sfx/hit.mp3", false) removeEventHandler("onClientRender", root, caixaUI) addEventHandler("onClientRender", root, sacUI) changeVisibility("3", true) end end end end end addEventHandler("onClientClick", root, uiButtons) function depositButton(_,state) if isEventHandlerAdded("onClientRender", root, depositUI) then if state == "down" then if isCursorOnElement(x*502, y*480, x*320, y*56) then if getText("2") then if tonumber(getText("2")) < getPlayerMoney(localPlayer) or tonumber(getText("2")) == getPlayerMoney(localPlayer) then playSound("sfx/hit.mp3", false) addEventHandler("onClientRender", root, caixaUI) changeVisibility("2", false) removeEventHandler("onClientRender", root, depositUI) setElementData(localPlayer, "Bank:Royal", getElementData(localPlayer, "Bank:Royal") + tonumber(getText("2"))) setElementData(localPlayer, "Notification", false) triggerServerEvent("onDepositMoney", localPlayer, localPlayer, tonumber(getText("2"))) setElementData(localPlayer, "Notification:S", "Depósito de R$ "..tonumber(getText("2")).." feito!") setTimer(setElementData, 7000, 1, localPlayer, "Notification:S", false) else playSound("sfx/hit.mp3", false) setElementData(localPlayer, "Notification:S", false) setElementData(localPlayer, "Notification", "Você não possui este valor!") setTimer(setElementData, 7000, 1, localPlayer, "Notification", false) end end end end end end addEventHandler("onClientClick", root, depositButton) function saqueButton(_,state) if isEventHandlerAdded("onClientRender", root, sacUI) then if state == "down" then if isCursorOnElement(x*502, y*480, x*320, y*56) then if getText("3") then if tonumber(getText("3")) == getElementData(localPlayer, "Bank:Royal") or tonumber(getText("3")) < getElementData(localPlayer, "Bank:Royal") then playSound("sfx/hit.mp3", false) addEventHandler("onClientRender", root, caixaUI) removeEventHandler("onClientRender", root, sacUI) changeVisibility("3", false) setElementData(localPlayer, "Bank:Royal", getElementData(localPlayer, "Bank:Royal") - tonumber(getText("3"))) setElementData(localPlayer, "Notification", false) triggerServerEvent("saqueBankMoney", localPlayer, localPlayer, tonumber(getText("3"))) setElementData(localPlayer, "Notification:S", "Retirada de R$ "..tonumber(getText("3")).." feito!") setTimer(setElementData, 7000, 1, localPlayer, "Notification:S", false) else playSound("sfx/hit.mp3", false) setElementData(localPlayer, "Notification:S", false) setElementData(localPlayer, "Notification", "Você não possui este valor!") setTimer(setElementData, 7000, 1, localPlayer, "Notification", false) end end end end end end addEventHandler("onClientClick", root, saqueButton) function transButton(_,state) local gridItem = grid:getSelectedItem() local item = grid:getItemDetails(colum, gridItem) if isEventHandlerAdded("onClientRender", root, transUI) then if state == "down" then if isCursorOnElement(x*502, y*564, x*320, y*56) then -- if getPlayerFromName(item) then if getText("1") then if tonumber(getText("1")) == getElementData(localPlayer, "Bank:Royal") or tonumber(getText("1")) < getElementData(localPlayer, "Bank:Royal") then playSound("sfx/hit.mp3", false) addEventHandler("onClientRender", root, caixaUI) grid:setVisible(false) changeVisibility("1", false) removeEventHandler("onClientRender", root, transUI) setElementData(localPlayer, "Bank:Royal", getElementData(localPlayer, "Bank:Royal") - tonumber(getText("1"))) setElementData(localPlayer, "Notification", false) setElementData(localPlayer, "Notification:S", "Transferência de R$ "..tonumber(getText("1"))..", para "..item.." feito!") setTimer(setElementData, 7000, 1, localPlayer, "Notification:S", false) triggerServerEvent("transMoney", localPlayer, tonumber(getText("1")), item) else playSound("sfx/hit.mp3", false) setElementData(localPlayer, "Notification:S", false) setElementData(localPlayer, "Notification", "Você não possui este valor!") setTimer(setElementData, 7000, 1, localPlayer, "Notification", false) end end --[[else setElementData(localPlayer, "Notification:S", false) setElementData(localPlayer, "Notification", "Jogador não encontrado! Verifique se ocorreu mudança no nome.") setTimer(setElementData, 7000, 1, localPlayer, "Notification", false) end]] end end end end addEventHandler("onClientClick", root, transButton) function isCursorOnElement( posX, posY, width, height ) if isCursorShowing( ) then local mouseX, mouseY = getCursorPosition( ) local clientW, clientH = guiGetScreenSize( ) local mouseX, mouseY = mouseX * clientW, mouseY * clientH if ( mouseX > posX and mouseX < ( posX + width ) and mouseY > posY and mouseY < ( posY + height ) ) then return true end end return false end
-
Olá pessoal. Fiz um vídeo explicando as regras atualizadas do nosso fórum Português, além de como funciona e pra quê serve cada seção. Assistam ao vídeo antes de postar qualquer coisa em nosso fórum, o vídeo também tem algumas dicas pro pessoal que já faz parte da comunidade. Dúvidas, críticas, sugestões deixem nos comentários deste tópico ou então nos comentários do vídeo. Se inscrevam lá pra dar aquela força. Deixe também seu like no vídeo e neste post. Obrigado a todos. Conteúdo do vídeo: 0:53 - Regras e recomendações do fórum 2:01 - As seções do sub-fórum Português: 2:04 - Seção "Tutoriais em geral" 2:25 - Seção "Programação em Lua" * Formatando o Tópico * Criando um bom conteúdo pra mensagem * Conselhos e recomendações gerais * Use o botão <> para postar o seu código com a devida formatação 6:57 - Seção "Mapas Para MTA:SA" 7:09 - Seção "Ajudas relacionadas ao MTA:SA (Cliente/Servidor)" 7:30 - Seção "Servidores para jogar" 7:59 - Seção "Serviços de hospedagem" 8:13 - Seção "Offtopic" 8:28 - Suporte relacionado a banimento em servidores não são aceitos no fórum do MTA * NOTA: Para suporte com Ban global no MTA, seu tópico deve ser postado na seção internacional Ban appeals. APENAS para bans permanentes. Se for temporário, por favor, aguarde até que o ban expire. 8:53 - "Reviver" o tópico 9:18 - Sistema de reputação do fórum 11:03 - Tenha uma boa conduta no fórum 11:16 - Postagens em Português DEVE ser no sub-fórum Portuguese / Português 11:59 - Conselhos para quem ajuda no fórum 12:39 - Boas práticas de programação
-
Eu novamente aqui skkssk, Então meus irmãos, é um script que baixei do site original do mta, muitos devem conhece-l, é o script de danças do fortnite! Mais assim, parece que ele nao esta configurado e eu meio que nao entendo sobre arquivos ifp de dança, o author desse script, colocou um exemplo nele, que quando troca de nick exibe a animação e realmente apaguei os -- e funcionou, eu ate entendi, o script vem com 13 danças, porem nao estou conseguindo configurar! server.lua function setPedFortniteAnimation (ped,animation,tiempo,repetir,mover,interrumpible) if (type(animation) ~= "string" or type(tiempo) ~= "number" or type(repetir) ~= "boolean" or type(mover) ~= "boolean" or type(interrumpible) ~= "boolean") then return false end if isElement(ped) then if animation == "baile 1" or animation == "baile 2" or animation == "baile 3" or animation == "baile 4" or animation == "baile 5" or animation == "baile 6" or animation == "baile 7" or animation == "baile 8" or animation == "baile 9" or animation == "baile 10" or animation == "baile 11" or animation == "baile 12" or animation == "baile 13" then for i = 1,3 do triggerClientEvent ( root, "setPedFortniteAnimation", root, ped,animation,tiempo,repetir,mover,interrumpible ) if tiempo > 1 then setTimer(setPedAnimation,tiempo,1,ped,false) setTimer(setPedAnimation,tiempo+100,1,ped,false) end end end end end --[[ EJEMPLO/EXAMPLE CUANDO CAMBIA EL NICK WHEN NICK IS CHANGED function wasNickChangedByUser(oldNick, newNick, changedByUser) setPedFortniteAnimation(source,"baile 8",7000,true,false,false,false) end addEventHandler("onPlayerChangeNick", getRootElement(), wasNickChangedByUser) -- add an event handler --]] function howtouse ( player, command, dance ) if isElement(player) then exports.fortnitedances:setPedFortniteAnimation(player,"baile "..dance.."",-1,true,false,false,false) end end addCommandHandler ( "dance", howtouse ) client.lua local customIfp = nil function setPedFortniteAnimation (ped,animation,tiempo,repetir,mover,interrumpible) if (type(animation) ~= "string" or type(tiempo) ~= "number" or type(repetir) ~= "boolean" or type(mover) ~= "boolean" or type(interrumpible) ~= "boolean") then return false end if isElement(ped) then if animation == "baile 1" or animation == "baile 2" or animation == "baile 3" or animation == "baile 4" or animation == "baile 5" or animation == "baile 6" or animation == "baile 7" or animation == "baile 8" or animation == "baile 9" or animation == "baile 10" or animation == "baile 11" or animation == "baile 12" or animation == "baile 13" then for i = 1,3 do setPedAnimation(ped, "Fortnite_"..i.."", animation, tiempo, true, false, false) if tiempo > 1 then setTimer(setPedAnimation,tiempo,1,ped,false) setTimer(setPedAnimation,tiempo+100,1,ped,false) end end end end end addEvent("setPedFortniteAnimation",true) addEventHandler("setPedFortniteAnimation",getRootElement(),setPedFortniteAnimation) addEventHandler("onClientResourceStart", resourceRoot, function ( startedRes ) customIfp = engineLoadIFP ("Fortnite pt1.ifp", "Fortnite_1") customIfp2 = engineLoadIFP ("Fortnite pt2.ifp", "Fortnite_2") customIfp3 = engineLoadIFP ("Fortnite pt3.ifp", "Fortnite_3") if customIfp and customIfp2 and customIfp3 then outputDebugString ("Animaciones de Fortnite cargadas") else outputDebugString ("Las animaciones de Fortnite no fueron cargadas") end end ) Vou colocar o meta.xml tambem pra voces verem o export caso possa ser isso tambem meta.xml <meta> <info author="Drex" version="1.1" name="Bailes de Fortnite" type="script" /> <export function="setPedFortniteAnimation" type="shared" /> <file src="Fortnite pt1.ifp" /> <file src="Fortnite pt2.ifp" /> <file src="Fortnite pt3.ifp" /> <script src="client.lua" type="client" cache="false" /> <script src="server.lua" type="sever" cache="false" /> </meta>
-
Já testei várias áreas verdes! E com todas elas consigo atirar do veículo usando o realdriveby ou com qualquer outro script de atirar do veículo! Alguém conhece alguma área verde que bloquear o realdriveby, ou sabe como programar uma para isso ? Também já coloquei o vehicle_fire em todas elas e não consegui.
- 23 replies
-
- area-verde
- safezone
-
(and 12 more)
Tagged with:
-
Olá pessoal, tudo bom ? Coloquei um radar no meu servidor e queria saber como faço para a Area-Verde aparecer nele! Ja tenho as areas verdes criadas! Pórem quero saber como faz para elas aparecerem no radar, pois no radar elas nao aparecem. Agradeço muito se poderem tirar um tempinho pra me ajudar Script do Radar: -------------------------------------------------------------------------------------------------- -- Distributed under the Creative Commons Attribution-NonCommercial 4.0 International license -- -- Version: (release) 1.0.0 -- -- Original author: Kacper "MrTasty (aka Addon)" Stasiak -- -- Special thanks to: Doomed_Space_Marine (useful functions) -- -- robhol (useful functions) -- -------------------------------------------------------------------------------------------------- --Features local enableBlips = true local renderNorthBlip = true local alwaysRenderMap = false --true = always render map, false = only render when in interior world 0 (radar will stay, only the map will stop rendering) local alwaysRenderOxygen = false --true = always render oxygen, false = only when oxygen not full/local player in water local disableGTASAhealth = true --Disable GTASA's HUD health display local disableGTASAarmor = true --Disable GTASA's HUD armour display local disableGTASAoxygen = true --Disable GTASA's HUD oxygen display --Dimensions & Sizes local worldW, worldH = 3072, 3072 --map image dimensions - if map image changed, please edit appropriately local blip = 12 --Blip size, pixels relative to 1366x768 resolution --Colours - Notice: Health colours smoothly according it local player's HP. local healthOkayR, healthOkayG, healthOkayB = 102, 204, 102 --RGB for health which is 'okay' (50% or more) local healthBadR, healthBadG, healthBadB = 200, 200, 0 --RGB for health which is 'bad' (25%) local healthCriticalR, healthCriticalG, healthCriticalB = 200, 0, 0 --RGB for health which is 'critically low' (near/at 0%) local armorColorR, armorColorG, armorColorB = 0, 102, 255 local oxygenColorR, oxygenColorG, oxygenColorB = 255, 255, 0 ------------------------------------------------------------------------------------ --Do not modify anything below unless you're absolutely sure of what you're doing.-- ------------------------------------------------------------------------------------ local sx, sy = guiGetScreenSize() local rt = dxCreateRenderTarget(290, 175) local xFactor, yFactor = sx/1366, sy/768 local yFactor = xFactor --otherwise the radar looses it's 2:3 ratio. -- Useful functions -- function findRotation(x1,y1,x2,y2) --Author: Doomed_Space_Marine & robhol local t = -math.deg(math.atan2(x2-x1,y2-y1)) if t < 0 then t = t + 360 end; return t; end function getPointFromDistanceRotation(x, y, dist, angle) --Author: robhol local a = math.rad(90 - angle); local dx = math.cos(a) * dist; local dy = math.sin(a) * dist; return x+dx, y+dy; end function drawRadar() showPlayerHudComponent("radar", false) if disableGTASAhealth then showPlayerHudComponent("health", false) end if disableGTASAarmor then showPlayerHudComponent("armour", false) end if disableGTASAoxygen then showPlayerHudComponent("breath", false) end if (not isPlayerMapVisible()) then local mW, mH = dxGetMaterialSize(rt) local x, y = getElementPosition(localPlayer) local X, Y = mW/2 -(x/(6000/worldW)), mH/2 +(y/(6000/worldH)) local camX,camY,camZ = getElementRotation(getCamera()) dxSetRenderTarget(rt, true) if alwaysRenderMap or getElementInterior(localPlayer) == 0 then dxDrawRectangle(0, 0, mW, mH, 0xFF7CA7D1) --render background dxDrawImage(X - worldW/2, mH/5 + (Y - worldH/2), worldW, worldH, "image/mapa.jpg", camZ, (x/(6000/worldW)), -(y/(6000/worldH)), tocolor(255, 255, 255, 255)) end dxSetRenderTarget() dxDrawRectangle((10)*xFactor, sy-((200+10))*yFactor, (300)*xFactor, (200)*yFactor, tocolor(0, 0, 0, 175)) dxDrawImage((10+5)*xFactor, sy-((200+5))*yFactor, (300-10)*xFactor, (175)*yFactor, rt, 0, 0, 0, tocolor(255, 255, 255, 150)) local health = math.max(math.min(getElementHealth(localPlayer)/(0.232018558500192*getPedStat(localPlayer, 24) -32.018558511152), 1), 0) local armor = math.max(math.min(getPedArmor(localPlayer)/100, 1), 0) local oxygen = math.max(math.min(getPedOxygenLevel(localPlayer)/(1.5*getPedStat(localPlayer, 225) +1000), 1), 0) local r, g, b if health >= 0.25 then r, g, b = interpolateBetween(healthBadR, healthBadG, healthBadB, healthOkayR, healthOkayG, healthOkayB, math.floor(health*20)/10, "InOutQuad") else r, g, b = interpolateBetween(healthCriticalR, healthCriticalB, healthCriticalB, healthBadR, healthBadG, healthBadB, math.floor(health*20)/10, "InOutQuad") end local col = tocolor(r, g, b, 190) local bg = tocolor(r, g, b, 100) dxDrawRectangle((15)*xFactor, sy-(25)*yFactor, (142.5)*xFactor, (10)*yFactor, bg) dxDrawRectangle((15)*xFactor, sy-(25)*yFactor, (142.5*health)*xFactor, (10)*yFactor, col) if alwaysRenderOxygen or (oxygen < 1 or isElementInWater(localPlayer)) then dxDrawRectangle((162.5)*xFactor, sy-(25)*yFactor, (67.5)*xFactor, (10)*yFactor, tocolor(armorColorR, armorColorG, armorColorB, 100)) dxDrawRectangle((162.5)*xFactor, sy-(25)*yFactor, (67.5*armor)*xFactor, (10)*yFactor, tocolor(armorColorR, armorColorG, armorColorB, 190)) dxDrawRectangle((237.5)*xFactor, sy-(25)*yFactor, (67.5)*xFactor, (10)*yFactor, tocolor(oxygenColorR, oxygenColorG, oxygenColorB, 100)) dxDrawRectangle((237.5)*xFactor, sy-(25)*yFactor, (67.5*oxygen)*xFactor, (10)*yFactor, tocolor(oxygenColorR, oxygenColorG, oxygenColorB, 190)) else dxDrawRectangle((162.5)*xFactor, sy-(25)*yFactor, (142.5)*xFactor, (10)*yFactor, tocolor(armorColorR, armorColorG, armorColorB, 100)) dxDrawRectangle((162.5)*xFactor, sy-(25)*yFactor, (142.5*armor)*xFactor, (10)*yFactor, tocolor(armorColorR, armorColorG, armorColorB, 190)) end local rx, ry, rz = getElementRotation(localPlayer) local lB = (15)*xFactor local rB = (15+290)*xFactor local tB = sy-(205)*yFactor local bB = tB + (175)*yFactor local cX, cY = (rB+lB)/2, (tB+bB)/2 +(35)*yFactor local toLeft, toTop, toRight, toBottom = cX-lB, cY-tB, rB-cX, bB-cY for k, v in ipairs(getElementsByType("blip")) do local bx, by = getElementPosition(v) local actualDist = getDistanceBetweenPoints2D(x, y, bx, by) local maxDist = getBlipVisibleDistance(v) if actualDist <= maxDist and getElementDimension(v)==getElementDimension(localPlayer) and getElementInterior(v)==getElementInterior(localPlayer) then local dist = actualDist/(6000/((worldW+worldH)/2)) local rot = findRotation(bx, by, x, y)-camZ local bpx, bpy = getPointFromDistanceRotation(cX, cY, math.min(dist, math.sqrt(toTop^2 + toRight^2)), rot) local bpx = math.max(lB, math.min(rB, bpx)) local bpy = math.max(tB, math.min(bB, bpy)) local bid = getElementData(v, "customIcon") or getBlipIcon(v) local _, _, _, bcA = getBlipColor(v) local bcR, bcG, bcB = 255, 255, 255 if getBlipIcon(v) == 0 then bcR, bcG, bcB = getBlipColor(v) end local bS = getBlipSize(v) dxDrawImage(bpx -(blip*bS)*xFactor/2, bpy -(blip*bS)*yFactor/2, (blip*bS)*xFactor, (blip*bS)*yFactor, "image/blip/"..bid..".png", 0, 0, 0, tocolor(bcR, bcG, bcB, bcA)) end end if renderNorthBlip then local rot = -camZ+180 local bpx, bpy = getPointFromDistanceRotation(cX, cY, math.sqrt(toTop^2 + toRight^2), rot) --get position local bpx = math.max(lB, math.min(rB, bpx)) local bpy = math.max(tB, math.min(bB, bpy)) --cap position to screen local dist = getDistanceBetweenPoints2D(cX, cY, bpx, bpy) --get distance to the capped position local bpx, bpy = getPointFromDistanceRotation(cX, cY, dist, rot) --re-calculate position based on new distance if bpx and bpy then --if position was obtained successfully local bpx = math.max(lB, math.min(rB, bpx)) local bpy = math.max(tB, math.min(bB, bpy)) --cap position just in case dxDrawImage(bpx -(blip*2)/2, bpy -(blip*2)/2, blip*2, blip*2, "image/blip/4.png", 0, 0, 0) --draw north (4) blip end end dxDrawImage(cX -(blip*2)*xFactor/2, cY -(blip*2)*yFactor/2, (blip*2)*xFactor, (blip*2)*yFactor, "image/player.png", camZ-rz, 0, 0) end end addEventHandler("onClientRender", root, drawRadar) addEventHandler("onClientResourceStop", resourceRoot, function() showPlayerHudComponent("radar", true) if disableGTASAhealth then showPlayerHudComponent("health", true) end if disableGTASAarmor then showPlayerHudComponent("armour", true) end if disableGTASAoxygen then showPlayerHudComponent("breath", true) end end)
-
Preciso de uma Verificação para Somente o dono do veículo poder entrar na direção do veículo. De preferência por setelementdata, alguem pode me ajudar?? Tentei assim Quando criar ----- VeiculoPainel[source] = createVehicle... setElementData ( VeiculoPainel[source], "Dono", ""..accname.."" ) setElementData ( source, "Dono", ""..accname.."" ) Quando for entrar ----- Jogador = getElementData( source, "Dono" ) Veículo = getElementData( VeiculoPainel[source], "Dono" ) If Jogador == Dono then --Nada, apenas entrar no veículo normal else cancelEvent () Tentei dessa forma, sei que está meio incompleto mais poderiam me ajudar a fazer isso? Meu objetivo e fazer apenas o dono do veículo poder dirigir o carro, e caso o carro não tiver setElementData qualquer um pode entrar no volante, me ajudem.