Jump to content

VictorScripting

Members
  • Posts

    66
  • Joined

  • Last visited

Everything posted by VictorScripting

  1. pode me mostrar uns exemplos usando ele em DX?? pq n entendi como usa eles dois no dx ? pode mostrar um exemplo pronto de uma imagem girando ?
  2. PESSOAL SÃO DUAS DUVIDAS: 1- COMO EU FAÇO UM EFEITO EM UMA IMAGEM ? TIPO DEIXAR ELA GIRANDO. (EU JA SEI DA PARTE QUE TEM QUE TER IMAGEM DE CADA MOVIMENTO) 2- E COMO EU FAÇO PARA ALGO SURGIR EM EFEITO DE TRANSIÇÃO ? EX:(UM RETÂNGULO SURGIR VINDO DA ESQUERDA ! E PARA NO SEU LOCAL) EU VI ESSA FUNÇÃO MAIS NÃO ENTENDI ALGUÉM ME EXPLICA TBM ? imgTick = getTickCount() currentIMG = 1 now = getTickCount() if now >= imgTick+30 then currentIMG = iif(currentIMG==16,1,currentIMG+1) imgTick = now end dxDrawImage(posX+.6*ih/2,posY+mh/2-(ih/2.5)/2,ih/2.5,ih/2.5,iif(t[1]=="Para","coin","exp").."/"..iif(day==current or isMouseInPosition (posX,posY,mw,mh),currentIMG,1)..".png",0,0,0,nil,true)
  3. Olá comunidade hoje eu quero aprender sobre o uso de EMAIL no scripts Lua, pois eu tenho grandes projetos futuros. Eu queria saber quais funções do MTA utiliza email e eu queria principalmente a função que manda uma mensagem pro email do jogador, um exemplo em um sistema de registro a qual chega um mensagem no email do jogador. Eu queria sabe também como utilizar diversas plataformas como: outlook, gmailm noreply e etc...
  4. não era isso a dúvida sksksksksk, mais ja resolvir eu queria saber como criar a barra digitavel, eu fiz assim: o jogador digita o valor que ele deseja converter aew fiz assim dinheiro = getPlayerMoney dollar = 4 convert = dinheiro/dollar function converter(thePlayer, amount) dollar = amount/4 setElementData(thePlayer,"char:money",getElementData(thePlayer,"char:money")-amount) setElementData(thePlayer,"char:dollar",getElementData(thePlayer,"char:dollar")+dollar) end addEvent("converter", true) addEventHandler("converter", root, converter)
  5. Então pessoal tudo certo ? me chamo victor gabriel e estou com uma dúvida muito chata, fiz um painel DX atribuir todas as funções, mais eu quero botar um espaço digitável a qual o jogador irá digitar um valor e clicar em confirmar e o jogador irá perder o elemento1 e ganha o elemento3 que é o elemento1 dividido pelo elemento2, ou seja to fazendo um conversor de RS em DOLLAR. Me ajudem !!!!!!!
  6. Pessoal fiz um sistema de salvar dados q ESTÁ funciomando corretamente(quando a pessoa da disconect) mais quando dar /reconnect n funfa. Estou usando o parametro (onPlayerQuit)
  7. nossa mt obg danilin cara to mt feliz sério msm e para o pessoal que precisa da função ta aqui pra vcs !! function creatPedProjection() if panelState then if (getElementData(localPlayer, "Tab") == false) then x1, y1, z1 = getCameraMatrix() myElement = createPed (getElementModel(localPlayer), x1, y1, z1) myObject = exports.object_preview:createObjectPreview(myElement, 5, 5, 0, x*250, y*150, x*330, y*410, false, true, true) exports.object_preview:setRotation(myObject,-0, 0, 160) setElementData(localPlayer, "Tab", true) for theType=0, 17 do local texture, model = getPedClothes( localPlayer, theType ) if texture then addPedClothes(myElement, texture, model, theType) end end end end end function resetPedProjection () exports.object_preview:destroyObjectPreview(myObject) myElement = nil myObject = nil end
  8. ja fiz com addPedClothes mais não funcionou estou com duvidas sobre ele e eu não sei fazer loop
  9. Olá comunidade tudo bem?. Estou com um problema pois estou usando um script client que usar o object_preview, eu desejo que ao criar o ped adicione a roupa que eu estou usando no meu CJ a função que faz o ped é essa: function creatPedProjection() if panelState then if (getElementData(localPlayer, "Tab") == false) then x1, y1, z1 = getCameraMatrix() myElement = createPed (getElementModel(localPlayer), x1, y1, z1) myObject = exports.object_preview:createObjectPreview(myElement, 5, 5, 0, x*250, y*150, x*330, y*410, false, true, true) exports.object_preview:setRotation(myObject,-0, 0, 160) setElementData(localPlayer, "Tab", true) end end end function resetPedProjection () exports.object_preview:destroyObjectPreview(myObject) myElement = nil myObject = nil end ja tentei várias formas mais n muda a roupa dele.
  10. no client tu faz meio que o design de tudo tlg né ? aew qnd tu for executar algum comando tipo setElementData, takeMoney, give money e etc tu tem que usar o trigger event e lá no Lua tu chama esse evento usando o addEventHandler ex: function ComprarAlimentos() if isEventHandlerAdded("onClientRender", root, PAINELCOMIDA) then if isEventHandlerAdded("onClientRender", root, dxlAgua) then if isCursorOnElement(691, 357, 136, 30) then triggerServerEvent("ComprarAgua", localPlayer) end end end end addEventHandler("onClientClick", root, ComprarAlimentos) alir é uma função de quando clica em determinado local e acontece um evento que eu dei o nome de "ComprarAgua" alir tu bota o evento que tu quiser aew no server.Lua tu vai fazer a função desse evento no caso desse meu eu quero que o jogador compre a água então pra isso chamo o evennto no server ex: function giveAgua() local itemName = "agua" local playerItem = getElementData(source, itemName) if playerItem < 5 then if getPlayerMoney(source) >= 3 then setElementData(source, itemName, playerItem + 1) dxMsg(source, "Item adicionado ao inventário (Garrafa D'Água)!", "success") takePlayerMoney(source, 3) else dxMsg(source, "Dinheiro insuficiente para realizar compra!", "error") end else dxMsg(source, "Você alcançou o limite máximo do item!", "error") end end addEvent("ComprarAgua",true) addEventHandler("ComprarAgua", root, giveAgua) espero ter de ajudado amigão
  11. pega essa função e bote embaixo da função do score ja tentou ? pq o que fica em baixo na hora no resources fica por cima entendeu? tipo camadas, eu acho que é isso
  12. sim usei esta : 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 o código que não está funcionando é essse : function abasAlimentos() if isEventHandlerAdded("onClientRender", root, alimentos) then -- se ele tiver na aba de alimentos if isCursorOnElement(730, 216, 404, 27) then -- no caso qui eu quero que se o tiver clicado dxDrawRectangle(382, 346, 264, 1, tocolor(254, 254, 254, 255), false) dxDrawText("NENHUM ITEM", 380, 304, 646, 340, tocolor(255, 255, 255, 255), 3.00, "default-bold", "center", "center", false, false, false, false, false) dxDrawText("ATUALMENTE NÃO HÁ\n NENHUM OBJETO\n SELECIONADO !", 377, 360, 646, 565, tocolor(0, 95, 253, 255), 1.50, "default-bold", "center", "top", false, false, false, false, false) dxDrawRectangle(382, 570, 264, 1, tocolor(254, 254, 254, 255), false) dxDrawRectangle(570, 578, 76, 34, tocolor(0, 28, 243, 255), false) dxDrawText("agua", 380, 574, 568, 614, tocolor(255, 255, 255, 255), 1.00, "default-bold", "center", "center", false, false, false, false, false) dxDrawText("USAR", 569, 577, 646, 612, tocolor(255, 255, 255, 255), 2.00, "default-bold", "center", "center", false, false, false, false, false) end end end addEventHandler("onClientClick", root, abasAlimentos) no caso eu quero disser que se o carinha clicar no objeto vai ficar uma demarcação no objeto e tbm vai mostrar suas informações ao lado pra vc entender melhor vou mostrar uma imagem do script, eu quero que quando clicar em um item quero que apareça suas informações https://imgur.com/a/tjnmMuR
  13. Opa tudo bem galera? antes de tudo muito obrigado pela ajuda no tópico anterior. Então voltando ao assunto... Então pessoal estou fazendo um inventario + loja, é um passo longo para uma perna curta, e por isso preciso da ajuda da nossa queria comunidade. Estou com um problema pois quando clica em um objeto quero que mude algumas coisas no painel tentei fazer isso mais não aconteceu nada: function abasAlimentos() if isEventHandlerAdded("onClientRender", root, alimentos) then if isCursorOnElement(730, 216, 404, 27) then dxDrawRectangle(382, 346, 264, 1, tocolor(254, 254, 254, 255), false) dxDrawText("HAMBURGUER", 380, 304, 646, 340, tocolor(255, 255, 255, 255), 3.00, "default-bold", "center", "center", false, false, false, false, false) dxDrawText("Que tal um lanche?\n function abasAlimentos() if isEventHandlerAdded("onClientRender", root, inventario) then if isCursorOnElement(730, 216, 404, 27) then dxDrawRectangle(382, 346, 264, 1, tocolor(254, 254, 254, 255), false) dxDrawText("NENHUM ITEM", 380, 304, 646, 340, tocolor(255, 255, 255, 255), 3.00, "default-bold", "center", "center", false, false, false, false, false) dxDrawText("Que tal um lanche?\n Coma um\n HAMBRUGUER !", 377, 360, 646, 565, tocolor(0, 95, 253, 255), 1.50, "default-bold", "center", "top", false, false, false, false, false) dxDrawRectangle(382, 570, 264, 1, tocolor(254, 254, 254, 255), false) dxDrawRectangle(570, 578, 76, 34, tocolor(0, 28, 243, 255), false) dxDrawText("HAMBURGUER", 380, 574, 568, 614, tocolor(255, 255, 255, 255), 1.00, "default-bold", "center", "center", false, false, false, false, false) dxDrawText("USAR", 569, 577, 646, 612, tocolor(255, 255, 255, 255), 2.00, "default-bold", "center", "center", false, false, false, false, false) end end end addEventHandler("onClientClick", root, abasAlimentos) esse aí acima não está funciona antes dele eu fiz e funcionam olha: function abas() if isEventHandlerAdded("onClientRender", root, inventario) then if isCursorOnElement(770, 105, 64, 64) then dxDrawImage(770, 105, 64, 64, ":guieditor/images/alimentos.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) addEventHandler("onClientRender", root, alimentos) end end end addEventHandler("onClientClick", root, abas) ja tentei olha na debug mais não diz nd OBS: LEMBRADO O PRIMEIRO CÓDIGO ACIMA É O QUE NÃO FUNCIONA. O SEGUNDO FUNCIONA !!!!!!!!
  14. ei Efeiciencia vc pode me citar um exemplo ? vms supor ent no caso que dentro da função onMarkerHit vou botar a funçção onClientRender ?
  15. Opa ent amigo onde eu faria pra ele saber a qual DX estou referindo ? e também desejo saber como irei abrir esse painel. Desejo por método de marker e bind.
  16. Opa tudo bom galera ?. então estou querendo fazer um script de inventario para a comunidade, eu ja tenho a lógica de tudo com vai funcionar em Lua, mais.... eu devo atribuir funções que para que o painel execute os comando que desejo, então preciso da ajuda de vocês, eu ja tenho o dx todo completo, mais desejo saber como vou abrir ele por: marker e bind. E como eu vou fazer que os cliques do painels ó funcionar quando o painel estiver aberto !!!!!!! Vi que para fazer um hud basta a function: onClientRender. Mais não sei como abrir por: markers, binds e etc...
  17. amigo se você está usando a função por addCommandHandler vc n pode botar bota o nome do marker no addCommand pois lá em cima naquela if você já disse que se tiver em cima do marker que irá funcionar então faça assim !!!! ml = createMarker(821.386, -1332.981, 13.547, "cylinder",1.5, 255, 255, 255, 100) -- cria um marker chamado ML function teleport(source) if isElementWithinMarker(source, ml) then -- se o player estiver sobre o marker chamado if getPlayerMoney(source) >= 400 then -- se o dinheiro do player for igual ou maior que 400 então: takePlayerMoney(source, 400) -- Remover 400 de Dinheiro player setElementPosition(source, 733.827, -1355.561, 23.586) -- irá levar o jogador para a posição mencionada setElementInterior(source,0) -- irá levar o jogador para o interior 0 setElementDimension ( source, 0 ) -- irá levar o jogador para a dimensão 0 end end end addCommandHandler("entrar", teleport) -- quando o player digitar o comando /entrar ele irá executar a função teleport amigo mais se ele teleporte for para um interior e outra dimensão você terá que acrescentar mais algumas coisas, pois terá que explicar pro script em que interior e dimensão ficará essa cordenada espero ter te ajudado
  18. mais tu já olhou a debug? recomendo tu usar o script completo pow ele salva: dinheiro, spawn, wasted, skins, roupas e etc.... recomendo usar ele pow.
  19. mais vc está usando só ele ? ou no mod tem outros script.Lua ? você ja olhou a debugscript 3 ?????????
  20. n ? pois espera vou ver o meu save system --[[ original script by Justus (GA_Justus) --]] function saveClothes() local account = getPlayerAccount(source) if ( not isGuestAccount(account) ) and ( getElementModel(source) == 0 ) then local texture = {} local model = {} for i=0, 17, 1 do local clothesTexture, clothesModel = getPedClothes(source, i) if ( clothesTexture ~= false ) then table.insert(texture, clothesTexture) table.insert(model, clothesModel) else table.insert(texture, " ") table.insert(model, " ") end end local allTextures = table.concat(texture, ",") local allModels = table.concat(model, ",") outputDebugString("Clothessaver: Saved clothes") setAccountData(account, "Clothessaver:Texture", allTextures) setAccountData(account, "Clothessaver:Model", allModels) texture = {} model = {} end end addEventHandler("onPlayerQuit", getRootElement(), saveClothes) function setClothes() local account = getPlayerAccount(source) if ( not isGuestAccount(account) ) then local textureString = getAccountData(account, "Clothessaver:Texture") local modelString = getAccountData(account, "Clothessaver:Model") local textures = split(textureString, 44) local models = split(modelString, 44) setElementModel(source,0) for i=0, 17, 1 do if ( textures[i+1] ~= " " ) then addPedClothes(source, textures[i+1], models[i+1], i) end end outputChatBox("Clothes were added by clothessaver", source, 0, 255, 0) textures = {} models = {} end end addEventHandler("onPlayerLogin", getRootElement(), setClothes) function loadClothes(player) local account = getPlayerAccount(player) if ( not isGuestAccount(account) ) then local textureString = getAccountData(account, "Clothessaver:Texture") local modelString = getAccountData(account, "Clothessaver:Model") local textures = split(textureString, 44) local models = split(modelString, 44) setElementModel(player,0) for i=0, 17, 1 do if ( textures[i+1] ~= " " ) then addPedClothes(player, textures[i+1], models[i+1], i) end end outputChatBox("Clothes were added by clothessaver", player, 0, 255, 0) textures = {} models = {} else outputChatBox("Porfavor faça login!", player, 255, 0, 0) end end addCommandHandler("loadClothes", loadClothes) function saveClothes(player) local account = getPlayerAccount(player) if ( not isGuestAccount(account) ) then if ( getElementModel(player) == 0 ) then local texture = {} local model = {} for i=0, 17, 1 do local clothesTexture, clothesModel = getPedClothes(player, i) if ( clothesTexture ~= false ) then table.insert(texture, clothesTexture) table.insert(model, clothesModel) else table.insert(texture, " ") table.insert(model, " ") end end local allTextures = table.concat(texture, ",") local allModels = table.concat(model, ",") outputDebugString("Clothessaver: Saved clothes") setAccountData(account, "Clothessaver:Texture", allTextures) setAccountData(account, "Clothessaver:Model", allModels) texture = {} model = {} end else outputChatBox("Porfavor faça login!", player, 255, 0, 0) end end addCommandHandler("saveClothes", saveClothes) server !!!!!!! espero ter ajudado !!!!!!!!
  21. https://www.mediafire.com/file/ptmz601xaw6cva0/btc_cjClothes.zip/file aconselho que use um mod de dx e lá onde tá export bote o nome do dxmensage que vc for usar !!!!!
  22. se você quiser te mando uma loja de skin com salvamento aew vc estuda mais se não quiser te mando só as linhas do save !!!
  23. então galera fiz um sistema de academia que está funcionando perfeitamente, botei até no save system e quando o player reloga o musculo carrega tbm mais eu queria que de 30 em 30 minutos ele perder-se 250 de musculo eu tentei fazer a seguinte setTimer mais não funcionou !!! function perdermusc (thePlayer) setPedStat(thePlayer, 23, -250) outputChatBox("#00ff00[Toronto Info] Você está perdendo musculos vai a academia !!!!", thePlayer, 255, 255, 255, true) end setTimer(perdermusc,500,0) alir em 500 ta assim porque eu estava testando !!!!!!!!
  24. ok mais agora no lugar de: moneyChange = math.abs(newValue - oldValue) coloco oque em oldvalue ???????????? ficou assim está correto ? function somDimDim() if source == localPlayer then local newValue = getPlayerMoney(source) or 0 if newValue then moneyTick = getTickCount() + 5000 moneyChange = math.abs(newValue - oldValue) if newValue < oldValue then moneyChange = "-$"..moneyChange cor[2] = tocolor(255, 0, 0, 255) else moneyChange = "+$"..moneyChange cor[2] = tocolor(0, 255, 0, 255) end playSound("money.mp3", false) end elseif source == localPlayer then --loadStats() end end addEventHandler ( "onClientRender", root, somDimDim )
×
×
  • Create New...