07.02.2011, 18:10
You could check for different animations with GetPlayerAnimationIndex.
Example:
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
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);
}
The indexes are taken from Slices enum: https://sampforum.blast.hk/showthread.php?tid=172649