Advertisement
Guest User

Untitled

a guest
Aug 14th, 2010
364
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.12 KB | None | 0 0
  1. #include <a_samp>
  2.  
  3. #define armL 0
  4. #define armR 1
  5. #define legL 2
  6. #define legR 3
  7. #define stomach 4
  8. #define gravity 5
  9.  
  10. stock IsPlayerInWater(playerid)
  11. {
  12. new animlib[32],tmp[32];
  13. GetAnimationName(GetPlayerAnimationIndex(playerid),animlib,32,tmp,32);
  14. if( !strcmp(animlib, "SWIM") && !IsPlayerInAnyVehicle(playerid) ) return true;
  15. return false;
  16. }
  17.  
  18. stock IsPlayerDucked(playerid)
  19. {
  20. if(GetPlayerSpecialAction(playerid)==SPECIAL_ACTION_DUCK) return true;
  21. return false;
  22. }
  23.  
  24. stock IsPlayerAim(playerid)
  25. {
  26. new animname[32];
  27. GetAnimationName(GetPlayerAnimationIndex(playerid),animname,32,animname,32);
  28. if( strfind(animname,"GUN_STAND",true) != -1 ) return true;
  29. else if( strfind(animname,"COLT45_FIRE",true) != -1 ) return true;
  30. return false;
  31. }
  32.  
  33. stock IsPlayerStand(playerid)
  34. {
  35. new animname[32];
  36. GetAnimationName(GetPlayerAnimationIndex(playerid),animname,32,animname,32);
  37. if( strfind(animname,"IDLE_STANCE",true) != -1 ) return true;
  38. return false;
  39. }
  40.  
  41. stock IsPlayerDuckedMove(playerid)
  42. {
  43. new animname[32];
  44. GetAnimationName(GetPlayerAnimationIndex(playerid),animname,32,animname,32);
  45. if( strfind(animname,"GUNCROUCHFWD",true) != -1 ) return true;
  46. return false;
  47. }
  48.  
  49. public OnPlayerUpdate(playerid)
  50. {
  51. if(GetPlayerAnimationIndex(playerid))
  52. {
  53. new animname[32],animlib[32];
  54. GetAnimationName(GetPlayerAnimationIndex(playerid),animlib,32,animname,32);
  55. new bodypart=-1;
  56. if(strfind(animname,"DAM_armL",true)!=-1) bodypart=armL;
  57. else if(strfind(animname,"DAM_armR",true)!=-1) bodypart=armR;
  58. else if(strfind(animname,"DAM_LegL",true)!=-1) bodypart=legL;
  59. else if(strfind(animname,"DAM_LegR",true)!=-1) bodypart=legR;
  60. else if(strfind(animname,"DAM_stomach",true)!=-1) bodypart=stomach;
  61. else if(strfind(animlib,"DAM_JUMP",true)!=-1) bodypart=gravity;
  62. if(bodypart!=-1) OnPlayerDamaged(playerid, bodypart);
  63. }
  64. return 1;
  65. }
  66.  
  67. forward OnPlayerDamaged(playerid, bodypart);
  68. public OnPlayerDamaged(playerid, bodypart)
  69. {
  70. if(bodypart == armL) print("OH MY ARM");
  71. return 1;
  72. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement