Jump to content

LucasST

Members
  • Posts

    61
  • Joined

  • Last visited

4 Followers

Recent Profile Visitors

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

LucasST's Achievements

Snitch

Snitch (10/54)

13

Reputation

  1. Para um veiculo ser considerado quebrado, a vida tem que ser menor ou igual a 350
  2. Vou dar um exemplo por enquanto utilizando ElementData, pois acl utilizaria eventos para a verificação da mesma.
  3. Criação das Tabelas dbExec(connection, "CREATE TABLE IF NOT EXISTS shops (id INT, type INT, x REAL, y REAL, z REAL, rotation REAL, skin INT, interior INT, dimension INT)") Query local Query = dbQuery(connection, "INSERT INTO shops (x, y, z, dimension, interior, rotation, skin, type) VALUES (?, ?, ?, ?, ?, ?, ?, ?)", x, y, z, dim, int, rot, skinid, shopid) local result = dbPoll(Query, -1) dbFree(Query) ou dbExec(connection, "INSERT INTO shops (x, y, z, dimension, interior, rotation, skin, type) VALUES (?, ?, ?, ?, ?, ?, ?, ?)", x, y, z, dim, int, rot, skinid, shopid)
  4. É Possível utilizar posições do seu mouse para mover objetos ?, testei uns exemplos do próprio fórum mais não está retornando as posições corretas. Obj = {} function teste() if Obj[localPlayer] and isElement(Obj[localPlayer]) then destroyElement(Obj[localPlayer]) Obj[localPlayer] = nil end Obj[localPlayer] = createObject(964, 656.042, -1120.322, 48.605) end addCommandHandler("teste2",teste) addEventHandler( "onClientRender", getRootElement( ), function () if isCursorShowing() and Obj[localPlayer] and isElement(Obj[localPlayer]) then local sx, sy = guiGetScreenSize() local relX, relY = getCursorPosition() local cursorX, cursorY = relX * sx, relY * sy local camX, camY, camZ = getCameraMatrix() local cursorWorldPosX, cursorWorldPosY, cursorWorldPosZ = getWorldFromScreenPosition(cursorX, cursorY, 1000) local z = getGroundPosition(Vector3(getElementPosition(localPlayer))) setElementPosition(Obj[localPlayer], cursorWorldPosX, cursorWorldPosY, z) end end )
  5. function BreakCam() local camera = {getCameraMatrix()} setCameraMatrix(unpack(camera)) end Para voltar a camera ao normal utilize o setCameraTarget
  6. Acho que não é possível, mais seria um boa ideia para novas atualizações.
  7. local screenW, screenH = guiGetScreenSize () local resW, resH = 1920,1080 local x, y = (screenW/resW), (screenH/resH) TabelasInfos = { {"Julio"}, {"Maria"}, {"Lucas"}, {"João"}, {"Julia"}, {"Marcos"}, {"Daniel"}, {"Sabrina"}, {"Thiago"}, } function Abrir_Painel() if isEventHandlerAdded("onClientRender",getRootElement(), DxTest) then removeEventHandler("onClientRender",root,DxTest) showCursor(false) else addEventHandler("onClientRender",root,DxTest) showCursor(true) Pos = { [1] = {1,726, 330, 343, 37}, [2] = {2,726, 405, 343, 37}, [3] = {3,726, 480, 343, 37}, [4] = {4,726, 555, 343, 37}, } Selecionado = 0 end end bindKey("l","down",Abrir_Painel) function DxTest() dxDrawRectangle(x*724, y*261, x*345, y*381, tocolor(1, 0, 0, 102), false) dxDrawRectangle(x*725, y*258, x*344, y*63, tocolor(1, 0, 0, 248), false) for i = 1,#Pos do if #TabelasInfos >= Pos[i][1] then local Index = Pos[i][1] if Selecionado == Index then dxDrawRectangle(x*Pos[i][2],y*Pos[i][3],x*Pos[i][4],y*Pos[i][5], tocolor(1, 0, 0, 200), false) else dxDrawRectangle(x*Pos[i][2],y*Pos[i][3],x*Pos[i][4],y*Pos[i][5], tocolor(1, 0, 0, 150), false) end dxDrawText(""..TabelasInfos[Index][1].."", x*(Pos[i][2] + 160), y*(Pos[i][3] +11), x*1070, y*369, tocolor(255, 254, 254, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false) end end end function TrocarPos(button) if isEventHandlerAdded("onClientRender",root,DxTest) then if isCursorOnElement(x*724, y*319, x*345, y*321) then if button == "mouse_wheel_down" then if #TabelasInfos > Pos[#Pos][1] then for i = 1,#Pos do Pos[i][1] = Pos[i][1] +1 end end elseif button == "mouse_wheel_up" then if Pos[1][1] ~= 1 then for i = 1,#Pos do Pos[i][1] = Pos[i][1] -1 end end end end end end bindKey("mouse_wheel_down", "down",TrocarPos) bindKey("mouse_wheel_up", "down",TrocarPos ) function SelecionarPos(b,s) if isEventHandlerAdded("onClientRender",root,DxTest) then if b == "left" and s == "down" then for i = 1,#Pos do if isCursorOnElement(x*Pos[i][2],y*Pos[i][3],x*Pos[i][4],y*Pos[i][5]) then if Selecionado ~= Pos[i][1] then Selecionado = Pos[i][1] else Selecionado = 0 end end end end end end addEventHandler("onClientClick",root,SelecionarPos) 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 isCursorOnElement(x, y, w, h) if (not isCursorShowing()) then return false end local mx, my = getCursorPosition() local fullx, fully = guiGetScreenSize() cursorx, cursory = mx*fullx, my*fully if cursorx > x and cursorx < x + w and cursory > y and cursory < y + h then return true else return false end end A Antiga ficou com muitas coisas desnecessárias, dei uma melhorada.
  8. function finalizartrab (player, dimension) -- <-- NÃO EXISTE O PARAMETRO THE VEHICLE NO ONMARKERHIT, AQUI SERIA DIMENSÃO if getElementData(player,"trabAviaoParte3") then if veh[player] and isElement(veh[player]) then local vehicle = getPedOccupiedVehicle(player) -- NÃO PRECISA COLOCAR VARIAS VARIAVEIS DE VEICULO PQ 1 JÁ BASTA if vehicle then local currentFreezeStatus = isElementFrozen ( vehicle ) local newFreezeStatus = not currentFreezeStatus setElementPosition(vehicle, 1477.443, 1712.498, 11.2 + 1.5) setElementRotation(vehicle, -0, 0, 359.225) setElementFrozen ( vehicle, true ) outputChatBox ( "[#FF0000 Aeronauta #000000]#FFFFFF Os passageiros estao deembarcando, aguarde...", player, 0, 0, 0, true ) setElementVisibleTo ( entraga3final, player, false ) setElementVisibleTo ( blipentrega3, player, false ) setElementData(player, "trabAviaoParte3", false) setElementData(player, "emTrabalho", false) setTimer (function() outputChatBox ( "[#FF0000 Aeronauta #000000]#FFFFFF Todos os passageiros deembarcaram. Voce terminou seu trabalho com sucesso!", sourplayerce, 0, 0, 0, true ) outputDebugString("[TrabAviao] "..getPlayerName(player):gsub("#%x%x%x%x%x%x","").." Completou o trabalho de aviao!",3,0,255,0) local model = getElementModel(vehicle) if model == 592 or model == 577 then outputChatBox ( "[#FF0000 Aeronauta #000000]#FFFFFF E Recebeu mais #00FF00R$45.000#FFFFFF por entregar com o Andromada ou AT-400, totalizando #00FF00R$75.000", player, 0, 0, 0, true ) givePlayerMoney (player, 45000) else outputChatBox ( "[#FF0000 Aeronauta #000000]#FFFFFF E Recebeu mais #00FF00R$30.000#FFFFFF, totalizando #00FF00R$60.000", player, 0, 0, 0, true ) givePlayerMoney (player, 30000) end destroyElement(veh[player]) veh[player] = nil end, 5000, 1) end end end end addEventHandler( "onMarkerHit", entraga3final, finalizartrab ) Você Estava Destruindo o Veiculo Dps Conferindo o Modelo Dele, Sendo que ele Não Existe Mais, Assim Causando o Erro.
  9. Bom aqui não é assunto para isso, mais tente F8, e coloque setradio LINK
  10. local progress = interpolateBetween(0,0,0,100,0,0,(getTickCount() - tick)/5000, "Linear") Não esqueça de coloca o tick = getTickCount() Ao abrir o painel, tbm utilize o math.floor para converter os números quebrados (1.5,2.5) para números inteiros [Apenas coloque se quiser utilizar em porcentagem (50%, 51%)]
  11. Você Pode Estar Utilizando o setTimer para colocar o delay, e identificar se ele passou por um ElementData ou por uma Tabela. Exemplo Que Recomendo : PassouMarker = {} Marker1 = createMarker ( 1005.14197, 831.82520, 32.85537, "cylinder", 1.5, 255, 255, 255, 50 ) function msg(thePlayer) if getElementType(thePlayer) == "player" then -- ISSO É PRA NÃO DAR ERRO NO DEBUG QUANDO PASSAR NO MARKER COM UM VEICULO if not PassouMarker[thePlayer] then outputChatBox("=============== ARMAS PRF ================",player, 0, 0, 255, true) outputChatBox("- Digite /rifle para pegar seu Rifle.",player, 255, 255, 0, true) outputChatBox("- Digite /sub para pegar sua Submetralhadora.",player, 255, 255, 0, true) outputChatBox("- Digite /shotgun para pegar sua Shotgun.",player, 255, 255, 0, true) outputChatBox("- Digite /deagle para pegar sua Pistola.",player, 255, 255, 0, true) outputChatBox("- Digite /tazer para pegar seu Tazer.",player, 255, 255, 0, true) outputChatBox("- Digite /cacetete para pegar seu Cacetete.",player, 255, 255, 0, true) outputChatBox("=============== ARMAS PRF ================",player, 0, 0, 255, true) PassouMarker[thePlayer] = true setTimer(function() PassouMarker[thePlayer] = false end,5000,1) -- 5000 = 5 Segundos, o 1 Seria Para Só Fazer 1 vez end end end addEventHandler("onMarkerHit", Marker1, msg) Outro Exemplo : Marker1 = createMarker ( 1005.14197, 831.82520, 32.85537, "cylinder", 1.5, 255, 255, 255, 50 ) function msg(thePlayer) if getElementType(thePlayer) == "player" then -- ISSO É PRA NÃO DAR ERRO NO DEBUG QUANDO PASSAR NO MARKER COM UM VEICULO if not getElementData(thePlayer, "PassouMarker") then outputChatBox("=============== ARMAS PRF ================",player, 0, 0, 255, true) outputChatBox("- Digite /rifle para pegar seu Rifle.",player, 255, 255, 0, true) outputChatBox("- Digite /sub para pegar sua Submetralhadora.",player, 255, 255, 0, true) outputChatBox("- Digite /shotgun para pegar sua Shotgun.",player, 255, 255, 0, true) outputChatBox("- Digite /deagle para pegar sua Pistola.",player, 255, 255, 0, true) outputChatBox("- Digite /tazer para pegar seu Tazer.",player, 255, 255, 0, true) outputChatBox("- Digite /cacetete para pegar seu Cacetete.",player, 255, 255, 0, true) outputChatBox("=============== ARMAS PRF ================",player, 0, 0, 255, true) setElementData(thePlayer,"PassouMarker",true) setTimer(function() setElementData(thePlayer,"PassouMarker",false) end,5000,1) -- 5000 = 5 Segundos, o 1 Seria Para Só Fazer 1 vez end end end addEventHandler("onMarkerHit", Marker1, msg)
  12. Desculpe a fala um pouco nada haver mais por mim seria um pouco mais para programação, pois queria utilizar as proxys para reutiliza-las em um fetchRemote. Mais Sem Problemas
  13. Uma Dúvida Que Estou Tendo, é possível a utilização de uma api de proxys no MTA ?
×
×
  • Create New...