WiBox Posted September 19, 2018 Share Posted September 19, 2018 function weed() if ( getElementData( localPlayer, "onWeed") == true) then if ( isPedDoingTask( localPlayer, "TASK_SIMPLE_JUMP" ) ) then setGravity(0.0045) else setGravity(0.008) end end end addEventHandler("onClientRender", root, weed) I've a drugs system.. I want only when the player jump the gravity goes 0.0045.. I used that code but not working, any ideas? Link to comment
Z4Zy Posted September 19, 2018 Share Posted September 19, 2018 Hi ! If you are looking for extra jump power when player takes the drug, then I suggest you to use the function "setWorldSpecialPropertyEnabled" in this occasion to enable / disable player's extra jump property. setWorldSpecialPropertyEnabled("extrajump",true) -- enable power setWorldSpecialPropertyEnabled("extrajump",false) -- disable power And this is client side and you shouldn't run this by the event "onClientRender" Link to comment
WiBox Posted September 19, 2018 Author Share Posted September 19, 2018 That's a new thing to me, thanks a lot! But I need to ask, that's jump is so high , it can't be changed? Link to comment
Z4Zy Posted September 19, 2018 Share Posted September 19, 2018 Hey ! "setPedStat" has some options to change player's jumping stats under 139 and 140. Check it out ! Link to comment
WiBox Posted September 19, 2018 Author Share Posted September 19, 2018 Thank you, I appreciate that Link to comment
WiBox Posted September 19, 2018 Author Share Posted September 19, 2018 function weedEffect( player ) setPedStat( player, 139, 1000) setPedStat( player, 140, 1000) end addCommandHandler("test", weedEffect) I was testing it.. The jump distance and the jump high didn't change 1%.. Link to comment
WiBox Posted September 19, 2018 Author Share Posted September 19, 2018 Explaining what I need: I need when I jump, the gravity changes to 0.0045, at gravity 0.0045 I got the perfect the distance and the high of the jump which I need, I tried to use setGravity it worked perfectly, but what happend is the grenade is effected from the gravity.. the grenade get throw for a longer distance.. I just want when he jump he'll jump a bit higher and a for an higher distance.. 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