Jump to content

Artenos

Members
  • Posts

    20
  • Joined

  • Last visited

Everything posted by Artenos

  1. I'm doing the animations like you showed me in one of my other posts: local start = getTickCount() local one, one1 = 0, 0 ---- The coordinates of the beginning local two, two1 = 319, 109 ---- The coordinates of the end addEventHandler("onClientRender", root, function() local now = getTickCount() local x,y = interpolateBetween(one, one1, 0, two, two1, 0, (now - start) / ((start + 1500) - start), "Linear") dxDrawRectangle(x,y, 680, 750, tocolor(0, 0, 0, 130), false) end) something simple
  2. I think I would try to use this...somehow
  3. Didn't you read my other comment?
  4. The whole code is at the very top.
  5. it works but it's not doing the animations
  6. Hey guys so I'm trying to create a window made out of dx drawings, I want to be able to use the same bind to open it and close it, But I also want it to be animated when it opens and closes. So far its not working. This is what I got so far: Client local screenW, screenH = guiGetScreenSize() local start = getTickCount() ---Variables----- local one, one1 = screenW * 1.0000, screenH * 0.0000 ---- The coordinates of the beginning local two, two1 = screenW * 0.8477, screenH * 0.0000 ---- The coordinates of the end -------------------------------------- ----DxDrawings and Animations----- function PanelOpen() local width, height = screenW * 0.1523, screenH * 1.0000 ---- The size of the dx rectangle local now = getTickCount() local x,y = interpolateBetween(one, one1, 0, two, two1, 0, (now - start) / ((start + 1000) - start), "OutBounce") dxDrawRectangle(x,y, width, height, tocolor(0, 0, 0, 164), false) end function PanelClose() local width, height = screenW * 0.1523, screenH * 1.0000 ---- The size of the dx rectangle local now = getTickCount() local x,y = interpolateBetween(two, two1, 0, one, one1, 0, (now - start) / ((start + 1000) - start), "Linear") dxDrawRectangle(x,y, width, height, tocolor(0, 0, 0, 164), false) end ------------------------------ -------Render of the drawings------------- function RenderPanel() addEventHandler("onClientRender", root, PanelOpen) end function RenderPanel2() addEventHandler("onClientRender", root, PanelClose) end ------------------------------------------ ---------Binds----------- bindKey("U", "down", RenderPanel) bindKey("U", "up", RenderPanel2)
  7. doesn't that only work with images?
  8. easy : # local start = getTickCount() local one, one1 = 0, 0 ---- The coordinates of the beginning local two, two1 = 319, 109 ---- The coordinates of the end addEventHandler("onClientRender", root, function() local now = getTickCount() local x,y = interpolateBetween(one, one1, 0, two, two1, 0, (now - start) / ((start + 1500) - start), "Linear") dxDrawRectangle(x,y, 680, 750, tocolor(0, 0, 0, 130), false) end) I get it now the x,y and the width and height can be manipulated by the interpolate effect, easy enough. Thanks dude!.
  9. Thank you for the help guys How would I do it so that it slides instead like this:
  10. Hello, so I'm using PaiN^'s [GIE] GUI Interpolate Effects resource (https://forum.multitheftauto.com/viewtopic.php?f=108&t=64608/viewtopic.php?f=108&t=64608) to add animations to my dxrectangle but everytime I run the script it outputs "Not GUI Element" does this mean it doesn't work with dx? if so is there any other way to give simple animations to dx elements? this is the code local screenW, screenH = guiGetScreenSize() ------start---------------- startX = screenW * 0.6486 startY = screenH * 0.4583 startW = screenW * 0.1208 startH = screenH * 0.3151 -----end------------------- endX = screenW * 0.8367 endY = screenH * 0.4583 endW = screenW * 0.1208 endH = screenH * 0.3151 addEventHandler("onClientResourceStart", resourceRoot, function() rec1 = dxDrawRectangle(screenW * 0.6486, screenH * 0.4583, screenW * 0.1208, screenH * 0.3151, tocolor(255, 255, 255, 255), false) exports.gie.guiAddInterpolateEffect( rec1, startX, startY, startW, startH, endX, endY, endW, endH, 5, Linear, Linear, 1 ) end )
  11. Nevermind I manage to remove the window by command Now I just need to know how to stop it from making the window everytime I click on the character
  12. by the way how would I do it so that it removes the window when I click on the player again?
  13. No , sorry if you misunderstood what I said, here let me rephrase it: Basically what I want to accomplish is whenever a player clicks on themself the function should show the window. The window should NOT show if the player clicks on a ped or another player, so basically the opposite of what you said .
  14. so basically the same as creating a gui menu whenever a player clicks on a ped but this time whenever the player clicks on himself/herself it would display a dxrectangle here is what I got so far: function onPlayerClick(button, state, absX, absY, wx, wy, wz, element) if (element and getElementType(element) == "player" and state=="down") then local x, y, z = getElementPosition(localPlayer) if (getDistanceBetweenPoints3D(x, y, z, wx, wy, wz) <=3) then RenderHolo() end end end addEventHandler("onClientClick", getRootElement(), onPlayerClick) function RenderHolo function RenderHolo( startedRes) local thePlayer = getLocalPlayer () local x, y, z = getElementPosition ( thePlayer ) local r = getPedRotation ( thePlayer ) x = x - math.sin ( math.rad(r) ) * 1 y = y + math.cos ( math.rad(r) ) * 1 local holoscreen,RT_ID,RTE = createHoloScreen(x,y,z,-2,0,r,1.35,2) --Create our holoscreen setElementData(holoscreen,"interactive","aim") -- Make it interactive on user aim if RTE then -- If we got the render Target of the screen then RTE_Demo = RTE RTE_Holo = holoscreen addEventHandler ( "onHoloScrenRender", RTE_Holo,drawHoloDemo) -- Event handler for every render of the holo screen end end
  15. alright I got it working now thanks for the help dude
  16. well now it doesn't show any errors but it doesn't work, its not showing the dxrectangle and I exported the function to use it in my own script.
  17. Hi guys I've been working on some holographic dxRectangles and basically what I'm trying to accomplish is to be able to create a holographic dxrectangle in front of a player whenever the function is triggered by using the command "/startholo", however I get a few errors and I was wondering if anyone could lend me a hand. this are the warnings and the error I get: WARNING: TGZHolo\TGH_Client.lua:7: Bad argument @ 'getElementPosition' [Expected element at argument 1, got string 'startholo'] WARNING: TGZHolo\TGH_Client.lua:8: Bad argument @ 'getPlayerRotation' [Expected element at argument 1, got string 'startholo'] ERROR: TGZHolo\TGZH_Client.lua:9: bad argument #1 to 'rad' (number expected, got boolean) here is the code: local px, py = guiGetScreenSize() RTE_Demo = nil RTE_Holo = nil function RenderHolo( thePlayer, startedRes, command ) local x, y, z = getElementPosition ( thePlayer ) local r = getPlayerRotation ( thePlayer ) x = x - math.sin ( math.rad(r) ) * 20 y = y + math.cos ( math.rad(r) ) * 20 local holoscreen,RT_ID,RTE = exports.holo:createHoloScreen(x,y,z,20,0,90,1.35,2) --Create our holoscreen setElementData(holoscreen,"interactive","aim") -- Make it interactive on user aim if RTE then -- If we got the render Target of the screen then RTE_Demo = RTE RTE_Holo = holoscreen addEventHandler ( "onHoloScrenRender", RTE_Holo,drawHoloDemo) -- Event handler for every render of the holo screen end end function drawHoloDemo() local width, height = dxGetMaterialSize(RTE_Demo) dxSetRenderTarget(RTE_Demo,true) -- dxDrawRectangle(0, 0, px * 0.1179, py * 0.0807, tocolor(211, 211, 211, 66), false) dxDrawRectangle(0, 0, px * 0.0198, py * 0.0807, tocolor(10, 190, 188, 255), false) dxSetRenderTarget() end addCommandHandler ( "startholo", RenderHolo ) P.D: I'm not good at making titles
×
×
  • Create New...