TorNix~|nR Posted December 15, 2017 Share Posted December 15, 2017 Hello guys, I need help please! when someone join to server, I want to set this function a() guiSetInputEnabled(true) guiSetInputMode ( "no_binds_when_editing" ) end addEventHandler("onClientPlayerJoin", getRootElement(), a) but it's not working, how can I make it for example when someone join, it disable using binds and when login back to normal? Link to comment
Melbourne Posted December 15, 2017 Share Posted December 15, 2017 Try cancelling onClientKey event when player joins 1 Link to comment
koragg Posted December 15, 2017 Share Posted December 15, 2017 @TorNix~|nR you want to disable chatbox binds (made with /bind + say hi for example) or what? Because if you see what 'guiSetInputMode' does on it's wiki, it's not that. 1 Link to comment
TorNix~|nR Posted December 15, 2017 Author Share Posted December 15, 2017 I want when a player join, he can not use the F1 F2 F3, for example all panels Link to comment
koragg Posted December 15, 2017 Share Posted December 15, 2017 3 minutes ago, TorNix~|nR said: I want when a player join, he can not use the F1 F2 F3, for example all panels Yeah, that will never work with 'guiSetInputMode'. You'll need to do something like if getElementData(localPlayer, "LoggedIn") == true then --open panel end client-side and something like this function onPlayerJoin() setElementData(source, "LoggedIn", false) end addEventHandler("onPlayerJoin", root, onPlayerJoin) function onPlayerLogin() setElementData(source, "LoggedIn", true) end addEventHandler("onPlayerLogin", root, onPlayerLogin) server-side. That's what I do and it works for me. Good luck 1 Link to comment
TorNix~|nR Posted December 15, 2017 Author Share Posted December 15, 2017 I used this guiSetInputEnabled(true) guiSetInputMode ( "no_binds" ) and it works by theway, I'm talking about the editbox it worked can not use the binds for example "L" "P" ... etc but the player can use the F1/F2/F3..... etc help please? Link to comment
Melbourne Posted December 15, 2017 Share Posted December 15, 2017 it works for me ( i don't speak english ) function join() addEventHandler("onClientKey", root, disableKeys) end addEventHandler("onClientPlayerJoin", root, join) function disableKeys(btn) if ( btn == "F1" or btn == "F2" or btn == "F3" ) then cancelEvent() end end -- or function disableKeys(btn) cancelEvent() end 1 Link to comment
TorNix~|nR Posted December 15, 2017 Author Share Posted December 15, 2017 Thank you guys 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