SA-MP Forums Archive
How to stop actor's animation after the Player stops targetting actor? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: How to stop actor's animation after the Player stops targetting actor? (/showthread.php?tid=606536)



How to stop actor's animation after the Player stops targetting actor? - humayunaftabkhan02 - 05.05.2016

Hi, so there's this script that if player targets the actor, he starts doing the hands up animation, but how do I make it stop just when the player stops targetting him?

pawn Code:
if(playerTargetActor != INVALID_ACTOR_ID)
    {
        new playerWeapon = GetPlayerWeapon(playerid);

        new keys, updown, leftright;
        GetPlayerKeys(playerid, keys, updown, leftright);

        if(!ActorHandsup[playerTargetActor] && playerWeapon >= 22 && playerWeapon <= 42 && keys & KEY_AIM)
        {
            ApplyActorAnimation(playerTargetActor, "SHOP", "SHP_HandsUp_Scr",4.1,0,0,0,1,0);

            ActorHandsup[playerTargetActor] = true;
        }
    }
    return 1;
}