Jump to content

Ari Alves

Members
  • Posts

    21
  • Joined

  • Last visited

Recent Profile Visitors

460 profile views

Ari Alves's Achievements

Civilian

Civilian (7/54)

0

Reputation

  1. Declarei a variável next em client-side, imagino que o erro seja esse, irei mandar o codigo por inteiro para melhor entendimento Aqui temos a server-side outputDebugString("------------------------------------------------------------------------------") outputDebugString("") outputDebugString(" [Alves] Obrigado por usar nossos scripts. ") outputDebugString("") outputDebugString("------------------------------------------------------------------------------") -------------------------------------------------------------------------------------------------------------------- -- Função Criar Marker -------------------------------------------------------------------------------------------------------------------- local ped = createPed(15, 2029.765, -1382.825, 17.211, 179.205) setElementData(ped, "Cleitinho", true) -------------------------------------------------------------------------------------------------------------------- --Funçao Exportar Dx -------------------------------------------------------------------------------------------------------------------- function message(player, message, type) triggerClientEvent(player, "N3xT.dxNotification", resourceRoot, message, type) end -------------------------------------------------------------------------------------------------------------------- e aqui temos a client-side local screenW,screenH = guiGetScreenSize() local resW, resH = 1365,767 local x, y = (screenW/resW), (screenH/resH) function PainelNew() dxDrawImage(screenW * 0.2926, screenH * 0.0664, screenW * 0.4125, screenH * 0.8307, ":[Alves]ComprarPlano/AlvesScript/imagens/start.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawRectangle(screenW * 0.4213, screenH * 0.5964, screenW * 0.1559, screenH * 0.0833, tocolor(255, 0, 0, 0), false) end local exibindo_painel = false addEventHandler("onClientClick", getRootElement(), function(button, state,obsolutex, obsolutey,worldx,worldy,worldz,clickedElement) if button == "left" then if state == "down" then if clickedElement then if getElementType(clickedElement) == "ped" then if getElementData( clickedElement, "Cleitinho") == true then if exibindo_painel == false then addEventHandler("onClientRender", getRootElement(), PainelNew) exibindo_painel = true else removeEventHandler("onClientRender", getRootElement(), PainelNew) exibindo_painel = false end end end end end end end) bindKey( "backspace", "down", function() if exibindo_painel == true then removeEventHandler("onClientRender", getRootElement(), PainelNew) exibindo_painel = false end end) function isMouseInPosition ( x, y, width, height ) if ( not isCursorShowing( ) ) then return false end local sx, sy = guiGetScreenSize ( ) local cx, cy = getCursorPosition ( ) local cx, cy = ( cx * sx ), ( cy * sy ) return ( ( cx >= x and cx <= x + width ) and ( cy >= y and cy <= y + height ) ) end -- Modified version for DX Text function isCursorOverText(posX, posY, sizeX, sizeY) if ( not isCursorShowing( ) ) then return false end local cX, cY = getCursorPosition() local screenWidth, screenHeight = guiGetScreenSize() local cX, cY = (cX*screenWidth), (cY*screenHeight) return ( (cX >= posX and cX <= posX+(sizeX - posX)) and (cY >= posY and cY <= posY+(sizeY - posY)) ) end addEventHandler("onClientClick", getRootElement(), function(button, state, thePlayer) if button == "left" and state== "down" then if exibindo_painel == true then if isMouseInPosition(screenW * 0.4213, screenH * 0.5964, screenW * 0.1559, screenH * 0.0833) then local next = exports.n3xt_inventario local money = getPlayerMoney(thePlayer) if (money > 1000) then takePlayerMoney(1000) next:giveItem(thePlayer, "Plano", 1) message(thePlayer, "[#00bfffHospital#ffffff]Vocé comprou um #00bfffplano medico#ffffff.", "info") else message(thePlayer, "[#00bfffHospital#ffffff]Vocé não tem #00bfffDinheiro#ffffff.", "info") end end end end end) -------------------------------------------------------------------------------------------------------------------- --Funçao Exportar Dx -------------------------------------------------------------------------------------------------------------------- function message(player, message, type) triggerClientEvent(player, "N3xT.dxNotification", resourceRoot, message, type) end -------------------------------------------------------------------------------------------------------------------- Fiz o script todo sozinho, mas é minha primeira vez criando um painel dx, normalmente meus scripts nem usam client
  2. Na verdade pode, ja usei essa função de export antes. A programação ta do lado client, pode ser isso?
  3. Olá, bom dia, gostaria de pedir ajuda a voces, to criando um painel dx para comprar plano medico, que estaria vinculada ao inventario, mas quando eu clico para comprar, da erro e não funciona, poderiam me ajudar? Irei anexar umas imagens com os erros: ja adicionei os codigos de ( IsMouseInPosition ) addEventHandler("onClientClick", getRootElement(), function(button, state, thePlayer) if button == "left" and state== "down" then if exibindo_painel == true then if isMouseInPosition(screenW * 0.4213, screenH * 0.5964, screenW * 0.1559, screenH * 0.0833) then local next = exports.n3xt_inventario local money = getPlayerMoney(thePlayer) if (money > 1000) then takePlayerMoney(1000) next:giveItem(thePlayer, "Plano", 1) message(thePlayer, "[#00bfffHospital#ffffff]Vocé comprou um #00bfffplano medico#ffffff.", "info") else message(thePlayer, "[#00bfffHospital#ffffff]Vocé não tem #00bfffDinheiro#ffffff.", "info") end end end end end) -------------------------------------------------------------------------------------------------------------------- --Funçao Exportar Dx -------------------------------------------------------------------------------------------------------------------- function message(player, message, type) triggerClientEvent(player, "N3xT.dxNotification", resourceRoot, message, type) end --------------------------------------------------------------------------------------------------------------------
  4. Ja tentei de varias formas e não consigo. Gostaria de setar para a tecla E fazer a função, se puderem me ajudar eu agradeceria muito. function key1 () bindKey (source, "e", "down", deitar1) end addEventHandler ("onPlayerLogin", root, marker1) function deitar1(source) if isElementWithinMarker(source, marker1) then if getElementHealth(source) <= 80 then setElementFrozen(source, true) toggleAllControls (source, false ) setElementPosition(source,311.2, -1508.321, 36.738) setElementRotation(source,-0, 0, 283.97274780273) message(source, "[#9400D3Hospital#ffffff] Voce esta recebendo o tratamento, #9400D3aguarde#ffffff!", "info") setPedAnimation(source, "crack", "crckidle1", 1, true, true, true, true) exports.ORGAOSBarraProgresso:barra(source, 30, true) setTimer(function() setElementHealth(source, 100) setElementFrozen(source, false) toggleAllControls(source, true ) setElementPosition(source,312.569, -1507.949, 36.033) setElementRotation(source,-0, 0, 280.4323425293) setPedAnimation(source, "crack", "crckidle1", 1, false, false, false, false) message(source, "[#9400D3Hospital#ffffff] tratamento aplicado com #9400D3Sucesso#ffffff!", "info") end, 30000,1) else message(source, "[#9400D3Hospital#ffffff] Voce não precisa de tratamento", "info") end end end
  5. To em busca de criar um sistema de pagamento automatico, assim que ele iniciar o serviço ele vai receber um set de patrulha e depois de um tempo eu quero que ele receba um dinheiro automaticamente no banco, como consigo fazer isso? E como consigo fazer com q, quando o player quitar o tempo seja pausado?
  6. Amigo para te ajudar precisamos puxar os elementos do inventario, então precisamos saber de qual inventario se trata
  7. Queria adicionar uma proteção em meu script para ativar somente se estiver conectado em meu ip, mas n intendo de muito bem!
  8. Te mandei solicitaçao no discord vou te mandar 1 video!
  9. Ta funfando não man, ta dando um erro na função do output e da um bug que toda vez que da o comando o tempo reinicia
  10. Olá, bom dia. para fazer seu script setar uma cor pre-definida, voce deve usar a função setVehicleColor. más se você for iniciante como pode entender? Vou te explicar usando uma função criada por mim: MarkerCarFbi = createMarker(-381.268, -1374.574, -21.245 -2.8,"cylinder", 3, 148, 000, 211, 150) -- Marker para dar comandos function CreateCarFbi(source) if veiculofbi and isElement(veiculofbi) then destroyElement(veiculofbi) -- Essas primeiras funções usei para checar se ele n criou um veiculo antes, evitando lag veiculofbi = nil -- e se ele tiver criado então esse veiculo será deletado e outro criado end veiculofbi = createVehicle(579 , 2740.299, -1009.438, 59.82, 0.703, -0.244, 178.45) -- função de criar o veiculo ( veiculoId, X,Y,Z, RotaçaoX, RotaçaoY, RotaçaoZ) FuncS = setVehicleColor(veiculofbi, 000, 000, 000) -- Aqui ele vai setar a cor do veiculo, (Nome Definido para o createVehicle, R, G, B ) TeleporteAe = warpPedIntoVehicle(source, veiculofbi) -- Função para teleportar o player para dentro do veiculo end addCommandHandler("pegarcarro", CreateCarFbi) -- Comando para pegar o veiculo
  11. Como spawnar um carro com uma cor pre definida? tipo preto?
  12. Como montar cutscene no mta, em um script
  13. Mano, não intendi como aplicar isso na minha funçao
  14. To criando um sistema de emprego e tals. quando o player entra no marker ele digita /minerar e voce deve ja estar imaginando oque acontece, ele faz uma animaçao por alguns segundos e depois recebe os itens, más dai tem como o cara floodar no f8, ja dei freeze e toogleallcomandos false. podem me ajudar? function coletarminerios(source) if isElementWithinMarker (source, Minerador1) then local Minerio1 = math.random(1, 7) local Minerio2 = math.random(0, 5) local Minerio3 = math.random(0, 2) local Minerio4 = math.random(0, 1) local next = exports.n3xt_inventario local next = exports.n3xt_inventario local item = next:getItem(source, "Picareta") if (item) and (item >= 1) then next:takeItem(source, "Picareta", 1) setPedAnimation(source, "medic", "cpr", 1, true, true, true, true) setElementFrozen(source, true) toggleAllControls (source, false ) message(source, "[#9400D3Minerador#ffffff] Aguarde enquanto voce #9400D3minera#ffffff.", "info") exports.ORGAOSBarraProgresso:barra(source, 10, true) setTimer(function() next:giveItem(source, "CobreMin", Minerio1) next:giveItem(source, "Ouro", Minerio2) next:giveItem(source, "Diamante", Minerio3) next:giveItem(source, "Safira", Minerio4) setElementFrozen(source, false) toggleAllControls (source, true ) message(source, "[#9400D3Minerador#ffffff] Voce acaba de coletar #9400D3minerios#ffffff.!.", "info") setPedAnimation(source, "medic", "cpr", 1, false, false, false, false) end, 10000, 1) end end end addCommandHandler("minerar", coletarminerios)
×
×
  • Create New...