help me! why the Animation don't run - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: help me! why the Animation don't run (
/showthread.php?tid=186863)
help me! why the Animation don't run -
peterory - 31.10.2010
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;
}
Re: help me! why the Animation don't run -
peterory - 31.10.2010
no people told me?
Re: help me! why the Animation don't run -
Shadow™ - 31.10.2010
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);
}