Advertisement
Guest User

MasterJoker's Useful Function v1.1

a guest
Jan 26th, 2012
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.66 KB | None | 0 0
  1. /*
  2.  
  3. MasterJoker's Useful Function Include
  4. Supportable SAMP version: 0.3c - Present
  5. Version 1.1
  6. Version v1.1 Current Function: Available useful Function
  7. Release Date: January 26, 2012
  8. Brought you by Mr.SmileWinky!
  9.  
  10. */
  11.  
  12.  
  13. #if defined _MJUF_included
  14. #endinput
  15. #endif
  16.  
  17. #define _MJUF_included
  18.  
  19. #if defined MJUF
  20. #error MJUF are already defined.
  21. #endif
  22.  
  23. #include <a_samp>
  24.  
  25. forward Trap(playerid);
  26.  
  27. #define white "{FFFFFF}"
  28. #define COLOR_RED 0xFF0000FF
  29.  
  30. /* publics */
  31.  
  32. public Trap(playerid)
  33. {
  34. SendClientMessage(playerid, COLOR_RED, "Hidden Trap activated!, you have been killed!");
  35. SetPlayerHealth(playerid, 0);
  36. TogglePlayerControllable(playerid, 0);
  37. printf("MasterJoker's Useful Function Hidden Trap activated!");
  38. return 1;
  39. }
  40.  
  41. /* stock function */
  42.  
  43. stock CreateTeleportPosition(playerid, Float:x, Float:y, Float:z, Float:ang)
  44. {
  45. SetPlayerPos(playerid, Float:x, Float:y, Float:z);
  46. SetPlayerFacingAngle(playerid, Float:ang);
  47. return 1;
  48. }
  49.  
  50. stock CreateBotChatter(COLOR, const Botname[], const text[])
  51. {
  52. new string[321];
  53. format(string,sizeof(string), "[MJUFINC][BOT] %s: "white"%s", Botname, text);
  54. SendClientMessageToAll(COLOR, string);
  55. print(string);
  56. return 1;
  57. }
  58.  
  59. stock KickAll()
  60. {
  61. for(new i = 0; i < MAX_PLAYERS; i++)
  62. {
  63. if(IsPlayerConnected(i) && (i != i))
  64. {
  65. Kick(i);
  66. }
  67. }
  68. printf("MasterJoker's Useful Function Include Kick has been used");
  69. return 1;
  70. }
  71.  
  72. stock BanAll(const reason[])
  73. {
  74. for(new i = 0; i < MAX_PLAYERS; i++)
  75. {
  76. if(IsPlayerConnected(i) && (i != i))
  77. {
  78. BanEx(i, reason);
  79. }
  80. }
  81. printf("MasterJoker's Useful Function Include Ban has been used");
  82. return 1;
  83. }
  84.  
  85. stock IncreaseHealth(playerid, Float:health)
  86. {
  87. new Float:mycurrenthp;
  88. GetPlayerHealth(playerid, mycurrenthp);
  89. SetPlayerHealth(playerid, mycurrenthp + health);
  90. printf("MasterJoker's Useful Function Increase Health Generator has been used");
  91. return 1;
  92. }
  93.  
  94. stock DecreaseHealth(playerid, Float:health)
  95. {
  96. new Float:mycurrenthp2;
  97. GetPlayerHealth(playerid, mycurrenthp2);
  98. SetPlayerHealth(playerid, mycurrenthp2 - health);
  99. printf("MasterJoker's Useful Function Decrease Health Generator has been used");
  100. return 1;
  101. }
  102.  
  103. stock IncreaseArmour(playerid, Float:armour)
  104. {
  105. new Float:mycurrentarmour;
  106. GetPlayerHealth(playerid, mycurrentarmour);
  107. SetPlayerHealth(playerid, mycurrentarmour + armour);
  108. printf("MasterJoker's Useful Function Increase Armour Generator has been used");
  109. return 1;
  110. }
  111.  
  112. stock DecreaseArmour(playerid, Float:armour)
  113. {
  114. new Float:mycurrentarmour2;
  115. GetPlayerHealth(playerid, mycurrentarmour2);
  116. SetPlayerHealth(playerid, mycurrentarmour2 - armour);
  117. printf("MasterJoker's Useful Function Decrease Armour Generator has been used");
  118. return 1;
  119. }
  120.  
  121. stock IncreaseScore(playerid, score)
  122. {
  123. new mycurrentscore = GetPlayerScore(playerid);
  124. if(score > -1000000 || score < 1000000) return printf("MJUF Include Error: You cannot set IncreaseScore with Invalid Value");
  125. SetPlayerScore(playerid, mycurrentscore + score);
  126. printf("MasterJoker's Useful Function Increase Score Generator has been used");
  127. return 1;
  128. }
  129.  
  130. stock DecreaseScore(playerid, score)
  131. {
  132. new mycurrentscore2 = GetPlayerScore(playerid);
  133. if(score > 0 || score < 1000000) return printf("MJUF Include Error: You cannot set DecreaseScore with Invalid Value");
  134. SetPlayerScore(playerid, mycurrentscore2 - score);
  135. printf("MasterJoker's Useful Function Decrease Score Generator has been used");
  136. return 1;
  137. }
  138.  
  139. stock MJUFCredits(playerid, COLOR)
  140. {
  141. SendClientMessage(playerid, COLOR, "------------------------");
  142. SendClientMessage(playerid, COLOR, "MasterJoker's Useful Function Include v1.1");
  143. SendClientMessage(playerid, COLOR, "Credits to MasterJoker for the script include");
  144. SendClientMessage(playerid, COLOR, "Copyrighted (2012)");
  145. SendClientMessage(playerid, COLOR, "------------------------");
  146. return 1;
  147. }
  148.  
  149. stock CreateDYOFC(playerid, text[])
  150. {
  151. new string[310],pname[MAX_PLAYER_NAME];
  152. GetPlayerName(playerid, pname, sizeof(pname));
  153. format(string, sizeof(string), "[F] %s "white"(%d): %s", pname, playerid, text);
  154. SendClientMessageToAll(GetPlayerColor(playerid), string);
  155. return 1;
  156. }
  157.  
  158. stock AddBanClan(playerid, clan[])
  159. {
  160. new pname[MAX_PLAYER_NAME];
  161. GetPlayerName(playerid, pname, sizeof(pname));
  162. if(strfind(pname, clan ,true) != (-1))
  163. {
  164. BanEx(playerid, "MJUF: Banned Clan");
  165. printf("MasterJoker's Useful Function Anti-Banclan Detector has detect the banned clan!");
  166. }
  167. else return 1;
  168. return 1;
  169. }
  170.  
  171. stock CreateHiddenTrapPos(playerid, Float:range, Float:x, Float:y, Float:z)
  172. {
  173. if(IsPlayerInRangeOfPoint(playerid, Float:range, Float:x, Float:y, Float:z))
  174. {
  175. SendClientMessage(playerid, COLOR_RED, "You enter the Hidden Trap Position, you will killed in 1 mins");
  176. TogglePlayerControllable(playerid, 1);
  177. SetTimer("Trap", 60000, false);
  178. printf("MJUF Include: Someone has enter the Hidden Trap! he will be killed in 60 secs");
  179. }
  180. else return 1;
  181. return 1;
  182. }
  183.  
  184. stock MJUFGeneratorOn()
  185. {
  186. printf("MJ's Useful Function (Filterscript Test) has been plugin to your server (Ready to used!)");
  187. SendRconCommand("loadfs MJUFTest");
  188. return 1;
  189. }
  190.  
  191. stock MJUFGeneratorOFF()
  192. {
  193. printf("MJ's Useful Function (Filterscript Test) has been ejected! (No longer used!)");
  194. SendRconCommand("unloadfs MJUFTest");
  195. return 1;
  196. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement