MitnickP56 Posted September 10, 2016 Posted September 10, 2016 Hi. I'm trying to do script while which block control HORN from other keys than ( H // CAPSLOCK) Code server: function klakson (source) if (isKeyBound (source,"capslock")) or (isKeyBound (source,"h")) then setControlState (source, "horn", true ) outputChatBox ("on",getRootElement(),255,0,0,true) -- only information else toggleControl ( "horn", false ) outputChatBox (source,"off",getRootElement(),255,0,0,true) -- only information end end addEventHandler ("onClientResourceStart",getRootElement(),klakson) Any ideas? ;/
Simple0x47 Posted September 10, 2016 Posted September 10, 2016 (edited) You should insert that into an OnClientRender and trigger created server events Edited September 10, 2016 by Simple01
aka Blue Posted September 10, 2016 Posted September 10, 2016 Try this: function klakson () if (isKeyBound (source,"capslock")) or (isKeyBound (source,"h")) then setControlState (source, "horn", true ) outputChatBox ("on",getRootElement(),255,0,0,true) -- only information else toggleControl ( "horn", false ) outputChatBox (source,"off",getRootElement(),255,0,0,true) -- only information end end addEventHandler ("onPlayerJoin",getRootElement(),klakson)
MitnickP56 Posted September 10, 2016 Author Posted September 10, 2016 55 minutes ago, aka Blue said: Try this: function klakson () if (isKeyBound (source,"capslock")) or (isKeyBound (source,"h")) then setControlState (source, "horn", true ) outputChatBox ("on",getRootElement(),255,0,0,true) -- only information else toggleControl ( "horn", false ) outputChatBox (source,"off",getRootElement(),255,0,0,true) -- only information end end addEventHandler ("onPlayerJoin",getRootElement(),klakson) Not working.
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