Jump to content

PeeQ.

Members
  • Posts

    16
  • Joined

  • Last visited

About PeeQ.

  • Birthday 31/03/2004

Details

  • Location
    Brazil
  • Occupation
    Designer and scripter(gta3script and c#)
  • Interests
    Learn .Lua

Recent Profile Visitors

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

PeeQ.'s Achievements

Square

Square (6/54)

2

Reputation

  1. Você está usando um variável pra definir a imagem do botão antes de dar um valor pra ela, imagino que a imagem deva começar como pause, então na lógica deverá ser assim. button = "img/pause.png" --estou definindo inicialmente como pause, caso seja o contrário, é só mudar o nome da imagem, dxDrawImage(x*1803, y*52, x*50, y*50, button, 0, 0, 0, tocolor(255, 255, 255, 255)) addEventHandler('onClientClick', root, function (button, state, _, _, _, _, _, element) if isMouseInPosition(x*1803, y*52, x*50, y*50) then if button == "img/pause.png" then button = "img/play.png" setSoundPaused(sound, true) elseif button == "img/play.png" then button = "img/pause.png" setSoundPaused(sound, false) end end end) importante que já que é um variável só dar um valor inicial, deva ficar no topo fora de de uma function
  2. Still don't working yeah, i see, i will change later, but, i need test first
  3. Então, oq me intriga é não apresentar nenhum erro, nem no debugscript, nem no console, e a variável healh é global
  4. Alguém consegue me responder pq a function finish n é chamada? function markerb1() if CurrentMarker >= 2 then destroyElement(marker) destroyElement(blip) end if CurrentMarker == 2 then --42 = ultima outputChatBox("Você terminou, entre na auto-escola para ver sua avaliação.", getRootElement(), 0, 255, 0) health = getElementHealth(car) fnh = createMarker(-2026.83, -114.85, 1034, "cylinder", 1.0, _,_,_,_, getRootElement()) setElementInterior(fnh, 3) destroyElement(car) addEventHandler("onMarkerHit", fnh, finish) else marker = createMarker(markersb[CurrentMarker][1], markersb[CurrentMarker][2], markersb[CurrentMarker][3], "checkpoint", 5.0, 255, 0, 0, 90, getRootElement()) blip = createBlipAttachedTo(marker, _, _, _, _, _, _, _, _, getRootElement()) CurrentMarker = CurrentMarker + 1 end end function finish(hitElement, matchingDimension) if health >= 900 then outputChatBox("Você aprovado, agora você possui habilitação tipo B.", getRootElement(), 0, 255, 0) account = getPlayerAccount(hitElement) setAccountData(account, "habilitacao.tipob", true) else outputChatBox("Você foi reprovado, tente novamente.", getRootElement(), 255, 0, 0) end started = false end Ele chega a me mostrar a mensagem de que terminou, e cria a marker dentro da auto-escola, mas qnd eu passo nela, nada acontece, já troquei o onMarkerHit pelo onPlayerMarkerHit, mas anyway, não funcionou
  5. started = false timeExist = false currentMarker = 0 function tipob() if started == false then takePlayerMoney(source, 2500) outputChatBox("O teste foi iniciado! Você irá se responsabilizar pela integralidade do veículo, dirija atentamente!", getRootElement(), 0, 255, 0) --the drive test has been started iniciar() started = true else outputChatBox("O teste já foi inciado.", getRootElement(), 255, 0, 0) --the drive test has already started end end addEvent("habilitacao.tipob.iniciar", true) addEventHandler("habilitacao.tipob.iniciar", root, tipob) function iniciar() -->> inciar = start car = createVehicle (555, -2064.5, -83, 35) addEventHandler("onVehicleExplode", car, check) setVehicleColor (car, 255, 255, 255) warpPedIntoVehicle (source, car) setElementInterior(source, 0) markerb1() end function check() destroyElement(car) takePlayerMoney(getRootElement(), 25000) started = false if timeExist == true then killTimer(timer) end outputChatBox("O veículo foi explodido ou abandonado, você irá arcar com o prejuízo!", getRootElement(), 255, 0, 0)-- the car has exploded if CurrentMarker >= 1 then destroyElement(marker) destroyElement(blip) CurrentMarker = 0 end end markersb = { {-2058, -97, 35}, {-2048.9013671875, -77.568359375, 35.171875}, {-2059.20, -67.70, 35}, {-2083.30, -68, 35}, {-2083, -31, 35}, {-2093.50, 33.40, 35}, {-2153.365234375, 33.380859375, 35.171875}, {-2157.673828125, 96.2412109375, 35.171875}, {-2144.2060546875, 195.67578125, 35.212448120117}, {-2168.69140625, 211.060546875, 35.171875}, {-2248.9111328125, 219.6123046875, 35.1640625}, {-2265.2607421875, 323.0166015625, 35.455764770508}, {-2369.2841796875, 290.861328125, 35.114284515381}, {-2495.7900390625, 172.275390625, 6.3510932922363}, {-2594.630859375, 160.13671875, 4.1759071350098}, {-2606.0966796875, 120.9931640625, 4.1796875}, {-2619.3984375, 41.658203125, 4.1796875}, {-2708.158203125, 27.4619140625, 4.1796875}, {-2708.2568359375, -195.2109375, 4.1796875}, -- {-2733.0078125, -208.111328125, 7.0317420959473}, {-2669.1015625, -212.5810546875, 4.1796875}, {-2688.7587890625, -269.09765625, 7.0390625}, {-2818.72265625, -337.8154296875, 7.03125}, {-2811.447265625, -469.8564453125, 7.1255831718445}, {-2673.7734375, -520.1796875, 17.830480575562}, {-2570.7138671875, -370.2158203125, 49.504898071289}, {-2365.0419921875, -396.923828125, 78.278594970703}, {-2375.4443359375, -431.3271484375, 82.007827758789}, {-2474.5595703125, -432.8857421875, 80.774749755859}, {-2615.68359375, -506.1259765625, 71.738357543945}, {-2470.60546875, -493.2841796875, 103.46114349365}, {-2411.701171875, -625.908203125, 132.40286254883}, {-2345.806640625, -700.7392578125, 112.21072387695}, {-2309.025390625, -782.34375, 90.427505493164}, {-2242.375, -710.5224609375, 65.92414855957}, {-2189.2841796875, -486.458984375, 48.398128509521}, {-2251.1337890625, -357.2529296875, 50.8671875}, {-2251.3291015625, -205.080078125, 35.308410644531}, {-2178.77734375, -186.2490234375, 35.179664611816}, {-2164.572265625, -84.9814453125, 35.171875}, {-2130.400390625, -72.94921875, 35.171875}, {-2047.533203125, -83.7236328125, 35.1640625}, } function markerb1() CurrentMarker = CurrentMarker + 1 if CurrentMarker >= 2 then destroyElement(marker) destroyElement(blip) end if CurrentMarker == 42 then --42 = the last marker outputChatBox("Você terminou", getRootElement(), 0, 255, 0) --you has been fineshed started = false if (getElementHealth(car) >= 900) then account = getPlayerAccount(source) setAccountData(account, "habilitacao.tipob", true) --license = true outputChatBox("Você aprovado, agora você possui habilitação tipo B.", getRootElement(), 0, 255, 0)--you has been aprovate destroyElement(car) else outputChatBox("Você foi reprovado, tente novamente.", getRootElement(), 255, 0, 0)--you has reprobate destroyElement(car) end else marker = createMarker(markersb[CurrentMarker][1], markersb[CurrentMarker][2], markersb[CurrentMarker][3], "checkpoint", 5.0, 255, 0, 0, 90, getRootElement()) blip = createBlipAttachedTo(marker, _, _, _, _, _, _, _, _, getRootElement()) end addEventHandler("onMarkerHit", marker, markerb1) end addEventHandler ( "onPlayerVehicleExit", getRootElement(), function(theVehicle, seat, jacked ) if (getElementModel(theVehicle) == 555) then outputChatBox("Você tem 30 segundos para voltar ao veículo, caso contrário, o teste será cancelado.", getRootElement(), 255, 0, 0) --go back to car in 30 seconds timer = setTimer(check, 30000, 1) timeExist = true end end) addEventHandler ( "onPlayerVehicleEnter", getRootElement(), function(theVehicle, seat, jacked) if timeExist == true then if (getElementModel(theVehicle) == 555) then killTimer(timer) timeExist = false end end end) Sorry, this is the correctly script, but i can't edit the post i do not know why
  6. started = false timeExist = false currentMarker = 0 function tipob() if started == false then takePlayerMoney(source, 2500) outputChatBox("O teste foi iniciado! Você irá se responsabilizar pela integralidade do veículo, dirija atentamente!", getRootElement(), 0, 255, 0) --the drive test has been started iniciar() started = true else outputChatBox("O teste já foi inciado.", getRootElement(), 255, 0, 0) --the drive test has already started end end addEvent("habilitacao.tipob.iniciar", true) addEventHandler("habilitacao.tipob.iniciar", root, tipob) function iniciar() -->> inciar = start car = createVehicle (555, -2064.5, -83, 35) addEventHandler("onVehicleExplode", car, check) setVehicleColor (car, 255, 255, 255) warpPedIntoVehicle (source, car) setElementInterior(source, 0) markerb1() end function check() destroyElement(car) takePlayerMoney(getRootElement(), 25000) started = false if timeExist == true then killTimer(timer) end outputChatBox("O veículo foi explodido ou abandonado, você irá arcar com o prejuízo!", getRootElement(), 255, 0, 0)-- the car has exploded if CurrentMarker >= 1 then destroyElement(mk) destroyElement(b) CurrentMarker = 0 end end markersb = { {-2058, -97, 35}, {-2048.9013671875, -77.568359375, 35.171875}, {-2059.20, -67.70, 35}, {-2083.30, -68, 35}, {-2083, -31, 35}, {-2093.50, 33.40, 35}, {-2153.365234375, 33.380859375, 35.171875}, {-2157.673828125, 96.2412109375, 35.171875}, {-2144.2060546875, 195.67578125, 35.212448120117}, {-2168.69140625, 211.060546875, 35.171875}, {-2248.9111328125, 219.6123046875, 35.1640625}, {-2265.2607421875, 323.0166015625, 35.455764770508}, {-2369.2841796875, 290.861328125, 35.114284515381}, {-2495.7900390625, 172.275390625, 6.3510932922363}, {-2594.630859375, 160.13671875, 4.1759071350098}, {-2606.0966796875, 120.9931640625, 4.1796875}, {-2619.3984375, 41.658203125, 4.1796875}, {-2708.158203125, 27.4619140625, 4.1796875}, {-2708.2568359375, -195.2109375, 4.1796875}, -- {-2733.0078125, -208.111328125, 7.0317420959473}, {-2669.1015625, -212.5810546875, 4.1796875}, {-2688.7587890625, -269.09765625, 7.0390625}, {-2818.72265625, -337.8154296875, 7.03125}, {-2811.447265625, -469.8564453125, 7.1255831718445}, {-2673.7734375, -520.1796875, 17.830480575562}, {-2570.7138671875, -370.2158203125, 49.504898071289}, {-2365.0419921875, -396.923828125, 78.278594970703}, {-2375.4443359375, -431.3271484375, 82.007827758789}, {-2474.5595703125, -432.8857421875, 80.774749755859}, {-2615.68359375, -506.1259765625, 71.738357543945}, {-2470.60546875, -493.2841796875, 103.46114349365}, {-2411.701171875, -625.908203125, 132.40286254883}, {-2345.806640625, -700.7392578125, 112.21072387695}, {-2309.025390625, -782.34375, 90.427505493164}, {-2242.375, -710.5224609375, 65.92414855957}, {-2189.2841796875, -486.458984375, 48.398128509521}, {-2251.1337890625, -357.2529296875, 50.8671875}, {-2251.3291015625, -205.080078125, 35.308410644531}, {-2178.77734375, -186.2490234375, 35.179664611816}, {-2164.572265625, -84.9814453125, 35.171875}, {-2130.400390625, -72.94921875, 35.171875}, {-2047.533203125, -83.7236328125, 35.1640625}, } function markerb1() CurrentMarker = CurrentMarker + 1 if CurrentMarker >= 2 then destroyElement(marker) destroyElement(blip) end if CurrentMarker == 42 then --42 = the last marker outputChatBox("Você terminou", getRootElement(), 0, 255, 0) --you has been fineshed started = false if (getElementHealth(car) >= 900) then account = getPlayerAccount(source) setAccountData(account, "habilitacao.tipob", true) --license = true outputChatBox("Você aprovado, agora você possui habilitação tipo B.", getRootElement(), 0, 255, 0)--you has been aprovate destroyElement(car) else outputChatBox("Você foi reprovado, tente novamente.", getRootElement(), 255, 0, 0)--you has reprobate destroyElement(car) end else marker = createMarker(markersb[m][1], markersb[m][2], markersb[m][3], "checkpoint", 5.0, 255, 0, 0, 90, getRootElement()) blip = createBlipAttachedTo(mk, _, _, _, _, _, _, _, _, getRootElement()) end addEventHandler("onMarkerHit", marker, markerb1) end addEventHandler ( "onPlayerVehicleExit", getRootElement(), function(theVehicle, seat, jacked ) if (getElementModel(theVehicle) == 555) then outputChatBox("Você tem 30 segundos para voltar ao veículo, caso contrário, o teste será cancelado.", getRootElement(), 255, 0, 0) --go back to car in 30 seconds timer = setTimer(check, 30000, 1) timeExist = true end end) addEventHandler ( "onPlayerVehicleEnter", getRootElement(), function(theVehicle, seat, jacked) if timeExist == true then if (getElementModel(theVehicle) == 555) then killTimer(timer) timeExist = false end end end) I made this script myself, I'm not very experienced, so forgive the mistakes. Well, I have two errors, I can't set the value in "setAccountData", and for some reason, the script always skips a checkpoint when creating the marker. pllzzz, help me Leon
  7. Seguindo a lógica, pra armazenar a informação eu quero, a habilitação, devo usar o account data, certo?
  8. Estou em dúvida, vi que ambos tem funções parecidas, a diferença é que o AccountData é server-side, eu tô fazendo um script de auto-escola, e estou em dúvida se pra armazenar a informação de que o player tem habilitação eu uso o SetAccountData, ou setElementData
  9. function select() local row = guiGridListGetSelectedItem(gridlist) if row == 1 then cMoney = getPlayerMoney() if (cMoney < 1500) then outputChatBox("Você não tem dinheiro suficiente para adquirir essa habilitação!", 255, 0, 0) return end outputChatBox("está sendo chamado") -- só pra oritençãp triggerServerEvent("habilitacao.tipob", resourceRoot, tipob) end end No meu caso, essa é parte do client-side que chama a função "tipob" no server side, como eu posso declarar o player que está chamando na function tipob?
  10. function tipob() carro = createVehicle(555, -2064.5, -83, 35) setVehicleColor(carro, 255, 255, 255) warpPedIntoVehicle(player, carro) end addEventHandler("onResourceStart", resourceRoot, tipob) Esse é o meu script, ele é server-side, pq quero q o carro criado seja visto e interagido por qlq pessoa e eu queria que o player que está executando esse recurso, fosse teleportando por carro, mas tá dando bad argumento no comando do warp ped, falando que o primeiro argumento está errado por padrão essa function vai ser chamada por uma gui, mas eu deixei pra iniciar junto com recursos pra testar
  11. You are a hero, yes, i'm learning Lua script, i'm benning, thk for your help, and recommendations, i want kiss u <3
  12. Agradeço de coração cara, dessa forma, realmente funcionou, apesar de eu não entender onde errei no primeiro script, mas agradeço mesmo assim
  13. Esse é o meu script que cria a marker function BuySkin() bincoB = createMarker(217.5, -98, 1006, "arrow", 1.5, 255, 0, 0) setElementInterior(bincoB, 15) vendedora = createPed(12, 209, -99, 1005, 180) setElementInterior(vendedora, 15) end addEventHandler("onClientResourceStart", resourceRoot, BuySkin) function ShowSkins(player) if (source == binco1m and getElementType(player) == "player") then exibir() end end addEventHandler("onClientMarkerHit", resourceRoot, ShowSkins) Esse é o meu script que cria toda a interface gui Painel = guiCreateWindow(838, 320, 375, 331, "PAGUE MENOS", false) guiWindowSetSizable(Painel, false) guiSetAlpha(Painel, 0.92) guiSetProperty(Painel, "CaptionColour", "FFFEEB16") guiSetVisible(Painel, false) sair = guiCreateButton(269, 288, 92, 33, "Sair", false, Painel) guiSetProperty(sair, "NormalTextColour", "FF39EB3D") GUIEditor.button[4] = guiCreateButton(9, 288, 97, 33, "Comprar", false, Painel) guiSetProperty(GUIEditor.button[4], "NormalTextColour", "FF39EB3D") GUIEditor.gridlist[3] = guiCreateGridList(9, 27, 352, 257, false, Painel) guiGridListAddColumn(GUIEditor.gridlist[3], "Skins", 0.3) guiGridListAddColumn(GUIEditor.gridlist[3], "ID", 0.3) guiGridListAddColumn(GUIEditor.gridlist[3], "Preço", 0.3) for i = 1, 2 do guiGridListAddRow(GUIEditor.gridlist[3]) end guiGridListSetItemText(GUIEditor.gridlist[3], 0, 1, "skin1", false, false) guiGridListSetItemText(GUIEditor.gridlist[3], 0, 2, "-", false, false) guiGridListSetItemText(GUIEditor.gridlist[3], 0, 3, "-", false, false) guiGridListSetItemText(GUIEditor.gridlist[3], 1, 1, "-", false, false) guiGridListSetItemText(GUIEditor.gridlist[3], 1, 2, "-", false, false) guiGridListSetItemText(GUIEditor.gridlist[3], 1, 3, "-", false, false) function exibir() guiSetVisible(Painel, not guiGetVisible(Painel)) showCursor(guiGetVisible(Painel)) end function click() if source == sair then exibir() end end addEventHandler("onClientGUIClick", resourceRoot, click) O meu problema é que quando eu passo na marker, nada acontece, simplesmente nada, nenhum error é mostrado no meu console
  14. The first solution dont work... nothing happens the second solution still nothin happening
×
×
  • Create New...