itHyperoX Posted March 25, 2017 Share Posted March 25, 2017 (edited) Hi. I made a script, player can change hes walking styles. But when i'm alt +tabing, and heading back to MTA, the player again run. What can i do? Here is the code. addEvent("swatWalking",true) addEventHandler("swatWalking",root, function() outputChatBox("#FFFFFFYou changed your walking style to #D75959'SWAT'.",source,255,255,255,true) setPedWalkingStyle(source, 118) setElementData(source,"account:WalkingStyle",118) if getElementData(source,"walking") == true then setControlState(source,"walk",true) end end) Edited March 25, 2017 by TheMOG Link to comment
NeXuS™ Posted March 25, 2017 Share Posted March 25, 2017 (edited) Disable sprinting if he is not holding space. setControlState(localPlayer, "sprint", false) bindKey("space", "both", function() if getKeyState("space") then setPedControlState(localPlayer, "sprint", true) else setPedControlState(localPlayer, "sprint", false) end end) Should work, not tested tho. Edited March 25, 2017 by NeXuS™ Link to comment
itHyperoX Posted March 25, 2017 Author Share Posted March 25, 2017 (edited) fixed ty anyway Edited March 25, 2017 by TheMOG 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