Jump to content

Cursor


CRX

Recommended Posts

Hi!

I've problem with showCursor. I made script for show Cursor, but not working.

function toggleCursor () 
showCursor (true) 
end 
  
function bindKeys () 
bindKey ( "F3", "down", toggleCursor ) 
end 
addCommandHandler ( "bindme", bindKeys ) 

What wrong?

Link to comment
did you put it server side in meta?

if yes then change it to client

@1:

Edited, it didn't work.

this is client side if you put client side and not working use /debugscript 3 and post what error you got

@2:

I can't use debugscript, "Incorrect client type for this command".

@3:

function toggleCursor () 
showCursor(not isCursorShowing()) 
end 
  
addCommandHandler("bindme",function() 
bindKey("F3", "down", toggleCursor) 
end) 

:cry:

Any sugestions? :cry:

Link to comment

suggestion for WHAT?

this work 100%

function toggleCursor () 
showCursor(not isCursorShowing()) 
end 
  
addCommandHandler("bindme",function() 
bindKey("F3", "down", toggleCursor) 
end) 

did you write the command "bindme" in F8 ?

or maybe you want bind the key without command?

function toggleCursor () 
showCursor(not isCursorShowing()) 
end 
  
addEventHandler ("onClientResourceStart",resourceRoot,function() 
bindKey("F3", "down", toggleCursor) 
end) 

or this too can work

function toggleCursor () 
showCursor(not isCursorShowing()) 
end 
bindKey("F3", "down", toggleCursor) 
  

Link to comment
suggestion for WHAT?

this work 100%

function toggleCursor () 
showCursor(not isCursorShowing()) 
end 
  
addCommandHandler("bindme",function() 
bindKey("F3", "down", toggleCursor) 
end) 

did you write the command "bindme" in F8 ?

or maybe you want bind the key without command?

function toggleCursor () 
showCursor(not isCursorShowing()) 
end 
  
addEventHandler ("onClientResourceStart",resourceRoot,function() 
bindKey("F3", "down", toggleCursor) 
end) 

or this too can work

function toggleCursor () 
showCursor(not isCursorShowing()) 
end 
bindKey("F3", "down", toggleCursor) 
  

All of your codes not working.

Link to comment

maybe this work

function hidewindow() 
    guiSetVisible(window, false) 
    showCursor(false) 
end 
  
function showwindow() 
    guiSetVisible(window, true) 
    guiBringToFront(window) 
    showCursor(true) 
end 
    
function showhide() 
    if (guiGetVisible(window)) then hidewindow() 
    else Function() 
    showCursor(true) 
    end 
end 
bindKey( "F3", "up", showhide) 

Link to comment
maybe this work
function hidewindow() 
    guiSetVisible(window, false) 
    showCursor(false) 
end 
  
function showwindow() 
    guiSetVisible(window, true) 
    guiBringToFront(window) 
    showCursor(true) 
end 
    
function showhide() 
    if (guiGetVisible(window)) then hidewindow() 
    else Function() 
    showCursor(true) 
    end 
end 
bindKey( "F3", "up", showhide) 

Wtf Blawee ?!

He asked for a cursor, not for a GUI window.

Link to comment
TAPL: if you have the cursor showing from a resource you can hide it from another resource ...

did you read the wiki ?

https://wiki.multitheftauto.com/wiki/ShowCursor

Note that, regardless of the cursor state you set using this function, the cursor will always be visible while the menu, the chatbox input line or the console are active, or if another resource has called this function.

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...