31.05.2012, 00:55
Here's my IsPlayerInWater function:
Here's my test command:
IsPlayerInWater is always returning 1. Don't worry about my SendClientMessageEx function, it works for everything else. If you really wanna see it, here:
It requires a special include by y_less.
pawn Code:
stock IsPlayerInWater(playerid)
{
new animlib[10], animname[10];
GetAnimationName(GetPlayerAnimationIndex(playerid), animlib, sizeof(animlib), animname, sizeof(animname));
return (!strcmp(animlib, "SWIM")) ? 1 : 0;
}
Here's my test command:
pawn Code:
COMMAND:swimming(playerid, params[]) return SendClientMessageEx(playerid, -1, "%d", IsPlayerInWater(playerid));
IsPlayerInWater is always returning 1. Don't worry about my SendClientMessageEx function, it works for everything else. If you really wanna see it, here:
pawn Code:
SendClientMessageEx(playerid, color, msg[], va_args<>)
{
new string[128];
va_format(string, sizeof(string), msg, va_start<3>);
SendClientMessage(playerid, color, string);
return 1;
}