IsPlayerInWater issue
#7

Quote:
Originally Posted by jessejanssen
View Post
I'm just guessing as I don't really see anything wrong, but try this:
pawn Code:
stock IsPlayerInWater(playerid)
{
    new animlib[10], animname[10];
    GetAnimationName(GetPlayerAnimationIndex(playerid), animlib, sizeof(animlib), animname, sizeof(animname));
    if(strcmp(animlib, "SWIM"))
        {
        return 1;
        }
    return 0;
}
Best regards,
Jesse
I've already tried to do it without the ternary operator and it made no different. Just a note, strcmp returns 0 when the string matches. So your strcmp check should have a ! before it or == 0 after it.


I've found an alternative solution to this problem by using animation indexes, but I'd still like to know what was wrong with this so that I don't make the same mistake in the future.
Reply


Messages In This Thread
IsPlayerInWater issue - by SuperViper - 31.05.2012, 00:55
Re: IsPlayerInWater issue - by Ballu Miaa - 31.05.2012, 01:33
Re: IsPlayerInWater issue - by SuperViper - 31.05.2012, 01:42
Re: IsPlayerInWater issue - by MP2 - 31.05.2012, 01:43
Re: IsPlayerInWater issue - by jessejanssen - 31.05.2012, 01:49
Re: IsPlayerInWater issue - by Ballu Miaa - 31.05.2012, 02:04
Re: IsPlayerInWater issue - by SuperViper - 31.05.2012, 02:10
Re: IsPlayerInWater issue - by Azazelo - 31.05.2012, 02:53
Re: IsPlayerInWater issue - by SuperViper - 31.05.2012, 03:11
Re: IsPlayerInWater issue - by MadeMan - 31.05.2012, 15:35

Forum Jump:


Users browsing this thread: 1 Guest(s)