SA-MP Forums Archive
OnPlayerTakeDmg not caling animacion ? - 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: OnPlayerTakeDmg not caling animacion ? (/showthread.php?tid=398090)



OnPlayerTakeDmg not caling animacion ? - Azazelo - 08.12.2012

When i do this :

pawn Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
{

ApplyAnimation(playerid,"BEACH", "ParkSit_M_loop", 4.0, 1, 0, 0, 0, 0); // Sit
return 1;
}
Animacion is never called ? Why ?


Re: OnPlayerTakeDmg not caling animacion ? - DaRk_RaiN - 08.12.2012

pawn Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
{
    if(issuerid != INVALID_PLAYER_ID)
    {
    ApplyAnimation(playerid,"BEACH", "ParkSit_M_loop", 4.0, 1, 0, 0, 0, 0); // Sit
    }
    return 1;
}



Re: OnPlayerTakeDmg not caling animacion ? - Azazelo - 08.12.2012

Quote:
Originally Posted by DaRk_RaiN
Посмотреть сообщение
pawn Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
{
    if(issuerid != INVALID_PLAYER_ID)
    {
    ApplyAnimation(playerid,"BEACH", "ParkSit_M_loop", 4.0, 1, 0, 0, 0, 0); // Sit
    }
    return 1;
}
Still same player just take kick and stand not sit?


Re: OnPlayerTakeDmg not caling animacion ? - DaRk_RaiN - 08.12.2012

Make sure the anim is valid...


Re: OnPlayerTakeDmg not caling animacion ? - Lordzy - 08.12.2012

While taking damage, the player's animation might get destroyed. Try running a timer like this:
pawn Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
{
    if(issuerid != INVALID_PLAYER_ID)
    {
      SetTimerEx("Applyanim_OPTD", 500, false, "d", playerid);
    }
    return 1;
}

forward Applyanim_OPTD(playerid);
public Applyanim_OPTD(playerid)
{
    ApplyAnimation(playerid,"BEACH", "ParkSit_M_loop", 4.0, 1, 0, 0, 0, 0); // Sit
    return 1;
}