CRX Posted October 28, 2011 Share Posted October 28, 2011 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
TAPL Posted October 28, 2011 Share Posted October 28, 2011 did you put it server side in meta? if yes then change it to client Link to comment
bandi94 Posted October 28, 2011 Share Posted October 28, 2011 this is client side if you put client side and not working use /debugscript 3 and post what error you got Link to comment
TAPL Posted October 28, 2011 Share Posted October 28, 2011 function toggleCursor () showCursor(not isCursorShowing()) end addCommandHandler("bindme",function() bindKey("F3", "down", toggleCursor) end) Link to comment
CRX Posted October 28, 2011 Author Share Posted October 28, 2011 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) Any sugestions? Link to comment
TAPL Posted October 28, 2011 Share Posted October 28, 2011 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
CRX Posted October 29, 2011 Author Share Posted October 29, 2011 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
Blaawee Posted October 29, 2011 Share Posted October 29, 2011 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
TAPL Posted October 29, 2011 Share Posted October 29, 2011 @-=I Blaawee I=- your code mess @CRX all codes i put here works and i am sure show your meta Link to comment
CRX Posted October 29, 2011 Author Share Posted October 29, 2011 <meta> <info author="CRX" type="script" name="Cursor" /> <script src="cursor.lua" type="client"/> </meta> Link to comment
TAPL Posted October 29, 2011 Share Posted October 29, 2011 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 ^^ Link to comment
CapY Posted October 29, 2011 Share Posted October 29, 2011 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
bandi94 Posted October 29, 2011 Share Posted October 29, 2011 TAPL: if you have the cursor showing from a resource you can hide it from another resource ... Link to comment
TAPL Posted October 29, 2011 Share Posted October 29, 2011 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now