SA-MP Forums Archive
[SOLVED] Problem with animations - 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: [SOLVED] Problem with animations (/showthread.php?tid=92801)



[SOLVED] Problem with animations - Ben147 - 22.08.2009

i made a simple chat animation when someone type something in the chat that automatic started
but i have a problem i wanna make some if that if someplayer allready in animation like crack, and he trying to speak.
the chat animation will not working , only when the player not in animation and he talking the chat animation will works
something like this.

Код:
if(ApplyAnimation == 0)
{
  ApplyAnimation(playerid, "PED", "IDLE_chat", 4.1, 0, 1, 1, 0, 3000);
  SetTimerEx("StopTalking", 3*1000, 0,"d",playerid);
}
of course i cannot do this if, but how should i do it?


Re: [Not SOLVED] Problem with animations - Dark_Kostas - 22.08.2009

As long as there is no GetPlayerAnimation, you cant define if a player is on animation. Try to do so when you ApplyAnimation it will do ApplyAnimation = 1 and then create a new timer that will set ApplyAnimation = 0 after animation finish.


Re: [Not SOLVED] Problem with animations - Ben147 - 22.08.2009

Thats when im trying, the problem is when someone stopanimation he just click on the mouse key.
there is not command, in my script like stopanim to stop animation .


Re: [Not SOLVED] Problem with animations - Dark_Kostas - 22.08.2009

Then you can use this
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
  if (newkeys == KEY_FIRE && ApplyAnimation[playerid] == 1)
  {
    ApplyAnimation[playerid] = 0;
  }
  return 1;
}



Re: [Not SOLVED] Problem with animations - Ben147 - 22.08.2009

Quote:
Originally Posted by Dark_Kostas
Then you can use this
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
  if (newkeys == KEY_FIRE && ApplyAnimation[playerid] == 1)
  {
    ApplyAnimation[playerid] = 0;
  }
  return 1;
}
Thanks working perfectly