Quote:
Originally Posted by jessejanssen
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.