Advertisement
Guest User

Untitled

a guest
Feb 4th, 2015
401
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.57 KB | None | 0 0
  1. /*
  2.   animfix
  3.   kvann 2015, no rights reserved at all.
  4. */
  5.  
  6. #include <a_samp>
  7.  
  8. #if defined _animfix_included
  9.     #endinput
  10. #endif
  11. #define _animfix_included
  12.  
  13. stock GetAnimationIndex(const anim_lib[], const anim_name[])
  14. {
  15.     new animlib[32], animname[32];
  16.     for (new i = 1; i < 1812; i++)
  17.     {
  18.         GetAnimationName(i, animlib, sizeof(animlib), animname, sizeof(animname));
  19.         if (!strcmp(animlib, anim_lib, true) && !strcmp(animname, anim_name, true)) return i;
  20.     }
  21.     return 0;
  22. }
  23.  
  24. forward SetPlayerAnimationIndex(playerid, index, Float:fDelta, loop, lockx, locky, freeze, time, forcesync);
  25. public SetPlayerAnimationIndex(playerid, index, Float:fDelta, loop, lockx, locky, freeze, time, forcesync)
  26. {
  27.     if (!(0 < index < 1812)) return 0;
  28.     new animlib[32], animname[32];
  29.     GetAnimationName(index, animlib, sizeof(animlib), animname, sizeof(animname));
  30.     ApplyAnimation(playerid, animlib, animname, fDelta, loop, lockx, locky, freeze, time, forcesync);
  31.     return 1;
  32. }
  33.  
  34. stock ApplyAnimationEx(playerid, const animlib[], const animname[], Float:fDelta, loop, lockx, locky, freeze, time, forcesync = 1)
  35. {
  36.     new index = GetAnimationIndex(animlib, animname);
  37.     if (index) SetTimerEx("SetPlayerAnimationIndex", 100, false, "iifiiiiii", playerid, index, fDelta, loop, lockx, locky, freeze, time, forcesync);
  38.     return ApplyAnimation(playerid, animlib, animname, fDelta, loop, lockx, locky, freeze, time, forcesync);
  39. }
  40. #if defined _ALS_ApplyAnimation
  41.     #undef ApplyAnimation
  42. #else
  43.     #define _ALS_ApplyAnimation
  44. #endif
  45. #define ApplyAnimation ApplyAnimationEx
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement