Jump to content

isElementInWater returns True when getting in car


Jakus

Recommended Posts

Hey,

I'm just using a loop that checks if the player is in water. But it also triggers when the player is getting in the car, only for the short duration of the animation. Any help? :D

Sorry if its been answered before...

Cheers

Link to comment

Use

getPedTask 

function IsElementInWater( pElement ) 
    if  
        pElement and  
        isElement( pElement ) and  
        getElementType( pElement ) == 'player' or getElementType( pElement ) == 'ped'  
    then 
        return getPedTask( pElement, 'primary', 2 ) == 'TASK_COMPLEX_IN_WATER' 
    end 
    return false 
end 

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...