Help Isplayerinwater
#1

Hello, im using thins fucn:
pawn Код:
stock IsPlayerInWater(playerid)
{  
    new index = GetPlayerAnimationIndex(playerid);  
    return ((index >=  1538 && index <= 1541) || index == 1544);
}
But ist not working when i just jump in water. After when I swim somether its working...
So, why is not working when i jump in water and not moving?

P.S. Sorry for bad english.
Reply
#2

Try

pawn Код:
stock IsPlayerInWater(playerid)
{  
    new index = GetPlayerAnimationIndex(playerid);  
    return ((index >=  1538) && (index <= 1541)) || index == 1544);
//or return ((1538 <= index <= 1541)) || index == 1544);
}
Reply
#3

I guess it only checks if the animation the player applies is something related to swimming only.

The animation index 1250 is when a player just stay in water without moving (floating in water) so add it to the check as well.
Reply
#4

See this include, maybe will help you.
https://sampforum.blast.hk/showthread.php?tid=173944
Reply
#5

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
I guess it only checks if the animation the player applies is something related to swimming only.

The animation index 1250 is when a player just stay in water without moving (floating in water) so add it to the check as well.
It's working, thanks.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)