SA-MP Forums Archive
ApplyAnimation - 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: ApplyAnimation (/showthread.php?tid=411836)



ApplyAnimation - Da_Noob - 30.01.2013

So, I've downloaded an include, which allows me to use OnPlayerShootPlayer. So I've made a tazersystem using that. It works fine, only the animation won't work. When you taze the player, he'll just freeze, with no animation.
Can anybody help me with this?

My OnPlayerShootPlayer:

pawn Code:
public OnPlayerShootPlayer(Shooter,Target,Float:HealthLost,Float:ArmourLost)
{
    if(PlayerInfo[Shooter][pFaction] == 1 || PlayerInfo[Shooter][pFaction] == 6)
    {
        if(GetPlayerWeapon(Shooter) == 23)
        {
            new string[180];
            TogglePlayerControllable(Target, false);
            ApplyAnimation(Target,"CRACK","crckdeth2",4.1,1,1,1,10000,1);
            pTazed[Target] = 1;
            SetTimerEx("Tazed", 10000, 0, "d", Target);
            format(string, sizeof(string), "* %s aims their tazer on %s and tazes them.", GetName(Shooter), GetName(Target));
            ProxDetector(30.0, Shooter, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
            SendClientMessage(Target, COLOR_LIGHTBLUE, "You've been tazed for 10 seconds!");
            format(string,sizeof(string), "You've succesfully tazed %s.", GetName(Target));
            SendClientMessage(Shooter, COLOR_LIGHTBLUE, string);
        }
    }
    return 1;
}
My ApplyAnimation:

pawn Code:
ApplyAnimation(Target,"CRACK","crckdeth2",4.1,1,1,1,10000,1);
Thanks in advance.


Re: ApplyAnimation - Youice - 30.01.2013

Try this:

PHP Code:
public OnPlayerShootPlayer(Shooter,Target,Float:HealthLost,Float:ArmourLost)
{
    if(
PlayerInfo[Shooter][pFaction] == || PlayerInfo[Shooter][pFaction] == 6)
    {
        if(
GetPlayerWeapon(Shooter) == 23)
        {
            new 
string[180];
            
TogglePlayerControllable(Targetfalse);
            
ClearAnimations(Target);
            
ApplyAnimation(Target,"CRACK","crckdeth2",4.1,1,1,1,10000,1);
            
pTazed[Target] = 1;
            
SetTimerEx("Tazed"100000"d"Target);
            
format(stringsizeof(string), "* %s aims their tazer on %s and tazes them."GetName(Shooter), GetName(Target));
            
ProxDetector(30.0ShooterstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
            
SendClientMessage(TargetCOLOR_LIGHTBLUE"You've been tazed for 10 seconds!");
            
format(string,sizeof(string), "You've succesfully tazed %s."GetName(Target));
            
SendClientMessage(ShooterCOLOR_LIGHTBLUEstring);
        }
    }
    return 
1;




Re: ApplyAnimation - Apenmeeuw - 30.01.2013

maybe you should first apply the animation, THEN freeze him, im not sure but i think that'll work, also use ClearAnims as you can see in the post above me