Is player in air.
#1

Is it possible to detect if a player is in the air but not in a Aircraft ?
Eg: Using a parachute or sky diving. Thanks.

Peace...
Reply
#2

You could check for different animations with GetPlayerAnimationIndex.

Example:
pawn Код:
public IsPlayerSkydiving(playerid)           //true if player is falling with a closed parachute
{
    new index = GetPlayerAnimationIndex(playerid)
    return (index >= 958 && index <= 962);
}

public IsPlayerUsingParachute(playerid)    //true if player is falling with an opened parachute
{
    new index = GetPlayerAnimationIndex(playerid)
    return (index >= 963 && index <= 979);
}
A combination of all falling animations would tell you if a player is in the air. Another solution would be the MapAndreas include. You would check if the player's Z coordinate is above the ground then. More effective against airbreak, but you wont get information about how a player is falling.


The indexes are taken from Slices enum: https://sampforum.blast.hk/showthread.php?tid=172649
Reply
#3

Thanks, i'll give that ago.

Peace...
Reply
#4

Mauzen you rock!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)