Jump to content

Replace cursor image to another image


Xwad

Recommended Posts

hi im trying to replace the cursors image with a script but its not working.:/ i hope you can help me thanks.

client.lua

  
function show() 
   local showing = isCursorShowing () 
   if showing then 
      local screenx, screeny = getCursorPosition() 
      dxDrawImage ( 5, 5, 50, 50, 'files/crosshair.png', screenx, screeny ) 
      setCursorAlpha(0) 
   end 
end 
addEventHandler('onClientRender', root, show )   
  
  
  

Link to comment
 --[b]UPDATED[/b] 
  
function show() 
   local showing = isCursorShowing () 
   if showing and ( cursorX ~= nil and cursorY ~= nil ) then 
      dxDrawImage ( cursorX, cursorY, 50, 50, 'files/crosshair.png') 
      setCursorAlpha(0) 
   end 
end 
addEventHandler('onClientRender', root, show ) 
  
addEventHandler( "onClientCursorMove", getRootElement( ), 
    function( _, _, absX, absY ) 
        cursorX = absX 
        cursorY = absY 
    end 
) 
  

Link to comment
setCursorAlpha(0) 
  
function show() 
   local showing = isCursorShowing () 
   if showing then 
      local screenx, screeny = getCursorPosition() 
      dxDrawImage(screenx, screeny, 50, 50, 'files/crosshair.png') 
   end 
end 
addEventHandler('onClientRender', root, show ) 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...