MitnickP56 Posted September 10, 2016 Share 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? ;/ Link to comment
Simple0x47 Posted September 10, 2016 Share Posted September 10, 2016 (edited) You should insert that into an OnClientRender and trigger created server events Edited September 10, 2016 by Simple01 Link to comment
aka Blue Posted September 10, 2016 Share 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) Link to comment
MitnickP56 Posted September 10, 2016 Author Share 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. 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