Jump to content

Cursor


CRX

Recommended Posts

Posted

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?

Sorry for my English...

Posted

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

Ingame Name : |DGT|Puma

DGT Clan Server 24/7 Owner/Scripter

MultiGameMode in progress :

n-560x95_FFFFFF_FFFFFF_0283C4_000000.png

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

CiTLh.png
Posted
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:

Sorry for my English...

Posted

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) 
  

CiTLh.png
Posted
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.

Sorry for my English...

Posted

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) 

Posted
<meta> 
    <info author="CRX" type="script" name="Cursor" /> 
  
    <script src="cursor.lua" type="client"/> 
</meta> 

Sorry for my English...

Posted

meta is good

now what is not work?

i think you have another resource that showing the cursor and you can't hide it from other resource ^^

CiTLh.png
Posted
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.

Posted

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

Ingame Name : |DGT|Puma

DGT Clan Server 24/7 Owner/Scripter

MultiGameMode in progress :

n-560x95_FFFFFF_FFFFFF_0283C4_000000.png

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

CiTLh.png

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