Leg Break Animation bug (+rep)
#1

Hello, I've been scripting a Leg Breaking system similar to the one seen on LSRP,
and the animation seems to bug out and it freezes the player and whenever the animation stops playing it freezes the player, I've tried using a timer which stops the players animations and that doesnt work ethier,
here is my code,

Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
	if (pLegBroken[playerid])
	{
		if(newkeys & KEY_SPRINT || newkeys & KEY_JUMP)
		OnAnim{playerid} = true;
		ApplyAnimation(playerid,"PED","FALL_collapse",4.1,0,0,0,1,0);
		timerLegBreak[playerid] = SetTimerEx("LegBreakTimer", 2000, false, "d", playerid);
	}
Код:
public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid, bodypart)
{
	if(issuerid != INVALID_PLAYER_ID && weaponid >= 22 && weaponid <= 38 && (bodypart == 7 || bodypart == 8))
    {
		if(pLegBroken[playerid] == false)
		{
			pLegBroken[playerid] = true;
			OnAnim{playerid} = true;
			FreezePlayer(playerid);
			ApplyAnimation(playerid,"PED","FALL_collapse",4.1,0,0,0,1,0);
   			SCM(playerid, COLOR_LIGHTRED, "-> You've been hit in the leg, you're going to struggle with running and jumping.");
   			timerLegBreak[playerid] = SetTimerEx("LegBreakTimer", 1000, false, "d", playerid);
    	}
	}
Код:
forward LegBreakTimer(playerid);
public LegBreakTimer(playerid)
{
	StopPlayerAnims(playerid);
}
Reply


Messages In This Thread
Leg Break Animation bug (+rep) - by Matical - 22.05.2016, 22:28
Re: Leg Break Animation bug (+rep) - by Matical - 23.05.2016, 01:43
Re: Leg Break Animation bug (+rep) - by Gammix - 23.05.2016, 02:14
Re: Leg Break Animation bug (+rep) - by GTLS - 23.05.2016, 06:19
Re: Leg Break Animation bug (+rep) - by ratxrat - 23.05.2016, 08:35

Forum Jump:


Users browsing this thread: 2 Guest(s)