Guest User

Untitled

a guest
Feb 16th, 2014
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.42 KB | None | 0 0
  1. // Includes
  2. #include <a_samp>
  3. #include <zcmd>
  4.  
  5. COMMAND:leave(playerid, params[])
  6. {
  7. if (InMDM[playerid] = 1)
  8. {
  9. SetPlayerPos(playerid, 2475.6655,-1662.9609,13.3326);
  10. SendClientMessage(playerid, -1 , "You have left the DM arena.");
  11. }
  12.  
  13. // Defines
  14. #define FILTERSCRIPT
  15.  
  16. // Colour Defines
  17. #define COLOR_GREEN 0xB1FB44FF
  18. #define COLOR_RED 0xFF444499
  19. #define COLOR_YELLOW 0xFFFF00AA
  20. #define COLOR_WHITE 0xFFFFFFAA
  21. #define COLOR_SYSTEM 0x00F6F6AA
  22. #define COLOR_BLACK 0x000000AA
  23. #define COLOR_BLUE 0x0066F6AA
  24. #define COLOR_GREY 0x7A7979AA
  25. #define COLOR_ORANGE 0xFF9900AA
  26. #define COLOR_PINK 0xF600F6AA
  27. #define COLOR_PURPLE 0x9F00F6AA
  28. #define COLOR_LIGHTBLUE 0x33CCFF19
  29.  
  30. // Variables
  31. new szString[256]; // String for messages
  32. new InMDM[MAX_PLAYERS]; // Determines if a player is in the Minigun DM or not.
  33.  
  34. new Float:MDMSpawns[][4] = { // Random Minigun DM Spawns (So that players aren't spawned in the same place.)
  35. {2205.4531,1613.0443,999.9776,4.9999},
  36. {2218.2949,1613.3134,999.9827,2.7241},
  37. {2193.5117,1625.7844,999.9706,177.5425},
  38. {2181.9653,1577.2335,999.9650,6.7742},
  39. {2228.2803,1594.2496,999.9643,95.4250},
  40. {2220.1484,1554.7620,1004.7244,353.9040}
  41. };
  42.  
  43. #if defined FILTERSCRIPT
  44.  
  45. public OnFilterScriptInit()
  46. {
  47. print("\n--------------------------------------");
  48. print(" Minigun DM Filterscript by DrPepper");
  49. print("--------------------------------------\n");
  50. return 1;
  51. }
  52.  
  53. public OnFilterScriptExit()
  54. {
  55. return 1;
  56. }
  57.  
  58. #else
  59. #endif
  60.  
  61. public OnPlayerConnect(playerid)
  62. {
  63. InMDM[playerid] = 0; // Makes the player set as not in the Minigun DM (Prevents other player's from being bugged.)
  64. return 1;
  65. }
  66.  
  67. public OnPlayerDisconnect(playerid, reason)
  68. {
  69. InMDM[playerid] = 0; // Makes the player set as not in the Minigun DM (Prevents other player's from being bugged.)
  70. return 1;
  71. }
  72.  
  73. public OnPlayerSpawn(playerid)
  74. {
  75. if(InMDM[playerid] == 1) { // Determines that the player is in the Minigun DM. When he is killed, and /mdm = 1, he will be teleported back to the DM.
  76. SetPlayerInterior(playerid, 1); // Interior = 1
  77. SetPlayerVirtualWorld(playerid, 10); // Virtual World = 10
  78. new rand = random(sizeof(MDMSpawns)); // MDM Spawn Variable
  79. SetPlayerPos(playerid, MDMSpawns[rand][0], MDMSpawns[rand][1], MDMSpawns[rand][2]); // Random Player Position for MDM
  80. SetPlayerFacingAngle(playerid, MDMSpawns[rand][3]); // Face Angle
  81. GivePlayerWeapon(playerid, 38, 9999); // Minigun
  82. }
  83. return 1;
  84. }
  85.  
  86. public OnPlayerDeath(playerid, killerid, reason)
  87. {
  88. return 1;
  89. }
  90.  
  91. public OnVehicleSpawn(vehicleid)
  92. {
  93. return 1;
  94. }
  95.  
  96. public OnVehicleDeath(vehicleid, killerid)
  97. {
  98. return 1;
  99. }
  100.  
  101. public OnPlayerText(playerid, text[])
  102. {
  103. return 1;
  104. }
  105.  
  106. public OnPlayerCommandText(playerid, cmdtext[])
  107. {
  108. if (strcmp("/mdm", cmdtext, true, 4) == 0) // /mdm command
  109. {
  110. new PlayerName[MAX_PLAYER_NAME];
  111. GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
  112. if(InMDM[playerid] == 0) { // Player is currently not in /mdm
  113. InMDM[playerid] = 1; // Since player is not in /mdm InMDM = 1 (When player dies, player automatically sent to /mdm)
  114. // If player retypes /mdm and InMDM = 1, player will not be teleported to MDM
  115. SendClientMessage(playerid, COLOR_GREEN, "* You have joined /mdm you will automatically join after death.");
  116. SendClientMessage(playerid, COLOR_GREEN, "* To disable auto-join or leave /mdm you must type /mdm again.");
  117. format(szString, sizeof(szString), "[DM] %s (ID:%d) has joined the Minigun DM (/mdm).", PlayerName, playerid);
  118. SendClientMessageToAll(COLOR_YELLOW, szString);
  119. SetPlayerInterior(playerid, 1); // Interior = = 1
  120. SetPlayerVirtualWorld(playerid, 10); // Virtual World = 10
  121. new rand = random(sizeof(MDMSpawns)); // Variable
  122. SetPlayerPos(playerid, MDMSpawns[rand][0], MDMSpawns[rand][1], MDMSpawns[rand][2]); // Rnadom MDM Spawns
  123. SetPlayerFacingAngle(playerid, MDMSpawns[rand][3]); // Face Angle
  124. GivePlayerWeapon(playerid, 38, 9999); // Minigun
  125. }
  126. else {
  127. InMDM[playerid] = 0; // Player doesn't want to be in /mdm anymore. InMDM is now set to 0
  128. SendClientMessage(playerid, COLOR_GREEN, "* You have left /mdm to rejoin type /mdm again.");
  129. SpawnPlayer(playerid);
  130. SetPlayerHealth(playerid, 100);
  131. ResetPlayerWeapons(playerid);
  132. SetPlayerVirtualWorld(playerid, 0);
  133. SetPlayerInterior(playerid, 0);
  134. }
  135. return 1;
  136. }
  137. return 0;
  138. }
  139.  
  140. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  141. {
  142. return 1;
  143. }
  144.  
  145. public OnPlayerExitVehicle(playerid, vehicleid)
  146. {
  147. return 1;
  148. }
  149.  
  150. public OnPlayerStateChange(playerid, newstate, oldstate)
  151. {
  152. return 1;
  153. }
  154.  
  155. public OnPlayerEnterCheckpoint(playerid)
  156. {
  157. return 1;
  158. }
  159.  
  160. public OnPlayerLeaveCheckpoint(playerid)
  161. {
  162. return 1;
  163. }
  164.  
  165. public OnPlayerEnterRaceCheckpoint(playerid)
  166. {
  167. return 1;
  168. }
  169.  
  170. public OnPlayerLeaveRaceCheckpoint(playerid)
  171. {
  172. return 1;
  173. }
  174.  
  175. public OnRconCommand(cmd[])
  176. {
  177. return 1;
  178. }
  179.  
  180. public OnPlayerRequestSpawn(playerid)
  181. {
  182. return 1;
  183. }
  184.  
  185. public OnObjectMoved(objectid)
  186. {
  187. return 1;
  188. }
  189.  
  190. public OnPlayerObjectMoved(playerid, objectid)
  191. {
  192. return 1;
  193. }
  194.  
  195. public OnPlayerPickUpPickup(playerid, pickupid)
  196. {
  197. return 1;
  198. }
  199.  
  200. public OnVehicleMod(playerid, vehicleid, componentid)
  201. {
  202. return 1;
  203. }
  204.  
  205. public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  206. {
  207. return 1;
  208. }
  209.  
  210. public OnVehicleRespray(playerid, vehicleid, color1, color2)
  211. {
  212. return 1;
  213. }
  214.  
  215. public OnPlayerSelectedMenuRow(playerid, row)
  216. {
  217. return 1;
  218. }
  219.  
  220. public OnPlayerExitedMenu(playerid)
  221. {
  222. return 1;
  223. }
  224.  
  225. public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  226. {
  227. return 1;
  228. }
  229.  
  230. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  231. {
  232. return 1;
  233. }
  234.  
  235. public OnRconLoginAttempt(ip[], password[], success)
  236. {
  237. return 1;
  238. }
  239.  
  240. public OnPlayerUpdate(playerid)
  241. {
  242. return 1;
  243. }
  244.  
  245. public OnPlayerStreamIn(playerid, forplayerid)
  246. {
  247. return 1;
  248. }
  249.  
  250. public OnPlayerStreamOut(playerid, forplayerid)
  251. {
  252. return 1;
  253. }
  254.  
  255. public OnVehicleStreamIn(vehicleid, forplayerid)
  256. {
  257. return 1;
  258. }
  259.  
  260. public OnVehicleStreamOut(vehicleid, forplayerid)
  261. {
  262. return 1;
  263. }
  264.  
  265. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  266. {
  267. return 1;
  268. }
  269.  
  270. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  271. {
  272. return 1;
  273. }
  274.  
  275. else if (inMDM[playerid] = 0)
  276. {
  277. SendClientMessage(playerid, -1 , "You are not in the DM arena.");
  278. }
  279. return 1;
  280. }
Advertisement
Add Comment
Please, Sign In to add comment