BriGhtx3 Posted September 5, 2012 Posted September 5, 2012 Hey, always when I set the control state to crouched then the player crouches for a second and immediately stands up again. I want the player to always walk crouched and disable sprinting and walking when he is standing: toggleControl("jump",false) toggleControl("sprint",false) toggleControl("walk",false) setControlState("crouch",true) Why doesn't this work? It is in a function and clientside Currently working on gamemodes : Reallife Script 70% Breakout Script 10%
TwiX! Posted September 5, 2012 Posted September 5, 2012 show your code and meta - Working on [php/HTML/Mysql/Lua/Java Scripts/Web Design/3D Modeling]
BriGhtx3 Posted September 5, 2012 Author Posted September 5, 2012 I already posted my code. And Im not that dump to make mistakes in the meta. As you see the player already gets crouched but he stands up immediately. Currently working on gamemodes : Reallife Script 70% Breakout Script 10%
DiSaMe Posted September 5, 2012 Posted September 5, 2012 You need to set crouching control state to false after a short delay, so that it would be like pressing crouching button instead of holding it down. -
Jaysds1 Posted September 5, 2012 Posted September 5, 2012 (edited) try this: toggleControl("walk",false) toggleControl("sprint",false) toggleControl("jump",false) setControlState("crouch",true) setTimer(setControlState,1000,1,"crouch",false) Edited September 5, 2012 by Guest My in-game name: Jaysds1 Retired CMG Scripter World Of Tanks GameMode (Open-Source): https://github.com/Jaysds1/mtasa-wot-gamemode Online GUI-Editor (WIP): https://forum.mtasa.com/topic/47678-online-gui-editor/
Anderl Posted September 5, 2012 Posted September 5, 2012 try this:toggleControl("walk",false) toggleControl("sprint",false) toggleControl("jump",false) setControlState("crouch",true) setTimer(setControlState,1000,1,"crouch",true) That'll do the same. As CrystalMV said, it should be set as false after a short time.. "[...] If you don’t love it, if you’re not having fun doing it, you don’t really love it, you’re going to give up." - Steve Jobs, 2007
BriGhtx3 Posted September 6, 2012 Author Posted September 6, 2012 (edited) Works now I set delay to 100. Thank you Edited September 10, 2012 by Guest Currently working on gamemodes : Reallife Script 70% Breakout Script 10%
Jaysds1 Posted September 7, 2012 Posted September 7, 2012 nice to see it working, have fun My in-game name: Jaysds1 Retired CMG Scripter World Of Tanks GameMode (Open-Source): https://github.com/Jaysds1/mtasa-wot-gamemode Online GUI-Editor (WIP): https://forum.mtasa.com/topic/47678-online-gui-editor/
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