22.09.2012, 14:03
Try this:
I have a feeling it has something to do with the order of TogglePlayerControllable and ClearAnimations.
pawn Код:
if(IsPlayerInRangeOfPoint(playerid,20.0, 286.58, -109.37, 1001.56))
{
if (PRESSED(KEY_NO))
{
TogglePlayerControllable(playerid,1);
TextDrawHideForPlayer(playerid, Text:Textdraw0);
TextDrawHideForPlayer(playerid, Text:Textdraw1);
TextDrawHideForPlayer(playerid, Text:Textdraw11);
TextDrawHideForPlayer(playerid, Text:Textdraw111);
TextDrawHideForPlayer(playerid, Text:Textdraw1111);
TextDrawHideForPlayer(playerid, Text:Textdraw2);
TextDrawHideForPlayer(playerid, Text:Textdraw3);
TextDrawHideForPlayer(playerid, Text:Textdraw4);
TextDrawHideForPlayer(playerid, Text:Textdraw5);
TextDrawHideForPlayer(playerid, Text:Textdraw6);
TextDrawHideForPlayer(playerid, Text:Textdraw7);
TextDrawHideForPlayer(playerid, Text:Textdraw8);
TextDrawHideForPlayer(playerid, Text:Textdraw9);
TextDrawHideForPlayer(playerid, Text:Textdraw10);
TextDrawHideForPlayer(playerid, Text:Textdraw12);
TextDrawHideForPlayer(playerid, Text:Textdraw13);
TextDrawHideForPlayer(playerid, Text:Textdraw14);
TextDrawHideForPlayer(playerid, Text:Textdraw15);
ClearAnimations(playerid); // And here to stop the animation if he presses KEY_NO, but it doesn't stop the animation
}
}
if (PRESSED(KEY_SECONDARY_ATTACK))
{
if(IsPlayerInRangeOfPoint(playerid,1.0, 286.58, -109.37, 1001.56))
{
TogglePlayerControllable(playerid,0);
SendClientMessage(playerid, COLOR_GREEN, "MP5 $7000");
ApplyAnimation(playerid,"INT_SHOP","shop_lookB",4.1,1,1,1,1,1,1); // Here the animation begins.
TextDrawShowForPlayer(playerid, Text:Textdraw0);
TextDrawShowForPlayer(playerid, Text:Textdraw11);
TextDrawShowForPlayer(playerid, Text:Textdraw2);
TextDrawShowForPlayer(playerid, Text:Textdraw3);
TextDrawShowForPlayer(playerid, Text:Textdraw15);
TextDrawShowForPlayer(playerid, Text:Textdraw5);
TextDrawShowForPlayer(playerid, Text:Textdraw6);
TextDrawShowForPlayer(playerid, Text:Textdraw7);
TextDrawShowForPlayer(playerid, Text:Textdraw8);
}
}