Jump to content

isPedDoingTask


WiBox

Recommended Posts

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

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...