Jump to content

GTX

Members
  • Posts

    1,273
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by GTX

  1. local sound setTimer(function() local vehicle = getPedOccupiedVehicle(localPlayer) if vehicle and getElementModel(vehicle) ~= 476 then local vx,vy,vz = getElementVelocity(vehicle) if vx+vy+vz == 0 then if sound then setSoundPaused(sound,true) end else if not sound then sound = playSound("sounds/sound.mp3") setSoundVolume(sound, 0.1) else setSoundPaused(sound,false) end end elseif sound then setSoundPaused(sound,true) end end,1000,0) function stopSound() setSoundPaused(sound, true) end addEventHandler("onClientPlayerWasted", root, stopSound)
  2. GTX

    my source bugs

    Sometimes it's good to let those errors be there. Errors are pretty self-explanatory, you can fix them by yourself.
  3. GTX

    Flags

    You need to edit scoreboard. I told you it's not possible out of the script.
  4. GTX

    Help MTA Browser

    CEF isn't that stable yet, so yeah, it might be a bug.
  5. Draw an image over whole screen then. And if you want, set player's alpha to 0, to hide the player.
  6. GTX

    Split Dx

    local scrX, scrY = guiGetScreenSize() local rtarget = dxCreateRenderTarget(400, 400, true) dxSetRenderTarget(rtarget, true) dxDrawText("TEST TEXT - 1", 0, -25, scrX, scrY, tocolor(255, 255, 255, 255), 1.00, "bankgothic", "center", "center", true, false, false, true, false) dxDrawText("TEST TEXT - 2", 0, 25, scrX, scrY, tocolor(255, 255, 255, 255), 1.00, "bankgothic", "center", "center", true, false, false, true, false) dxSetRenderTarget() addEventHandler("onClientRender", root, function() dxDrawImage(0, 0, x, y, rtarget) end)
  7. To zoom in the camera, you need setCameraMatrix, and no, it's not only for a static point.
  8. GTX

    Split Dx

    Why do you want to complicate it much more? Anyways: dxCreateRenderTarget dxSetRenderTarget
  9. GTX

    Split Dx

    Hmm, I see. It's because colorCoded argument was true. This is an example which should clip text a bit on both sides: local scrX, scrY = guiGetScreenSize() addEventHandler("onClientRender", root, function() dxDrawText("TEST TEXT - 1", 100, 255, 100+100, 255+20, tocolor(255, 255, 255, 255), 1.00, "bankgothic", "left", "top", true, false, false, false, false) end)
  10. GTX

    Split Dx

    To clip text correctly: You must calculate the width and height of DX text like: X (of DX text) + Your desired width and Y (of DX text) + Your desired height An example would be. dxDrawText("TEST TEXT - 2", 100, 255, 100+50, 255+40, tocolor(255, 255, 255, 255), 1.00, "bankgothic", "center", "center", true, false, false, true, false) -- 50 and 40 are my width and height.
  11. GTX

    Split Dx

    local scrX, scrY = guiGetScreenSize() addEventHandler("onClientRender", root, function() dxDrawText("TEST TEXT - 1", 0, -25, 100, -25, tocolor(255, 255, 255, 255), 1.00, "bankgothic", "center", "center", false, false, false, true, false) dxDrawText("TEST TEXT - 2", 0, 25, 100, 25, tocolor(255, 255, 255, 255), 1.00, "bankgothic", "center", "center", false, false, false, true, false) end)
  12. GTX

    Split Dx

    What do you mean by split? This? local scrX, scrY = guiGetScreenSize() addEventHandler("onClientRender", root, function() dxDrawText("TEST TEXT - 1", 0, -25, scrX, scrY, tocolor(255, 255, 255, 255), 1.00, "bankgothic", "center", "center", false, false, false, true, false) dxDrawText("TEST TEXT - 2", 0, 25, scrX, scrY, tocolor(255, 255, 255, 255), 1.00, "bankgothic", "center", "center", false, false, false, true, false) end)
  13. function renderUI() dxDrawText("BUY",538.0,380.0,611.0,398.0,tocolor(255,255,255,255),1.0,"arial","left","top",false,false,true) if isMouseInPosition(661, 296, 19, 16) then dxDrawRectangle(661.0,296.0,19.0,16.0,tocolor(150,0,0,200),false) else dxDrawRectangle(661.0,296.0,19.0,16.0,tocolor(0,0,0,200),false) end end addEventHandler("onClientResourceStart", resourceRoot, function() addEventHandler("onClientRender", root, renderUI) end ) function isMouseInPosition ( x, y, width, height ) if ( not isCursorShowing ( ) ) then return false end local sx, sy = guiGetScreenSize ( ) local cx, cy = getCursorPosition ( ) local cx, cy = ( cx * sx ), ( cy * sy ) if ( cx >= x and cx <= x + width ) and ( cy >= y and cy <= y + height ) then return true else return false end end
  14. Exchange the function in it. Line 57.
  15. It's not multiplied, it's based on totally different script. Can you check the discussion before replying to the topic? And reported for what?
  16. Didn't know that function was on wiki, lol. I copied it from another topic, where I helped someone and yeah, I forgot to add that. Anyways; if isMouseInPosition(661, 296, 19, 16) then dxDrawRectangle(661.0,296.0,19.0,16.0,tocolor(150,0,0,200),false) else dxDrawRectangle(661.0,296.0,19.0,16.0,tocolor(0,0,0,200),false) end function isMouseInPosition ( x, y, width, height ) if ( not isCursorShowing ( ) ) then return false end local sx, sy = guiGetScreenSize ( ) local cx, cy = getCursorPosition ( ) local cx, cy = ( cx * sx ), ( cy * sy ) if ( cx >= x and cx <= x + width ) and ( cy >= y and cy <= y + height ) then return true else return false end end
  17. Why double post? No wonder you have 1k posts. function destroySound() stopSound(sound) end addEventHandler("onClientPlayerWasted", root, destroySound)
  18. GTX

    animation

    function buy(button,state) if (button == "left" and state == "up") then if (source == buybtn) then takePlayerMoney ( 1000 ) setPedAnimation( localPlayer,"BAR", "dnk_stndF_loop", 5000, false, false, false, false ) --- after this how i can start next this animation? idk how to use setTimer setTimer(setPedAnimation, 5000, 1, localPlayer,"BAR", "dnk_stndM_loop", 5000, false, false, false, false ) removeEventHandler("onClientRender", root, dx) showCursor(false) end end end addEventHandler("onClientGUIClick", getRootElement(), buy)
  19. Put client-sided script first to load in meta. Also, I suggest you to not use these functions as they may have some kind of exploit.
  20. function isMouseInPosition(a, b, c, d) if not isCursorShowing() then return end local x, y = getCursorPosition() x, y = x*sx, y*sy if x >= a and y >= b and x <= a+c and y <= b+d then return true end return false end if isMouseInPosition(661, 296, 19, 16) then -- Do your thing end
  21. GTX

    help

    That's not possible.
  22. GTX

    attach

    Simply set object position above player.
  23. GTX

    not team kill

    Well, if you really want an event: addEventHandler("onResourceStart", resourceRoot, function() setTeamFriendlyFire(getTeamFromName("GERMAN"), false) end )
×
×
  • Create New...