Keys sprint doesn't remove all animation after clear it
#1

Hello guys
i got one issue when i apply animation on my keys, just like this
Код:
    if(HOLDING( KEY_SPRINT))
    {
    if(PRESSED( KEY_JUMP ))
    {
    ApplyAnimation(playerid, "GYMNASIUM", "gym_jog_falloff",4.1,0,1,1,0,0);
    }
    }
    if(newkeys & KEY_JUMP && !(oldkeys & KEY_JUMP))
	{
    if(GetPVarInt(playerid, "InfectPlayerBreak") == 1)
    {
	ApplyAnimation(playerid, "GYMNASIUM", "gym_jog_falloff", 4.1, 0, 1, 1, 0, 0);
	}
	}

	if(HOLDING(KEY_WALK) || HOLDING(KEY_SPRINT))
	{
	if(GetPVarInt(playerid, "InfectPlayerBreak") == 1 || IsPlayerRunning(playerid))
	{
	ApplyAnimation(playerid, "PED", "WALK_old", 4.1, 1, 1, 1, 0, 0);
	}
	}

	else if(RELEASED(KEY_WALK) || RELEASED(KEY_SPRINT))
	{
	if(GetPVarInt(playerid, "InfectPlayerBreak") == 1)
	{
    ClearAnimations(playerid);
	}
	}
	return true;
}
This stuff doesn't clear it after i put on me heal system. Its luck like this
Код:
stock CurePlayer(playerid)
{
	if(pInfo[playerid][IsPlayerInfected] == 1)
	{
	    KillTimer(pInfo[playerid][IsPlayerInfectedTimer]);
	    KillTimer(pInfo[playerid][IsPlayerBlindTimer]);
	    KillTimer(pInfo[playerid][IsPlayerBreakTimer]);
	    pInfo[playerid][IsPlayerInfected] = 0;
	    pInfo[playerid][IsPlayerBlind] = 0;
	    pInfo[playerid][IsPlayerBreak] = 0;
	    SetPlayerColor(playerid,COLOR_HUMAN);
		ApplyAnimation(playerid,"MEDIC","CPR",4.1,0,1,1,1,1);
		SetPlayerDrunkLevel(playerid,0);
		TextDrawHideForPlayer(playerid,Infected[playerid]);
		TextDrawHideForPlayer(playerid,Break[playerid]);
		TextDrawHideForPlayer(playerid,Blind[playerid]);
	}
	return 1;
}
P.S this stock
Код:
stock InfectPlayerBreak(playerid)
{
	if(team[playerid] == TEAM_HUMAN)
	{
		if(pInfo[playerid][IsPlayerBreak] == 0)
		{
	        pInfo[playerid][IsPlayerBreakTimer] = SetTimerEx("StandardBreak",1500,1,"i",playerid);
			SetPlayerColor(playerid,COLOR_PINK);
			TextDrawShowForPlayer(playerid,Break[playerid]);
            SetPVarInt(playerid, "InfectPlayerBreak", 1);
            pInfo[playerid][IsPlayerInfected] = 1;
		}
	}
	return 1;
}
So when i put ClearAnimations(playerid); on stock cure its still don't disable me animation. Have any ideas?
Reply
#2

help fix it guys
Reply
#3

Did you tried to debug your code to find the error?
Reply
#4

Quote:
Originally Posted by Ner0x96
Посмотреть сообщение
Did you tried to debug your code to find the error?
Well its no a bug i think, just want to stop the dumb animation after i clear it bat ClearAnimations do nothing so i think i need stop it somehow different
Reply
#5

What I used to clearn anim:
PHP код:
IsCrounching(playerid
    return (
GetPlayerAnimationIndex(playerid) == 1159 || GetPlayerAnimationIndex(playerid) == 1274 true false);

forward ClearAnimations(playerid);
public 
ClearAnimations(playerid)
{
    if(
IsCrounching(playerid))
        
ApplyAnimation(playerid"PED""GUNCROUCHFWD"4.1000011);
    else 
        
ApplyAnimation(playerid"CARRY""crry_prtial"4.100000);
    return 
1;

This should work.
Reply
#6

Quote:
Originally Posted by Dayrion
Посмотреть сообщение
What I used to clearn anim:
PHP код:
IsCrounching(playerid
    return (
GetPlayerAnimationIndex(playerid) == 1159 || GetPlayerAnimationIndex(playerid) == 1274 true false);
forward ClearAnimations(playerid);
public 
ClearAnimations(playerid)
{
    if(
IsCrounching(playerid))
        
ApplyAnimation(playerid"PED""GUNCROUCHFWD"4.1000011);
    else 
        
ApplyAnimation(playerid"CARRY""crry_prtial"4.100000);
    return 
1;

This should work.
Nope still me animation doesn't disappear. Have other ideas?
Reply
#7

bump
Reply
#8

Quote:
Originally Posted by henkas
Посмотреть сообщение
Well its no a bug i think, just want to stop the dumb animation after i clear it bat ClearAnimations do nothing so i think i need stop it somehow different
Lol..

Just try implementing some debug codes ( print("Test 1"); print("Test 2"); ) following your code, so the console will say you where the code stops and then you can make an idea yourself about what's wrong in your code.
Reply
#9

Quote:
Originally Posted by Ner0x96
Посмотреть сообщение
Lol..

Just try implementing some debug codes ( print("Test 1"); print("Test 2"); ) following your code, so the console will say you where the code stops and then you can make an idea yourself about what's wrong in your code.
Dude do you know something different without debug just all time say try debug. This shit need use if me code doesn't work or something else, bat as you can see i told me code work perfect just need clear animation.
Reply
#10

Up up up
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)