Search the Community

Showing results for tags 'object preview'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Multi Theft Auto: San Andreas 1.x
    • Support for MTA:SA 1.x
    • User Guides
    • Open Source Contributors
    • Suggestions
    • Ban appeals
  • General MTA
    • News
    • Media
    • Site/Forum/Discord/Mantis/Wiki related
    • MTA Chat
    • Other languages
  • MTA Community
    • Scripting
    • Maps
    • Resources
    • Other Creations & GTA modding
    • Competitive gameplay
    • Servers
  • Other
  • Archive
  • Private Bugtracker

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


About Me


Gang


Location


Occupation


Interests

Found 3 results

  1. 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.
  2. Iae rapaziada, seguinte estou usando o resource Object_Preview para fazer um scoreboard, porém estou com um certo problema. O resource cria o ped atrás da imagem de fundo, vou mandar as fotos para deixar mais cla que estou falando... Sem o Fundo: Com o Fundo: Partes do code: imgs/fundoP.png = ao fundo(azul) dxDrawImage(x*135, y*93, x*796, y*538, "imgs/ScoreFundo.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawImage(x*623, y*123, x*269, y*480, "imgs/fundoP.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) function CriarPed() local x1, y1, z1 = getCameraMatrix() myElement = createPed(getElementModel(localPlayer), x1, y1, z1) Preview = exports.Object_Preview:createObjectPreview(myElement, 0, 0, 180, 0.352, 0.28, 0.377, 0.375, false, false, true) end function abrir () if Scorebd_RDS == false then CriarPed() addEventHandler("onClientRender", root, MostrarScore) Scorebd_RDS = true showChat(false) for id, hudComponents in ipairs(hudTable) do setPlayerHudComponentVisible(hudComponents, false) end else removeEventHandler("onClientRender", root, MostrarScore) Scorebd_RDS = false showChat(true) exports.Object_Preview:destroyObjectPreview(Preview) destroyElement (myElement) myElement = nil for id, hudComponents in ipairs(hudTable) do setPlayerHudComponentVisible(hudComponents, true) end end end bindKey("tab", "both", abrir) Obs: talvez o problema seja devido ao evento OnClientRender. Pois acredito eu que, enquanto ativado o evento ele fica renderizando na tela do Player tipo um loop bem rapido! Enquanto isso o Ped só é criado uma unica vez. Por isto a sobreposição da Imagem sobre o Ped! Não queria adicionar o Ped no Evento onClientRender por motivos de lag! Alguém conhece uma outra forma?
  3. Hello guys! I'm having a little problem, I'm a beginner in scripting and I was using the Object_Preview resource in a script, and I saw an example of it in GUI, but I do not know how to do it in Dx. GUI EXAMPLE: https://wiki.multitheftauto.com/wiki/Resource:Object_preview Code: local dxfont0_fonte = dxCreateFont("font/fonte.ttf", 10) local myObject,myElement = nil, nil local screenW, screenH = guiGetScreenSize() local resW, resH = 1360,768 local x, y = (screenW/resW), (screenH/resH) 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 menu() color = tocolor(0, 0, 0, 185) if isCursorOnElement(screenW * 0.3294, screenH * 0.3307, screenW * 0.3360, screenH * 0.0495) then -- M4 --exports.preview:setPositionOffsets(m4view,0,1.5,0.1) --exports.preview:setRotation(m4view, getTickCount()/10, 0, 0) color = tocolor(16, 102, 231, 100) end color2 = tocolor(0, 0, 0, 185) if isCursorOnElement(screenW * 0.3294, screenH * 0.3802, screenW * 0.3360, screenH * 0.0495) then -- Desert color2 = tocolor(16, 102, 231, 100) end color3 = tocolor(0, 0, 0, 185) if isCursorOnElement(screenW * 0.3294, screenH * 0.4297, screenW * 0.3360, screenH * 0.0495) then -- Cacetete color3 = tocolor(16, 102, 231, 100) end color4 = tocolor(0, 0, 0, 185) if isCursorOnElement(screenW * 0.3294, screenH * 0.4792, screenW * 0.3360, screenH * 0.0495) then -- Vida e colete color4 = tocolor(16, 102, 231, 100) end colorF = tocolor(0, 0, 0, 0) if isCursorOnElement(screenW * 0.6544, screenH * 0.2656, screenW * 0.0228, screenH * 0.0469) then colorF = tocolor(255, 0, 0, 150) end myElement = createObject(356,0,0,0) myObject = exports.preview:createObjectPreview(myElement,0,0,1,1,1,1, true, true, true) dxDrawRectangle(screenW * 0.3221, screenH * 0.2656, screenW * 0.3551, screenH * 0.4844, tocolor(0, 0, 0, 185), false) dxDrawRectangle(screenW * 0.3221, screenH * 0.2656, screenW * 0.3551, screenH * 0.0469, tocolor(0, 0, 0, 185), false) dxDrawText("Menu de itens - #1066E7PMESP", screenW * 0.3294, screenH * 0.2786, screenW * 0.4971, screenH * 0.3242, tocolor(255, 255, 255, 200), x*1.00, dxfont0_fonte, "left", "top", false, false, false, true, false) dxDrawRectangle(screenW * 0.6544, screenH * 0.2656, screenW * 0.0228, screenH * 0.0469, colorF, false) dxDrawText("X", screenW * 0.6618, screenH * 0.2786, screenW * 0.8294, screenH * 0.3242, tocolor(255, 255, 255, 200), x*1.30, "default-bold", "left", "top", false, false, false, true, false) dxDrawRectangle(screenW * 0.3294, screenH * 0.3307, screenW * 0.3360, screenH * 0.0495, color, false) dxDrawText("(#1066E7Armamento#FFFFFF) M4", screenW * 0.3368, screenH * 0.3438, screenW * 0.5044, screenH * 0.3893, tocolor(255, 255, 255, 200), x*1.00, dxfont0_fonte, "left", "top", false, false, false, true, false) dxDrawRectangle(screenW * 0.3294, screenH * 0.3802, screenW * 0.3360, screenH * 0.0495, color2, false) dxDrawText("(#1066E7Armamento#FFFFFF) Desert Eagle", screenW * 0.3368, screenH * 0.3932, screenW * 0.5044, screenH * 0.4388, tocolor(255, 255, 255, 200), x*1.00, dxfont0_fonte, "left", "top", false, false, false, true, false) dxDrawRectangle(screenW * 0.3294, screenH * 0.4297, screenW * 0.3360, screenH * 0.0495, color3, false) dxDrawText("(#1066E7Armamento#FFFFFF) Cacetete", screenW * 0.3368, screenH * 0.4427, screenW * 0.5044, screenH * 0.4883, tocolor(255, 255, 255, 200), x*1.00, dxfont0_fonte, "left", "top", false, false, false, true, false) dxDrawRectangle(screenW * 0.3294, screenH * 0.4792, screenW * 0.3360, screenH * 0.0495, color4, false) dxDrawText("Vida e Colete", screenW * 0.3368, screenH * 0.4922, screenW * 0.5044, screenH * 0.5378, tocolor(255, 255, 255, 200), x*1.00, dxfont0_fonte, "left", "top", false, false, false, true, false) dxDrawRectangle(screenW * 0.3294, screenH * 0.5612, screenW * 0.3360, screenH * 0.1615, tocolor(0, 0, 0, 185), false) end function render() if not isEventHandlerAdded("onClientRender", root, menu) then addEventHandler("onClientRender", root, menu) showCursor(true) showChat(false) -- l_0_1 = true end end addEvent("openMenuPM", true) addEventHandler("openMenuPM", root, render) function close(_,state) if isEventHandlerAdded("onClientRender", root, menu) then if state == "down" then if isCursorOnElement(screenW * 0.6544, screenH * 0.2656, screenW * 0.0228, screenH * 0.0469) then showCursor(false) showChat(true) playSound("sfx/hit.mp3", false) removeEventHandler("onClientRender", root, menu) if l_0_1 then l_0_1 = false end end end end end addEventHandler("onClientClick", root, close) function m4(_,state) if isEventHandlerAdded("onClientRender", root, menu) then if state == "down" then if isCursorOnElement(screenW * 0.3294, screenH * 0.3307, screenW * 0.3360, screenH * 0.0495) then triggerServerEvent("m4", localPlayer) removeEventHandler("onClientRender", root, menu) showChat(true) showCursor(false) playSound("sfx/hit.mp3", false) if l_0_1 then l_0_1 = false end end end end end addEventHandler("onClientClick", root, m4) 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