SA-MP Forums Archive
ClearAnimations - 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)
+--- Thread: ClearAnimations (/showthread.php?tid=466707)



ClearAnimations - BoU3A - 29.09.2013

can i make this function "ClearAnimations(playerid);" can be used with "key" on my keyboard without command?


Re: ClearAnimations - LoLeC - 29.09.2013

try this https://sampwiki.blast.hk/wiki/OnPlayerKeyStateChange


Re: ClearAnimations - xganyx - 29.09.2013

pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(newkeys == KEYS)
    {
        ClearAnimation(playerid);
    }
    return 1;
}
KEYS can be found at here


Re: ClearAnimations - BoU3A - 29.09.2013

Quote:
Originally Posted by xganyx
Посмотреть сообщение
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(newkeys == KEYS)
    {
        ClearAnimation(playerid);
    }
    return 1;
}
KEYS can be found at here
What about this.?

PHP код:
public OnPlayerKeyStateChange(playeridnewkeysoldkeys)
{
  if (
PRESSED(KEY_SECONDARY_ATTACK))
  {
    
ClearAnimations(playerid);
  }
  return 
1;




Re: ClearAnimations - xganyx - 29.09.2013

pawn Код:
#define PRESSED(%0) (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
#define HOLDING(%0) ((newkeys & (%0)) == (%0))
2 function. Good luck