Check if a player is on ground or in air.
#1

Hey guys,
I am trying to detect if a player is in the air...
now I remember that there was some function for this, but I can't really remember what was the name of that function.

I want to check if a player is above ground (world ground, not an object).
thanks for the helpers =)
Reply
#2

Above ground, means falling. So create a timer which detects the z axis difference. But people moving on ground, also have z axis differences. It's up to you to define how big that difference will be per value of time so that people of ground won't count as flying ones.
Reply
#3

Quote:
Originally Posted by HurtLocker
Посмотреть сообщение
Above ground, means falling. So create a timer which detects the z axis difference. But people moving on ground, also have z axis differences. It's up to you to define how big that difference will be per value of time so that people of ground won't count as flying ones.
yha but theres not a function to check if he is in the air or not? like to get the z of the ground below him and compare it to his current z.
Reply
#4

No, there's not.
Reply
#5

Quote:
Originally Posted by techg9
Посмотреть сообщение
yha but theres not a function to check if he is in the air or not? like to get the z of the ground below him and compare it to his current z.
Check for the "falling" animation.
Reply
#6

You can also use MapAndreas plugin by Kye or the include. Check if the player is not on the lowest part of the map. Then you go!

P.S. I would prefer the include
Reply
#7

pawn Код:
stock IsPlayerFalling(playerid)           //true if player is falling with a closed parachute
{
    new index = GetPlayerAnimationIndex(playerid);
    if(index >= 958 && index <= 979 || index == 1130 || index == 1195 || index == 1132) return 1;
    return 0;
}
Reply
#8

Quote:
Originally Posted by [uL]Pottus
Посмотреть сообщение
pawn Код:
stock IsPlayerFalling(playerid)           //true if player is falling with a closed parachute
{
    new index = GetPlayerAnimationIndex(playerid);
    if(index >= 958 && index <= 979 || index == 1130 || index == 1195 || index == 1132) return 1;
    return 0;
}
yha, the problem is I need to check when he is in a car
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)