04.09.2010, 13:28
pawn Code:
if(GetPlayerAnimationIndex(playerid))
{
new animlib[32];
new animname[32];
GetAnimationName(GetPlayerAnimationIndex(playerid),animlib,32,animname,32);
if(strcmp(animlib, "SWIM", true) == 0 && !swimming[playerid])
{
swimming[playerid] = true;
OnPlayerStartSwimming(playerid);
}
else if(strcmp(animlib, "SWIM", true) != 0 && swimming[playerid] && strfind(animname, "jump", true) == -1)
{
swimming[playerid] = false;
OnPlayerStopSwimming(playerid);
}
}
else if(swimming[playerid])
{
swimming[playerid] = false;
OnPlayerStopSwimming(playerid);
}
now 100 * 30 = 3k, 3k * 60 = 180,000 Times a minute. Would be better to just put in a 1 second timer..