arezey

ACS - GetTargetInfo

Nov 24th, 2012
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.80 KB | None | 0 0
  1. #define SC_TARGETINFO 964
  2.  
  3. #define TARGETINFO_X 0
  4. #define TARGETINFO_Y 1
  5. #define TARGETINFO_Z 2
  6. #define TARGETINFO_HEALTH 3
  7. #define TARGETINFO_ANGLE 4
  8. #define TARGETINFO_TID 5
  9. #define TARGETINFO_SETFROZEN 6
  10. #define TARGETINFO_SETTOTALLYFROZEN 7
  11. #define TARGETINFO_INV 8
  12. #define TARGETINFO_PLAYERNUM 9
  13. #define TARGETINFO_SPAWNHEALTH 10
  14. #define TARGETINFO_TEAM 11
  15. #define TARGETINFO_WEAPONCHECK 12
  16.  
  17.  
  18. // ============================================================================
  19. // Acquire target information. This is encapsulated in a script so
  20. // as not to interfere with the original script's activator.
  21. script SC_TARGETINFO (int type, int value) {
  22. SetActivatorToTarget (0);
  23. SetResultValue (0);
  24.  
  25. switch (type) {
  26. case TARGETINFO_X:
  27. SetResultValue (GetActorX (0));
  28. break;
  29. case TARGETINFO_Y:
  30. SetResultValue (GetActorY (0));
  31. break;
  32. case TARGETINFO_Z:
  33. SetResultValue (GetActorZ (0));
  34. break;
  35. case TARGETINFO_HEALTH:
  36. SetResultValue (GetHealth ());
  37. break;
  38. case TARGETINFO_ANGLE:
  39. SetResultValue (GetActorAngle (0));
  40. break;
  41. case TARGETINFO_TID:
  42. SetResultValue (ActivatorTID ());
  43. break;
  44. case TARGETINFO_SETFROZEN:
  45. SetPlayerProperty (0, value, PROP_FROZEN);
  46. break;
  47. case TARGETINFO_SETTOTALLYFROZEN:
  48. SetPlayerProperty (0, value, PROP_TOTALLYFROZEN);
  49. break;
  50. case TARGETINFO_INV:
  51. SetResultValue (CheckInventory (value));
  52. break;
  53. case TARGETINFO_PLAYERNUM:
  54. SetResultValue (PlayerNumber ());
  55. break;
  56. case TARGETINFO_SPAWNHEALTH:
  57. SetResultValue (GetSpawnHealth ());
  58. break;
  59. case TARGETINFO_TEAM:
  60. SetResultValue (PlayerTeam ());
  61. break;
  62. case TARGETINFO_WEAPONCHECK:
  63. SetResultValue (CheckWeapon (value));
  64. break;
  65. }
  66. }
  67.  
  68. function int GetTargetInfo (int type, int value) {
  69. return ACS_ExecuteWithResult (SC_TARGETINFO, type, value);
  70. }
Advertisement
Add Comment
Please, Sign In to add comment