help me! why the Animation don't run
#1

i use the right key but it don't run
it not show the Animation




Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
	if((newkeys & KEY_RIGHT) && (team[playerid] == 2))
	{
		if(UsingAnimation[playerid] == 1)
		{
		    TogglePlayerControllable(playerid, 1);
			ApplyAnimation(playerid,"TRAIN", "TRAN_GTUP",4.1,0,1,1,1,1);
   			UsingAnimation[playerid] = 0;
   			SetTimerEx("stopanimation", 4000, 0, "i", playerid);
		}
	    new Float:hp, Float:a;
      	new target = GetClosestPlayer(playerid);
        if(target == INVALID_PLAYER_ID || target == playerid) return 1;
        if(team[target] == 2) return 1;
        GetPlayerArmour(target,a);
		if(GetDistanceBetweenPlayers(playerid,target) <= 2)
		{
			if(a > 0) SetPlayerArmour(target, a-5);
			else
			{
				GetPlayerHealth(target,hp);
				if(hp-5 > -5) SetPlayerHealth(target, hp-5);
				GetPlayerHealth(playerid,hp);
				if(hp+2 < 200) SetPlayerHealth(playerid, hp+2);
			}
		}
	}
	return 1;
}


public stopanimation(playerid)
{
	ApplyAnimation(playerid,"PED", "IDLE_STANCE",4.1,0,0,0,0,1);
	return 1;
}
Reply
#2

no people told me?
Reply
#3

under OnPlayerSpawn(playerid):
pawn Код:
PreloadAnimLib(playerid,"BENCHPRESS");
    PreloadAnimLib(playerid,"BOMBER");
    PreloadAnimLib(playerid,"RAPPING");
    PreloadAnimLib(playerid,"SHOP");
    PreloadAnimLib(playerid,"BEACH");
    PreloadAnimLib(playerid,"SMOKING");
    PreloadAnimLib(playerid,"FOOD");
    PreloadAnimLib(playerid,"ON_LOOKERS");
    PreloadAnimLib(playerid,"DEALER");
    PreloadAnimLib(playerid,"CRACK");
    PreloadAnimLib(playerid,"CARRY");
    PreloadAnimLib(playerid,"COP_AMBIENT");
    PreloadAnimLib(playerid,"PARK");
    PreloadAnimLib(playerid,"INT_HOUSE");
    PreloadAnimLib(playerid,"FOOD");
    PreloadAnimLib(playerid,"CRACK");
At the end of your script:

pawn Код:
PreloadAnimLib(playerid, animlib[])
{
    ApplyAnimation(playerid,animlib,"null",0.0,0,0,0,0,0);
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)