18.06.2013, 09:35
So i wan't to disable shooting in safe zone.
If i simply press shooting button shooting won't work, but if i hold shooting button with no gun and then change to any gun while holding it forks fine. How to disable shooting on that hold+change bug?
pawn Код:
public OnPlayerUpdate(playerid)
{
if(IsPlayerShoting(playerid) && IsPlayerInSafeZone(playerid)){SetPlayerArmedWeapon(playerid, 0);ClearAnimations(playerid);}
return 1;
}
pawn Код:
stock IsPlayerShoting(playerid)
{
new anim = GetPlayerAnimationIndex(playerid);
if (((anim >= 1160) && (anim <= 1163)) || (anim == 1167) || (anim == 1365) || (anim == 1643) || (anim == 1453) || (anim == 220) || (anim == 1333) || (anim == 1333) || (anim ==1167) || (anim ==1365) || (anim ==1643) || (anim ==1453) || (anim ==220)) return 1;
return 0;
}