Guest User

DM Arenas System

a guest
Jan 17th, 2017
256
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.58 KB | None | 0 0
  1. /*
  2. Death Match Arena FilterScript
  3.  
  4.  
  5.  
  6. By: RyderX
  7.  
  8. */
  9.  
  10.  
  11. #include <a_samp>
  12. #include <zcmd>
  13. #include <a_actor>
  14. #define FILTERSCRIPT
  15. #define DIALOG_DM 15
  16. new bool:onCheck[MAX_PLAYERS];
  17. new DM[MAX_PLAYERS];
  18.  
  19. public OnFilterScriptInit()
  20. {
  21. CreateObject(1459, 849.76630, -1386.33789, 13.26280, 0.00000, 0.00000, 0.00000);
  22. CreateObject(1459, 852.28003, -1384.89758, 13.22480, 0.40000, 0.16000, 30.09720);
  23. CreateObject(6296, 858.57196, -1366.85461, 14.83800, 0.00000, 0.00000, 90.00000);
  24. CreateObject(967, 866.55573, -1384.35535, 12.61930, 0.00000, 0.00000, 270.00000);
  25. CreateObject(3472, 846.23114, -1389.41882, 12.61930, 0.00000, 0.00000, 0.00000);
  26. CreateObject(3472, 869.02191, -1358.37830, 12.61930, 0.00000, 0.00000, 0.00000);
  27. CreateObject(3472, 869.64117, -1389.42529, 12.89570, 0.00000, 0.00000, 0.00000);
  28. CreateObject(3472, 850.69269, -1362.99597, 12.88340, 0.00000, 0.00000, 0.00000);
  29. CreateObject(3461, 865.26288, -1373.29041, 13.88340, 0.00000, 0.00000, 0.00000);
  30. CreateObject(3461, 851.87781, -1373.33972, 13.88340, 0.00000, 0.00000, 0.00000);
  31. CreateActor(0, 862.037475, -1372.082275, 13.546875, 175.936630);//Here you can changed the skinid of the Actor
  32. CreateActor(0, 855.092590, -1371.912597, 13.628181, 185.650085);//here too.(0 <> 311)
  33. Create3DTextLabel("Death Match - Arenas", 0x00FF00FF, 858.4816,-1371.1626,13.5469, 40.0, 0, 0);
  34. Create3DTextLabel("Grenade DM", 0x00FF00FF, -1401.8314,107.3241,1032.2734, 40.0, 0, 0);
  35. Create3DTextLabel("Sawn-Off DM", 0x00FF00FF, 1412.6399,-1.7875,1000.9244, 40.0, 0, 0);
  36. Create3DTextLabel("Deset Eagle DM", 0x00FF00FF, 1302.5199,-1.7875,1001.0283, 40.0, 0, 0);
  37. Create3DTextLabel("Shotgun & Deagle DM", 0x00FF00FF, 288.745971,169.350997,1007.171875, 40.0, 0, 0);
  38. return 1;
  39. }
  40.  
  41. public OnPlayerConnect(playerid)
  42. {
  43. SetPlayerMapIcon(playerid, 23, 858.4816,-1371.1626,13.5469, 52, 2, MAPICON_LOCAL);
  44. return 1;
  45. }
  46.  
  47. public OnPlayerSpawn(playerid)
  48. {
  49. RemoveBuildingForPlayer(playerid, 1297, 868.7656, -1390.1172, 15.6406, 0.25);
  50. RemoveBuildingForPlayer(playerid, 1440, 857.3750, -1381.1641, 13.0469, 0.25);
  51. RemoveBuildingForPlayer(playerid, 1365, 861.9844, -1380.4609, 13.6250, 0.25);
  52. SetPlayerCheckpoint(playerid, 858.4816,-1371.1626,13.5469, 2.0);
  53. onCheck[playerid] = true;
  54. return 1;
  55. }
  56.  
  57. public OnPlayerEnterCheckpoint(playerid)
  58. {
  59. if(onCheck[playerid]) // if it's true
  60. {
  61. DisablePlayerCheckpoint(playerid);
  62. ShowPlayerDialog(playerid, DIALOG_DM, DIALOG_STYLE_LIST, "{00ff00}Death Match - Arenas", "{00ffff}-DeathMatch Stadium(All in one)\n{ff0000}-Sawn-off DeathMatch\n{ff9900}-Desert Eagle DeathMatch\n{ffff00}-Shotgun & Deagle DeathMatch\n{ff3399}-Grenade DeathMatch\n", "Select", "Close");
  63. onCheck[playerid] = false;
  64. }
  65. return 1;
  66. }
  67.  
  68. CMD:tp(playerid,params[])
  69. {
  70. SetPlayerPos(playerid, 858.2075,-1381.7719,13.7417);
  71. return 1;
  72. }
  73.  
  74. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  75. {
  76. if(dialogid == DIALOG_DM)
  77. {
  78. if(response) // If they clicked 'Select' or double-clicked a weapon
  79. {
  80. // Give them the weapon
  81. switch(listitem)
  82. {
  83. case 0:
  84. {
  85. new string[128]; new name[MAX_PLAYER_NAME];
  86. GetPlayerName(playerid, name, sizeof(name));
  87. SetPlayerPos(playerid, -975.975708,1060.983032,1345.671875);
  88. SetPlayerInterior(playerid, 10);
  89. DM[playerid] = 1;
  90. GivePlayerWeapon(playerid, 24, 50000);
  91. GivePlayerWeapon(playerid, 26, 50000);
  92. GivePlayerWeapon(playerid, 28, 50000);
  93. GivePlayerWeapon(playerid, 34, 50000);
  94. GivePlayerWeapon(playerid, 31, 50000);
  95. GivePlayerWeapon(playerid, 16, 50000);
  96. SetPlayerWantedLevel(playerid, 0);
  97. format(string, sizeof(string), "[ARENA] {FFFFFF}%s has joined Death Match Stadium!",name);
  98. SendClientMessageToAll(0x00ECECFF, string);
  99. SendClientMessage(playerid, 0x00ECECFF, "[ARENA] {FFFFFF}You've joined DM arena, Type /leavedm if you want to leave it.");
  100. }
  101. case 1:
  102. {
  103. new string[128]; new name[MAX_PLAYER_NAME];
  104. GetPlayerName(playerid, name, sizeof(name));
  105. SetPlayerPos(playerid, 1412.639892,-1.787510,1000.924377);
  106. SetPlayerInterior(playerid, 1);
  107. DM[playerid] = 1;
  108. GivePlayerWeapon(playerid, 26, 50000);
  109. SetPlayerWantedLevel(playerid,0);
  110. format(string, sizeof(string), "[ARENA] {FFFFFF}%s has joined Sawn-off DeathMatch!",name);
  111. SendClientMessageToAll(0x00ECECFF, string);
  112. SendClientMessage(playerid, 0x00ECECFF, "[ARENA] {FFFFFF}You've joined DM arena, Type /leavedm if you want to leave it.");
  113. }
  114. case 2:
  115. {
  116. new string[128]; new name[MAX_PLAYER_NAME];
  117. GetPlayerName(playerid, name, sizeof(name));
  118. SetPlayerPos(playerid,1302.519897,-1.787510,1001.028259);
  119. SetPlayerInterior(playerid, 18);
  120. DM[playerid] = 1;
  121. GivePlayerWeapon(playerid, 24, 50000);
  122. SetPlayerWantedLevel(playerid,0);
  123. format(string, sizeof(string), "[ARENA] {FFFFFF}%s has joined Desert-Eagle DeathMatch!",name);
  124. SendClientMessageToAll(0x00ECECFF, string);
  125. SendClientMessage(playerid, 0x00ECECFF, "[ARENA] {FFFFFF}You've joined DM arena, Type /leavedm if you want to leave it.");
  126. }
  127. case 3:
  128. {
  129. new string[128]; new name[MAX_PLAYER_NAME];
  130. GetPlayerName(playerid, name, sizeof(name));
  131. SetPlayerPos(playerid,288.745971,169.350997,1007.171875);
  132. SetPlayerVirtualWorld(playerid, 3);
  133. DM[playerid] = 1;
  134. GivePlayerWeapon(playerid, 24, 50000);
  135. GivePlayerWeapon(playerid, 25, 50000);
  136. SetPlayerWantedLevel(playerid,0);
  137. format(string, sizeof(string), "[ARENA] {FFFFFF}%s has joined Desert-Eagle & ShotGun DeathMatch!",name);
  138. SendClientMessageToAll(0x00ECECFF, string);
  139. SendClientMessage(playerid, 0x00ECECFF, "[ARENA] {FFFFFF}You've joined DM arena, Type /leavedm if you want to leave it.");
  140. }
  141. case 4:
  142. {
  143. new string[128]; new name[MAX_PLAYER_NAME];
  144. GetPlayerName(playerid, name, sizeof(name));
  145. SetPlayerPos(playerid, -1401.829956,107.051300,1032.273437);
  146. SetPlayerInterior(playerid, 1);
  147. DM[playerid] = 1;
  148. GivePlayerWeapon(playerid, 16, 50000);
  149. SetPlayerWantedLevel(playerid,0);
  150. format(string, sizeof(string), "[ARENA] {FFFFFF}%s has joined Grenades DeathMatch!",name);
  151. SendClientMessageToAll(0x00ECECFF, string);
  152. SendClientMessage(playerid, 0x00ECECFF, "[ARENA] {FFFFFF}You've joined DM arena, Type /leavedm if you want to leave it.");
  153. }
  154. }
  155. }
  156. return 1;
  157. }
  158.  
  159. return 0;
  160. }
  161.  
  162.  
  163. CMD:leavedm(playerid, params[])
  164. {
  165. new string[128]; new name[MAX_PLAYER_NAME];
  166. GetPlayerName(playerid, name, sizeof(name));
  167. if(DM[playerid] == 0)
  168. {
  169. SendClientMessage(playerid, 0x00ECECFF, "[ARENA] {FFFFFF}You are not at the DM arena!");
  170. return 1;
  171. }
  172. else if(DM[playerid] == 1)
  173. {
  174. DM[playerid] = 0;
  175. SetPlayerVirtualWorld(playerid, 0);
  176. SetPlayerInterior(playerid, 0);
  177. SendClientMessage(playerid, 0x00ECECFF, "[ARENA] {FFFFFF}You have left the DM arena!");
  178. format(string, sizeof(string), "[ARENA] {FFFFFF}%s has left Death Match Arena!",name);
  179. SendClientMessageToAll(0x00ECECFF, string);
  180. SpawnPlayer(playerid);
  181. return 1;
  182. }
  183. return 1;
  184. }
  185.  
  186. public OnPlayerDeath(playerid, killerid, reason)
  187. {
  188. new string[128]; new name[MAX_PLAYER_NAME]; new name2[MAX_PLAYER_NAME];
  189. GetPlayerName(playerid, name, sizeof(name));
  190. GetPlayerName(killerid, name2, sizeof(name2));
  191. format(string, sizeof(string)," %s(ID:%i) Fucked and pwn3d %s(ID:%i)",name, playerid, name2, killerid);
  192. SendClientMessageToAll(0xF568F48F, string);
  193. return 1;
  194. }
  195.  
  196. public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
  197. {
  198. if(issuerid != INVALID_PLAYER_ID && weaponid == 34 && bodypart == 9)
  199. {
  200. new string[64];
  201. new name[MAX_PLAYER_NAME];
  202. new name2[MAX_PLAYER_NAME];
  203.  
  204. GetPlayerName(playerid, name, sizeof(name));
  205. GetPlayerName(issuerid, name2, sizeof(name2));
  206. SetPlayerHealth(playerid, 0.0);
  207. format(string, sizeof(string), "[HEADSHOT]: {F27D0C}%s(%i) Has HeadShotted %s(%i) And Received +2 Scores And +20000$", name2, issuerid, name, playerid);
  208. SendClientMessageToAll(0xF490F49F, string);
  209. GameTextForPlayer(playerid,"~r~~r~~r~You were headshotted!",5000, 3); //Sets Gametext to the damage receiver.
  210. GameTextForPlayer(issuerid,"~g~~g~~g~Headshot!~r~~r~~r~ +2 score!",5000, 3); //Sets Gametext to the damage issuer.
  211. SetPlayerScore(issuerid, GetPlayerScore(issuerid) + 2); //Gives score to the damage issuer.
  212. GivePlayerMoney(issuerid, 20000);
  213. SetPlayerWantedLevel(issuerid, 6);
  214. }
  215. return 1;
  216. }
Add Comment
Please, Sign In to add comment