Cristtk

Members
  • Content Count

    8
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Cristtk

  • Rank
    Newbie

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Fiz o que foi informado e não deu certo, creio eu que o problema tambem esta aqui: 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, "char.bankMoney", getElementData(localPlayer, "char.bankMoney") + 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, "char.bankMoney") or tonumber(getText("3")) < getElementData(localPlayer, "char.bankMoney") then playSound("sfx/hit.mp3", false) addEventHandler("onClientRender", root, caixaUI) removeEventHandler("onClientRender", root, sacUI) changeVisibility("3", false) setElementData(localPlayer, "char.bankMoney", getElementData(localPlayer, "char.bankMoney") - 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, "char.bankMoney") or tonumber(getText("1")) < getElementData(localPlayer, "char.bankMoney") then playSound("sfx/hit.mp3", false) addEventHandler("onClientRender", root, caixaUI) grid:setVisible(false) changeVisibility("1", false) removeEventHandler("onClientRender", root, transUI) setElementData(localPlayer, "char.bankMoney", getElementData(localPlayer, "char.bankMoney") - 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)
  2. Ola baixei um sistema de banco que realiza saques, deposito e transferências de dinheiro. No servidor local ele funciona, mas numa host não funciona. O sistema de Hud da host utiliza os seguinte valores para sistemas de banco, a host utiliza banco de dados MYSQL. E o sitema de banco baixado utiliza o banco de dados padrão do MTA. "char.money" "char.bankMoney" o sistema de banco baixado utiliza esse valor. local money = convertNumber(getPlayerMoney(localPlayer)) local bankMoney = convertNumber(getElementData(localPlayer, "Bank:Royal")) Quando eu substituo o "Bank:Royal" por "char.bankMoney" mostra o valor que se tem no banco mas não mostra o valor que se tem em mãos. Alguem poderia me ajudar? Segui o script do sistema de banco abaixo: 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
  3. Certo o marker ja apareceu. Poderia me tirar mais uma duvida? Se sim, como faço pra colocar esse emprego numa agencia de empregos onde o jogador seleciona la e pega o emprego. Normamelte tem qe substituir algumas coisas no script de trabalho pra funcionar. local Emprego = getElementData ( source, "PH->Emprego->Empregado" ) if Emprego == "Lixeiro" or getElementData ( source, "char.factionID") == 999 then Os empregos que funciona com a agencia de empregos tem essa linha de código ai. Onde substituo esses dados no primeiro script enviado no começo do tópico?
  4. Ok,desculpe sou novo no forum e não sabia. Segui abaixo o script client e serve. Cliente.Lua local Marker_Emprego = createMarker ( -47.427, -1124.002, +6 0.078 -1, "cylinder", 1.5, 16, 111, 231, 50) local Blip_Emprego = createBlipAttachedTo( Marker_Emprego, 11 ) trashN = 1 location = nil local Trashesloc1 = { {199.635, -1384.151, 48.288}, {264.545, -1332.778, 52.842}, {284.777, -1320.584, 53.423}, {350.070, -1278.352, 53.538}, {402.468, -1255.487, 51.732}, {415.234, -1249.662, 51.103}, {543.424, -1200.640, 44.006}, {619.909, -1103.393, 46.252}, {659.012, -1063.778, 48.493}, {677.497, -1069.036, 48.712}, } local Trashesloc2 = { {2480.138, -1249.071, 28.771}, {2496.499, -1248.516, 33.210}, {2514.310, -1247.950, 34.621}, {2536.332, -1249.731, 38.633}, {2555.955, -1249.126, 44.265}, {2577.977, -1238.393, 47.431}, {2577.170, -1225.518, 51.642}, {2577.210, -1208.793, 57.449}, {2561.283, -1193.017, 61.353}, {2526.050, -1194.894, 56.032}, } local Trashesloc3 = { {643.592, -1714.940, 13.869}, {645.801, -1696.937, 14.429}, {648.737, -1657.511, 14.436}, {647.174, -1623.309, 14.627}, {674.267, -1594.801, 13.726}, {686.016, -1596.271, 13.664}, {759.969, -1600.941, 13.008}, {760.309, -1652.133, 4.426}, {762.769, -1696.082, 4.356}, {763.332, -1748.384, 12.215}, } local Trashesloc4 = { {1908.960, -2042.664, 13.099}, {1891.471, -2038.851, 13.107}, {1892.379, -2030.646, 13.107}, {1891.180, -2022.357, 13.099}, {1883.950, -2014.897, 13.107}, {1873.925, -2019.302, 13.107}, {1874.098, -2033.219, 13.107}, {1873.440, -2061.300, 13.107}, {1894.631, -2061.908, 13.107}, {1915.491, -2061.279, 13.107}, } local Trashesloc5 = { {2261.917, -1477.939, 22.529}, {2247.724, -1476.463, 22.945}, {2229.568, -1475.667, 23.416}, {2205.066, -1464.564, 23.544}, {2204.570, -1449.708, 23.544}, {2204.010, -1433.032, 23.544}, {2203.836, -1408.913, 23.544}, {2169.046, -1393.510, 23.544}, {2138.537, -1409.911, 23.546}, {2138.457, -1439.989, 23.542}, } local ctrls ={ "sprint", "jump", "enter_exit", "enter_passenger", "fire", "crouch", "aim_weapon", "next_weapon", "previous_weapon", } function randomt() local Table = math.random(1,5) if Table == 1 then return Trashesloc1 elseif Table == 2 then return Trashesloc2 elseif Table == 3 then return Trashesloc3 elseif Table == 4 then return Trashesloc4 elseif Table == 5 then return Trashesloc5 end end addEvent("GTITrashCollector.onWasteEnter", true) addEventHandler("GTITrashCollector.onWasteEnter", root, function() if (exports.GTIemployment:getPlayerJob(true) == "Lixeiro") and not (isElement(theTrash)) then if location == nil then newMission() end end end ) function Mission() if trashN < 10 then local x1, y1, z1 = unpack(location[trashN+1]) takeTrashmarker = createColSphere ( x1, y1, z1, 1.5 ) triggerServerEvent("GTITrashCollector.freeze", resourceRoot, false) blip = createBlipAttachedTo(takeTrashmarker, 0, 1.5, 51, 204, 0) theTrash = createObject(1264,x1,y1,z1) setElementCollisionsEnabled(theTrash,false) attachElements(takeTrashmarker,theTrash,0,0,0,0,0,0) theArrow = createMarker ( x1, y1, z1, "arrow", 1, 51, 204, 0, 170 ) attachElements(theArrow,theTrash,0,0,1.3,0,0,0) else if not isElement(paymarker) and not isTimer(paytimer) then triggerServerEvent("GTITrashCollector.freeze", resourceRoot, false) exports.GTIhud:dm("Return to the dump to get paid.", 255, 255, 0) paymarker = createMarker (-47.427, -1124.002, 0.078, "cylinder", 4, 255, 255, 0, 170 ) payblip = createBlipAttachedTo(paymarker,41) end end end function newMission() if (getElementModel(getPedOccupiedVehicle(localPlayer)) == 408) then location = randomt() local x1, y1, z1 = unpack(location[trashN+1]) local loca = getZoneName(x1,y1,z1) exports.GTIhud:dm("You've been requested to pick up rubbish in "..loca, 255, 255, 0) takeTrashmarker = createColSphere ( x1, y1, z1, 1 ) blip = createBlipAttachedTo(takeTrashmarker, 0, 3.5, 51, 204, 0) theTrash = createObject(1264,x1,y1,z1) setElementCollisionsEnabled(theTrash,false) attachElements(takeTrashmarker,theTrash,0,0,0,0,0,0) theArrow = createMarker ( x1, y1, z1, "arrow", 1, 51, 204, 0, 170 ) attachElements(theArrow,theTrash,0,0,1.3,0,0,0) end end addEvent("GTITrashCollector.createmarker", true) addEventHandler("GTITrashCollector.createmarker", root, function(SX,SY,SZ,theVeh) if isElement(theTrash) then local dist = exports.GTIutil:getDistanceBetweenElements3D(localPlayer,theTrash) if ( dist < 40 ) and not (isElement(trashmarker))then trashmarker = createMarker (SX, SY, SZ, "cylinder", 1, 51, 204, 0, 170 ) attachElements(trashmarker,theVeh,0,-5,-1.5,1,0,0) end end end ) function takeTheTrash(theElement) if ( source == takeTrashmarker ) and ( theElement == localPlayer ) and ( isElement ( theTrash ) ) and not ( isPedInVehicle(localPlayer) ) and not ( doesPedHaveJetPack(localPlayer) ) then destroyElement(takeTrashmarker) destroyElement(blip) destroyElement(theArrow) triggerServerEvent("GTITrashCollector.freeze", resourceRoot, true) for i,v in ipairs(ctrls) do toggleControl(v, false) end setPedWeaponSlot(localPlayer,0) triggerServerEvent("GTITrashCollector.anim", resourceRoot,2) timer5 = setTimer(function() exports.bone_attach:attachElementToBone(theTrash,localPlayer,12,0.3,0.53,0.2,0,0,0) triggerServerEvent("GTITrashCollector.anim", resourceRoot,1) end, 700,1) triggerServerEvent("GTITrashCollector.marker", resourceRoot) end end addEventHandler ( "onClientColShapeHit", root, takeTheTrash) function throwing(thePlayer) if ( source == trashmarker ) and ( thePlayer == localPlayer) and (isElement(theTrash)) and ( exports.bone_attach:isElementAttachedToBone(theTrash) == true ) then triggerServerEvent("GTITrashCollector.anim", resourceRoot,3) for i,v in ipairs(ctrls) do toggleControl(v, true) end destroyElement(trashmarker) timer2 = setTimer(function() exports.bone_attach:detachElementFromBone(theTrash) local origX, origY, origZ = getElementPosition ( theTrash ) local newZ = origZ + 3 moveObject ( theTrash, 750, origX, origY, newZ ) end,550,1) timer1 = setTimer(function() playSFX("genrl", 32, 10, false) destroyElement(theTrash) trashN = trashN + 1 exports.GTIhud:drawStat("TrashID", "Trash Bags", trashN.."/10", 255, 200, 0) Mission() end,1000,1) end end addEventHandler("onClientMarkerHit",getRootElement(),throwing) function pay(thePlayer) if ( source == paymarker ) and ( thePlayer == localPlayer) and isPedInVehicle(localPlayer) and trashN == 10 and not isTimer(paytimer) then local theVehicle = getPedOccupiedVehicle(thePlayer) if getElementModel( theVehicle ) == 408 then destroyElement(payblip) destroyElement(paymarker) toggleControl("enter_exit",false) exports.GTIhud:drawProgressBar("TrashPro", "Unloading...", 255, 200, 0, 10000) setElementFrozen(theVehicle,true) unloadsound = playSFX("genrl", 76, 0, true) paytimer = setTimer(function() toggleControl("enter_exit",true) stopSound(unloadsound) triggerServerEvent("GTITrashCollector.pay", resourceRoot) playSFX("genrl", 77, 2, false) setElementFrozen(theVehicle,false) trashN = 0 exports.GTIhud:drawStat("TrashID", "Trash Bags", trashN.."/10", 255, 200, 0) newMission() end,10000,1) end end end addEventHandler("onClientMarkerHit",getRootElement(),pay) function onTakeJob( job ) if ( job == "Lixeiro" ) then exports.GTIhud:drawStat("TrashID", "Trash Bags", trashN.."/10", 255, 200, 0) end end addEventHandler ("onClientPlayerGetJob", localPlayer, onTakeJob) function delelem() if (exports.GTIemployment:getPlayerJob(true) == "Lixeiro") then trashN = 0 location = nil if isElement(trashmarker) then destroyElement(trashmarker) end if isElement(takeTrashmarker) then destroyElement(takeTrashmarker) end if isTimer(timer1) then killTimer(timer1) end if isTimer(timer2) then killTimer(timer2) end if isTimer(timer3) then killTimer(timer3) end if isTimer(timer4) then killTimer(timer4) end if isTimer(paytimer) then killTimer(paytimer) end if isTimer(timer5) then killTimer(timer5) end if isElement(theArrow) then destroyElement(theArrow) end if isElement(unloadsound) then stopSound(unloadsound) end if isElement(theTrash) then destroyElement(theTrash) end if isElement(blip) then destroyElement(blip) end if isElement(payblip) then destroyElement(payblip) end if isElement(paymarker) then destroyElement(paymarker) end toggleAllControls(true) setPedAnimation(localPlayer,false) exports.GTIhud:drawStat("TrashID", "Trash Bags", trashN.."/10", 255, 200, 0) end end addEvent( "onClientRentalVehicleHide",true) addEventHandler ("onClientPlayerWasted", localPlayer, delelem) addEventHandler ("onClientRentalVehicleHide", root, delelem) function onJobQuit(job) if ( job == "Lixeiro" ) then trashN = 0 location = nil if isElement(trashmarker) then destroyElement(trashmarker) end if isElement(takeTrashmarker) then destroyElement(takeTrashmarker) end if isTimer(timer1) then killTimer(timer1) end if isTimer(timer2) then killTimer(timer2) end if isTimer(timer3) then killTimer(timer3) end if isTimer(timer4) then killTimer(timer4) end if isTimer(timer5) then killTimer(timer5) end if isTimer(paytimer) then killTimer(paytimer) end if isElement(theArrow) then destroyElement(theArrow) end if isElement(unloadsound) then stopSound(unloadsound) end if isElement(theTrash) then destroyElement(theTrash) end if isElement(blip) then destroyElement(blip) end if isElement(payblip) then destroyElement(payblip) end if isElement(paymarker) then destroyElement(paymarker) end setPedAnimation(localPlayer,false) toggleAllControls(true) exports.GTIhud:drawStat("TrashID", "", "", 255, 200, 0) end end addEventHandler ("onClientPlayerQuitJob", localPlayer, onJobQuit) Serve.Lua addEvent("GTITrashCollector.marker", true) addEventHandler("GTITrashCollector.marker", root, function() local theVeh = exports.GTIrentals:getPlayerRentalVehicle(client) if ( isElement(theVeh) ) and ( getElementModel(theVeh) == 408 ) then local SX,SY,SZ = getElementPosition(theVeh) triggerClientEvent ( client, "GTITrashCollector.createmarker", resourceRoot, SX, SY, SZ, theVeh ) end end ) addEvent("GTITrashCollector.pay", true) addEventHandler("GTITrashCollector.pay", root, function() local pay = exports.GTIemployment:getPlayerJobPayment(client, "Trash Collector") local hrPay = exports.GTIemployment:getPlayerHourlyPay(client) local hrExp = exports.GTIemployment:getHourlyExperience() local pay = math.ceil( pay*10 ) local Exp = math.ceil( (pay/hrPay)*hrExp ) local pay = math.ceil( math.random(pay*0.8, pay*1.2) ) exports.GTIemployment:modifyPlayerJobProgress(client, "Trash Collector", 10) exports.GTIemployment:modifyPlayerEmploymentExp(client, Exp, "Trash Collector") exports.GTIemployment:givePlayerJobMoney(client, "Trash Collector", pay) end) function trashEnter ( thePlayer, seat, jacked ) if isElement(source) and ( getElementModel ( source ) == 408 ) and (exports.GTIrentals:getPlayerRentalVehicle(thePlayer) == source) and (seat == 0) and (exports.GTIemployment:getPlayerJob(thePlayer,true) == "Trash Collector") then triggerClientEvent ( thePlayer, "GTITrashCollector.onWasteEnter", resourceRoot ) end end addEventHandler ( "onVehicleEnter", getRootElement(), trashEnter ) addEvent("GTITrashCollector.freeze", true) addEventHandler("GTITrashCollector.freeze", root, function(fre) local theveh = exports.GTIrentals:getPlayerRentalVehicle(client) if fre == false then setElementFrozen(theveh,false) elseif fre == true then setElementFrozen(theveh,true) end end ) addEvent("GTITrashCollector.anim", true) addEventHandler("GTITrashCollector.anim", root, function(anim) if anim == 1 then exports.GTIanims:setJobAnimation(client, "CARRY", "crry_prtial", 50, false, true, false, false) exports.GTIanims:setJobAnimation(client, "CARRY", "crry_prtial", 50, false, true, false, true) elseif anim == 2 then exports.GTIanims:setJobAnimation(client, "CARRY", "liftup", 1000, true, false, false, false) elseif anim == 3 then exports.GTIanims:setJobAnimation(client, "GRENADE", "WEAPON_throwu", 500, true, false, false, false) end end ) Aparece esse erro +' ERROR: Loading script failed: GTItrashCollector\TrashCollectorClient.Lua:1:unexpected symbol near ' +'
  5. Ola, baixei um script de trabalhos para mta, o script é aberto e o dono que disponibilizou para quem quiser usar. To tendo um problema, o script ativa mas nada funciona. To estudando o script, ai queria saber se tem alguma forma de resolver o problema de ativar o script e nada funcionar. Esse é o código: Cliente.Lua local Marker_Emprego = createMarker ( -47.427, -1124.002, +6 0.078 -1, "cylinder", 1.5, 16, 111, 231, 50) local Blip_Emprego = createBlipAttachedTo( Marker_Emprego, 11 ) trashN = 1 location = nil local Trashesloc1 = { {199.635, -1384.151, 48.288}, {264.545, -1332.778, 52.842}, {284.777, -1320.584, 53.423}, {350.070, -1278.352, 53.538}, {402.468, -1255.487, 51.732}, {415.234, -1249.662, 51.103}, {543.424, -1200.640, 44.006}, {619.909, -1103.393, 46.252}, {659.012, -1063.778, 48.493}, {677.497, -1069.036, 48.712}, } local Trashesloc2 = { {2480.138, -1249.071, 28.771}, {2496.499, -1248.516, 33.210}, {2514.310, -1247.950, 34.621}, {2536.332, -1249.731, 38.633}, {2555.955, -1249.126, 44.265}, {2577.977, -1238.393, 47.431}, {2577.170, -1225.518, 51.642}, {2577.210, -1208.793, 57.449}, {2561.283, -1193.017, 61.353}, {2526.050, -1194.894, 56.032}, } local Trashesloc3 = { {643.592, -1714.940, 13.869}, {645.801, -1696.937, 14.429}, {648.737, -1657.511, 14.436}, {647.174, -1623.309, 14.627}, {674.267, -1594.801, 13.726}, {686.016, -1596.271, 13.664}, {759.969, -1600.941, 13.008}, {760.309, -1652.133, 4.426}, {762.769, -1696.082, 4.356}, {763.332, -1748.384, 12.215}, } local Trashesloc4 = { {1908.960, -2042.664, 13.099}, {1891.471, -2038.851, 13.107}, {1892.379, -2030.646, 13.107}, {1891.180, -2022.357, 13.099}, {1883.950, -2014.897, 13.107}, {1873.925, -2019.302, 13.107}, {1874.098, -2033.219, 13.107}, {1873.440, -2061.300, 13.107}, {1894.631, -2061.908, 13.107}, {1915.491, -2061.279, 13.107}, } local Trashesloc5 = { {2261.917, -1477.939, 22.529}, {2247.724, -1476.463, 22.945}, {2229.568, -1475.667, 23.416}, {2205.066, -1464.564, 23.544}, {2204.570, -1449.708, 23.544}, {2204.010, -1433.032, 23.544}, {2203.836, -1408.913, 23.544}, {2169.046, -1393.510, 23.544}, {2138.537, -1409.911, 23.546}, {2138.457, -1439.989, 23.542}, } local ctrls ={ "sprint", "jump", "enter_exit", "enter_passenger", "fire", "crouch", "aim_weapon", "next_weapon", "previous_weapon", } function randomt() local Table = math.random(1,5) if Table == 1 then return Trashesloc1 elseif Table == 2 then return Trashesloc2 elseif Table == 3 then return Trashesloc3 elseif Table == 4 then return Trashesloc4 elseif Table == 5 then return Trashesloc5 end end addEvent("GTITrashCollector.onWasteEnter", true) addEventHandler("GTITrashCollector.onWasteEnter", root, function() if (exports.GTIemployment:getPlayerJob(true) == "Lixeiro") and not (isElement(theTrash)) then if location == nil then newMission() end end end ) function Mission() if trashN < 10 then local x1, y1, z1 = unpack(location[trashN+1]) takeTrashmarker = createColSphere ( x1, y1, z1, 1.5 ) triggerServerEvent("GTITrashCollector.freeze", resourceRoot, false) blip = createBlipAttachedTo(takeTrashmarker, 0, 1.5, 51, 204, 0) theTrash = createObject(1264,x1,y1,z1) setElementCollisionsEnabled(theTrash,false) attachElements(takeTrashmarker,theTrash,0,0,0,0,0,0) theArrow = createMarker ( x1, y1, z1, "arrow", 1, 51, 204, 0, 170 ) attachElements(theArrow,theTrash,0,0,1.3,0,0,0) else if not isElement(paymarker) and not isTimer(paytimer) then triggerServerEvent("GTITrashCollector.freeze", resourceRoot, false) exports.GTIhud:dm("Return to the dump to get paid.", 255, 255, 0) paymarker = createMarker (-47.427, -1124.002, 0.078, "cylinder", 4, 255, 255, 0, 170 ) payblip = createBlipAttachedTo(paymarker,41) end end end function newMission() if (getElementModel(getPedOccupiedVehicle(localPlayer)) == 408) then location = randomt() local x1, y1, z1 = unpack(location[trashN+1]) local loca = getZoneName(x1,y1,z1) exports.GTIhud:dm("You've been requested to pick up rubbish in "..loca, 255, 255, 0) takeTrashmarker = createColSphere ( x1, y1, z1, 1 ) blip = createBlipAttachedTo(takeTrashmarker, 0, 3.5, 51, 204, 0) theTrash = createObject(1264,x1,y1,z1) setElementCollisionsEnabled(theTrash,false) attachElements(takeTrashmarker,theTrash,0,0,0,0,0,0) theArrow = createMarker ( x1, y1, z1, "arrow", 1, 51, 204, 0, 170 ) attachElements(theArrow,theTrash,0,0,1.3,0,0,0) end end addEvent("GTITrashCollector.createmarker", true) addEventHandler("GTITrashCollector.createmarker", root, function(SX,SY,SZ,theVeh) if isElement(theTrash) then local dist = exports.GTIutil:getDistanceBetweenElements3D(localPlayer,theTrash) if ( dist < 40 ) and not (isElement(trashmarker))then trashmarker = createMarker (SX, SY, SZ, "cylinder", 1, 51, 204, 0, 170 ) attachElements(trashmarker,theVeh,0,-5,-1.5,1,0,0) end end end ) function takeTheTrash(theElement) if ( source == takeTrashmarker ) and ( theElement == localPlayer ) and ( isElement ( theTrash ) ) and not ( isPedInVehicle(localPlayer) ) and not ( doesPedHaveJetPack(localPlayer) ) then destroyElement(takeTrashmarker) destroyElement(blip) destroyElement(theArrow) triggerServerEvent("GTITrashCollector.freeze", resourceRoot, true) for i,v in ipairs(ctrls) do toggleControl(v, false) end setPedWeaponSlot(localPlayer,0) triggerServerEvent("GTITrashCollector.anim", resourceRoot,2) timer5 = setTimer(function() exports.bone_attach:attachElementToBone(theTrash,localPlayer,12,0.3,0.53,0.2,0,0,0) triggerServerEvent("GTITrashCollector.anim", resourceRoot,1) end, 700,1) triggerServerEvent("GTITrashCollector.marker", resourceRoot) end end addEventHandler ( "onClientColShapeHit", root, takeTheTrash) function throwing(thePlayer) if ( source == trashmarker ) and ( thePlayer == localPlayer) and (isElement(theTrash)) and ( exports.bone_attach:isElementAttachedToBone(theTrash) == true ) then triggerServerEvent("GTITrashCollector.anim", resourceRoot,3) for i,v in ipairs(ctrls) do toggleControl(v, true) end destroyElement(trashmarker) timer2 = setTimer(function() exports.bone_attach:detachElementFromBone(theTrash) local origX, origY, origZ = getElementPosition ( theTrash ) local newZ = origZ + 3 moveObject ( theTrash, 750, origX, origY, newZ ) end,550,1) timer1 = setTimer(function() playSFX("genrl", 32, 10, false) destroyElement(theTrash) trashN = trashN + 1 exports.GTIhud:drawStat("TrashID", "Trash Bags", trashN.."/10", 255, 200, 0) Mission() end,1000,1) end end addEventHandler("onClientMarkerHit",getRootElement(),throwing) function pay(thePlayer) if ( source == paymarker ) and ( thePlayer == localPlayer) and isPedInVehicle(localPlayer) and trashN == 10 and not isTimer(paytimer) then local theVehicle = getPedOccupiedVehicle(thePlayer) if getElementModel( theVehicle ) == 408 then destroyElement(payblip) destroyElement(paymarker) toggleControl("enter_exit",false) exports.GTIhud:drawProgressBar("TrashPro", "Unloading...", 255, 200, 0, 10000) setElementFrozen(theVehicle,true) unloadsound = playSFX("genrl", 76, 0, true) paytimer = setTimer(function() toggleControl("enter_exit",true) stopSound(unloadsound) triggerServerEvent("GTITrashCollector.pay", resourceRoot) playSFX("genrl", 77, 2, false) setElementFrozen(theVehicle,false) trashN = 0 exports.GTIhud:drawStat("TrashID", "Trash Bags", trashN.."/10", 255, 200, 0) newMission() end,10000,1) end end end addEventHandler("onClientMarkerHit",getRootElement(),pay) function onTakeJob( job ) if ( job == "Lixeiro" ) then exports.GTIhud:drawStat("TrashID", "Trash Bags", trashN.."/10", 255, 200, 0) end end addEventHandler ("onClientPlayerGetJob", localPlayer, onTakeJob) function delelem() if (exports.GTIemployment:getPlayerJob(true) == "Lixeiro") then trashN = 0 location = nil if isElement(trashmarker) then destroyElement(trashmarker) end if isElement(takeTrashmarker) then destroyElement(takeTrashmarker) end if isTimer(timer1) then killTimer(timer1) end if isTimer(timer2) then killTimer(timer2) end if isTimer(timer3) then killTimer(timer3) end if isTimer(timer4) then killTimer(timer4) end if isTimer(paytimer) then killTimer(paytimer) end if isTimer(timer5) then killTimer(timer5) end if isElement(theArrow) then destroyElement(theArrow) end if isElement(unloadsound) then stopSound(unloadsound) end if isElement(theTrash) then destroyElement(theTrash) end if isElement(blip) then destroyElement(blip) end if isElement(payblip) then destroyElement(payblip) end if isElement(paymarker) then destroyElement(paymarker) end toggleAllControls(true) setPedAnimation(localPlayer,false) exports.GTIhud:drawStat("TrashID", "Trash Bags", trashN.."/10", 255, 200, 0) end end addEvent( "onClientRentalVehicleHide",true) addEventHandler ("onClientPlayerWasted", localPlayer, delelem) addEventHandler ("onClientRentalVehicleHide", root, delelem) function onJobQuit(job) if ( job == "Lixeiro" ) then trashN = 0 location = nil if isElement(trashmarker) then destroyElement(trashmarker) end if isElement(takeTrashmarker) then destroyElement(takeTrashmarker) end if isTimer(timer1) then killTimer(timer1) end if isTimer(timer2) then killTimer(timer2) end if isTimer(timer3) then killTimer(timer3) end if isTimer(timer4) then killTimer(timer4) end if isTimer(timer5) then killTimer(timer5) end if isTimer(paytimer) then killTimer(paytimer) end if isElement(theArrow) then destroyElement(theArrow) end if isElement(unloadsound) then stopSound(unloadsound) end if isElement(theTrash) then destroyElement(theTrash) end if isElement(blip) then destroyElement(blip) end if isElement(payblip) then destroyElement(payblip) end if isElement(paymarker) then destroyElement(paymarker) end setPedAnimation(localPlayer,false) toggleAllControls(true) exports.GTIhud:drawStat("TrashID", "", "", 255, 200, 0) end end addEventHandler ("onClientPlayerQuitJob", localPlayer, onJobQuit) Serve.Lua addEvent("GTITrashCollector.marker", true) addEventHandler("GTITrashCollector.marker", root, function() local theVeh = exports.GTIrentals:getPlayerRentalVehicle(client) if ( isElement(theVeh) ) and ( getElementModel(theVeh) == 408 ) then local SX,SY,SZ = getElementPosition(theVeh) triggerClientEvent ( client, "GTITrashCollector.createmarker", resourceRoot, SX, SY, SZ, theVeh ) end end ) addEvent("GTITrashCollector.pay", true) addEventHandler("GTITrashCollector.pay", root, function() local pay = exports.GTIemployment:getPlayerJobPayment(client, "Trash Collector") local hrPay = exports.GTIemployment:getPlayerHourlyPay(client) local hrExp = exports.GTIemployment:getHourlyExperience() local pay = math.ceil( pay*10 ) local Exp = math.ceil( (pay/hrPay)*hrExp ) local pay = math.ceil( math.random(pay*0.8, pay*1.2) ) exports.GTIemployment:modifyPlayerJobProgress(client, "Trash Collector", 10) exports.GTIemployment:modifyPlayerEmploymentExp(client, Exp, "Trash Collector") exports.GTIemployment:givePlayerJobMoney(client, "Trash Collector", pay) end) function trashEnter ( thePlayer, seat, jacked ) if isElement(source) and ( getElementModel ( source ) == 408 ) and (exports.GTIrentals:getPlayerRentalVehicle(thePlayer) == source) and (seat == 0) and (exports.GTIemployment:getPlayerJob(thePlayer,true) == "Trash Collector") then triggerClientEvent ( thePlayer, "GTITrashCollector.onWasteEnter", resourceRoot ) end end addEventHandler ( "onVehicleEnter", getRootElement(), trashEnter ) addEvent("GTITrashCollector.freeze", true) addEventHandler("GTITrashCollector.freeze", root, function(fre) local theveh = exports.GTIrentals:getPlayerRentalVehicle(client) if fre == false then setElementFrozen(theveh,false) elseif fre == true then setElementFrozen(theveh,true) end end ) addEvent("GTITrashCollector.anim", true) addEventHandler("GTITrashCollector.anim", root, function(anim) if anim == 1 then exports.GTIanims:setJobAnimation(client, "CARRY", "crry_prtial", 50, false, true, false, false) exports.GTIanims:setJobAnimation(client, "CARRY", "crry_prtial", 50, false, true, false, true) elseif anim == 2 then exports.GTIanims:setJobAnimation(client, "CARRY", "liftup", 1000, true, false, false, false) elseif anim == 3 then exports.GTIanims:setJobAnimation(client, "GRENADE", "WEAPON_throwu", 500, true, false, false, false) end end ) Se for possivel vocês me falar uma forma de resolver o problema eu agradeço.
  6. Ola, recentemente vi um video no youtube onde o dono do script disponibilizou alguns sistemas criado por ele um deles sendo o inventario. O problema é que só funciona com o mysql, teria como mudar o script para ele usar recursos do proprio MTA?
  7. Como faço pra fazer um script que ao abrir o mapa do F11 de de marcar onde eu quero ir?Desde ja agradeço.
  8. Ola, como faço pra colocar um painel de login sem que ele de erro quando um player for registrar a conta? desde ja agradeço.