Guest User

Include New Functions

a guest
Jun 13th, 2014
412
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.20 KB | None | 0 0
  1. // Include New Functions Samp - By ZKDarkOMG.
  2.  
  3. /* CHANGE LOG
  4.  
  5. v 1.0
  6.  
  7. - Include create.
  8.  
  9. v 1.1
  10.  
  11. - Add 3 new functions.
  12.  
  13. */
  14.  
  15. // Include SAMP
  16. #include <a_samp>
  17.  
  18. // Defines
  19. #define VERSION "1.1"
  20.  
  21. // Stocks
  22.  
  23. stock SetPlayerMoney(playerid, money)
  24. {
  25. GivePlayerMoney(playerid, GetPlayerMoney(playerid));
  26. GivePlayerMoney(playerid, money);
  27. return 1;
  28. }
  29.  
  30. stock SetPlayerHealthandArmour(playerid, Float:health, Float:armour)
  31. {
  32. SetPlayerHealth(playerid, health);
  33. SetPlayerArmour(playerid, armour);
  34. return 1;
  35. }
  36.  
  37. stock SetPlayerPosInteriorWorld(playerid, Float:x, Float:y, Float:z, interior, virtualworld)
  38. {
  39. SetPlayerPos(playerid, x, y, z);
  40. SetPlayerInterior(playerid, interior);
  41. SetPlayerVirtualWorld(playerid, virtualworld);
  42. return 1;
  43. }
  44.  
  45. stock DesbugPlayer(playerid)
  46. {
  47. if(GetPlayerInterior == 0 && GetPlayerVirtualWorld == 0) return SendClientMessage(playerid, -1, "{ff0000}You are not bugged.");
  48. SetPlayerInterior(playerid, 0);
  49. SetPlayerVirtualworld(playerid, 0);
  50. return 1;
  51. }
  52.  
  53. stock QuitPlayerHealth(playerid, Float:health)
  54. {
  55. new Float:health2;
  56. GetPlayerHealth(playerid, health2);
  57. SetPlayerHealth(playerid, health2-health);
  58. return 1;
  59. }
  60.  
  61. stock QuitPlayerArmour(playerid, Float:armour)
  62. {
  63. new Float:armour2;
  64. GetPlayerArmour(playerid, armour2);
  65. SetPlayerArmour(playerid, armour2-armour);
  66. return 1;
  67. }
  68.  
  69. stock QuitPlayerHealthandArmour(playerid, Float:health, Float:armour)
  70. {
  71. new Float:health2, Float:armour2;
  72. GetPlayerHealth(playerid, health2);
  73. SetPlayerHealth(playerid, health2-health);
  74. GetPlayerArmour(playerid, armour2);
  75. SetPlayerArmour(playerid, armour2-armour);
  76. return 1;
  77. }
  78.  
  79. stock GivePlayerHealth(playerid, Flot:health)
  80. {
  81. new Float:health2;
  82. GetPlayerHealth(playerid, health2);
  83. SetPlayerHealth(playerid, health2+health);
  84. return 1;
  85. }
  86.  
  87. stock GivePlayerArmour(playerid, Flot:armour)
  88. {
  89. new Float:armour2;
  90. GetPlayerArmour(playerid, armour2);
  91. SetPlayerArmour(playerid, armour2+armour);
  92. return 1;
  93. }
  94.  
  95. stock GivePlayerHealthandArmour(playerid, Float:health, Float:armour)
  96. {
  97. new Float:health2, Float:armour2;
  98. GetPlayerHealth(playerid, health2);
  99. SetPlayerHealth(playerid, health2+health);
  100. GetPlayerArmour(playerid, armour2);
  101. SetPlayerArmour(playerid, armour2+armour);
  102. return 1;
  103. }
Advertisement
Add Comment
Please, Sign In to add comment