Is player in air.
#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


Messages In This Thread
Is player in air. - by Stigg - 07.02.2011, 17:57
Re: Is player in air. - by Mauzen - 07.02.2011, 18:10
Re: Is player in air. - by Stigg - 07.02.2011, 18:13
Re: Is player in air. - by Mean - 07.02.2011, 18:42

Forum Jump:


Users browsing this thread: 1 Guest(s)