Sreyas

Advanced DM system v 2.0

Apr 10th, 2016
560
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 20.57 KB | None | 0 0
  1. /* Advanced Dm Fs By Sreyas V 2.0 Forum Account http://forum.sa-mp.com/member.php?u=268427
  2. ________________________________________________________________________________
  3. Please Dont Remove Credits
  4. Author:Sreyas
  5. ---------------------------------------------
  6. ||||||||||||||||||Change LOGS||||||||||||||||||||||||||||||||
  7. ------------------------------------------------------------|
  8. Version 2.0 |
  9. *Added 6 more dm zones (now total 10 zones) |
  10. *Added Dilaog with player list |
  11. *Added Headshot system can be switched by rcon admins |
  12. *Added Hitsound Feature can be switched by Players |
  13. *Added Textdraws for Showing Current Mode |
  14. *Optmised the code much |
  15. *Making Dms are now is Hell Easy |
  16. *Added Feature for Blocking CMDS in DM |
  17. *Added Musics for each dm |
  18. *Added DM chat.Now players in DM can chat prefixing '#' |
  19. *Added Killstreak System |
  20. *and more features |
  21. *Fixed all Bugs in previous version |
  22. |
  23. ------------------------------------------------------------|
  24. Version 1.0 |
  25. *Simple system |
  26. *4 dm zones |
  27. *command dialogs |
  28. *Random spawns |
  29. ------------------------------------------------------------|
  30. */
  31.  
  32. #define FILTERSCRIPT
  33.  
  34.  
  35. #include<a_samp>
  36. #include<zcmd>
  37.  
  38.  
  39. #define RED "{FF0000}"
  40. #define GREY "{C0C4C4}"
  41. #define ORANGE "{F07F1D}"
  42. #define WHITE "{FFFFFF}"
  43. #define DIALOG_DM 345
  44. enum dminfo
  45. {
  46. indm,
  47. dmzone,
  48. DMScore,
  49. }
  50. new hshot=0;
  51. new hsound[MAX_PLAYERS];
  52. new Text:Textdraw0;
  53. new Text:Textdraw1[MAX_PLAYERS];
  54. new killstreak[MAX_PLAYERS];
  55. new Info[MAX_PLAYERS][dminfo];
  56.  
  57. public OnFilterScriptInit()
  58. {
  59.  
  60. printf("----------------------------------------------");
  61. printf("| Advanced Dm system v 2.0 By Sreyas Loaded |");
  62. printf("----------------------------------------------");
  63.  
  64. Textdraw0 = TextDrawCreate(350.000000, 420.000000, "CurrentMode");
  65. TextDrawBackgroundColor(Textdraw0, 255);
  66. TextDrawFont(Textdraw0, 3);
  67. TextDrawLetterSize(Textdraw0, 0.500000, 1.200000);
  68. TextDrawColor(Textdraw0, -65281);
  69. TextDrawSetOutline(Textdraw0, 1);
  70. TextDrawUseBox(Textdraw0, 1);
  71. TextDrawBoxColor(Textdraw0, 255);
  72. TextDrawTextSize(Textdraw0, 658.000000, 278.000000);
  73.  
  74.  
  75.  
  76. return 1;
  77. }
  78.  
  79. public OnFilterScriptExit()
  80. {
  81. printf("----------------------------------------------");
  82. printf("|Advanced Dm system v 2.0 By Sreyas Unloaded |");
  83. printf("----------------------------------------------");
  84. TextDrawHideForAll(Textdraw0);
  85. TextDrawDestroy(Textdraw0);
  86.  
  87. return 1;
  88. }
  89.  
  90. public OnPlayerSpawn(playerid)
  91. {
  92.  
  93. if (Info[playerid][indm] == 1)
  94. {
  95. respawnindm(playerid);
  96. }
  97. return 1;
  98. }
  99.  
  100.  
  101. public OnPlayerCommandReceived(playerid, cmdtext[])
  102. {
  103.  
  104. if(Info[playerid][indm] == 1 )
  105. {
  106. //ADD "ALLOWED" CMDS BELOW!!--------------------------------------------------------------------------------
  107. if(!strfind(cmdtext, "/leave")) return 1;
  108. else if(!strfind(cmdtext, "/dm")) return 1;
  109. else if(!strfind(cmdtext, "/de")) return 1;
  110. else if(!strfind(cmdtext, "/sos")) return 1;
  111. else if(!strfind(cmdtext, "/rw")) return 1;
  112. else if(!strfind(cmdtext, "/sos2")) return 1;
  113. else if(!strfind(cmdtext, "/snipedm")) return 1;
  114. else if(!strfind(cmdtext, "/shotdm")) return 1;
  115. else if(!strfind(cmdtext, "/sniepdm2")) return 1;
  116. else if(!strfind(cmdtext, "/mini")) return 1;
  117. else if(!strfind(cmdtext, "/shipdm")) return 1;
  118. else if(!strfind(cmdtext, "/wz")) return 1;
  119. //---------------------------------------------------------------------------------------------------------
  120. GameTextForPlayer(playerid, "~w~You are not in Freeroam ~r~/leave ~w~to Exit", 5000, 5);
  121.  
  122. return 0;
  123. }
  124. return 1;
  125. }
  126.  
  127. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  128. {
  129. if(dialogid == DIALOG_DM)
  130. {
  131. if(response)
  132. {
  133. switch(listitem)
  134. {
  135. case 0:return cmd_de(playerid);
  136. case 1:return cmd_rw(playerid);
  137. case 2:return cmd_sos(playerid);
  138. case 3:return cmd_snipedm(playerid);
  139. case 4:return cmd_sos2(playerid);
  140. case 5:return cmd_snipedm2(playerid);
  141. case 6:return cmd_shotdm(playerid);
  142. case 7:return cmd_mini(playerid);
  143. case 8:return cmd_wz(playerid);
  144. case 9:return cmd_shipdm(playerid);
  145. }
  146. }
  147. }
  148. return 1;
  149. }
  150.  
  151. public OnPlayerText(playerid, text[])
  152. {
  153.  
  154. if(text[0] == '#' && Info[playerid][indm] == 1)
  155. {
  156. new str[128], name[MAX_PLAYER_NAME];
  157. GetPlayerName(playerid, name, sizeof(name));
  158. format(str, sizeof(str), ""RED"[DM CHAT]"ORANGE" %s: "WHITE"%s", name, text[1]);
  159.  
  160. for(new i = 0; i < MAX_PLAYERS; i++)
  161. {
  162. if(!IsPlayerConnected(i)) continue;
  163. if(Info[i][indm] == 0 )continue;
  164.  
  165. SendClientMessage(i, -1, str);
  166. }
  167.  
  168. return 0;
  169. }
  170. return 1;
  171. }
  172.  
  173.  
  174. public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
  175. {
  176.  
  177. if(hsound[issuerid] != 0)
  178. {
  179. PlayerPlaySound(issuerid, 17802, 0.0, 0.0, 0.0);
  180. }
  181. if (hshot ==1 && Info[playerid][indm] == 1)
  182. {
  183. if(weaponid == 24 || weaponid == 34)
  184. {
  185. if(bodypart == 9)
  186. {
  187. SetPlayerHealth(playerid, 0);
  188. GameTextForPlayer(issuerid,"~r~Headshot",2000,3);
  189. GameTextForPlayer(playerid,"~r~Headshot",2000,3);
  190. PlayerPlaySound(issuerid, 17802, 0.0, 0.0, 0.0);
  191. PlayerPlaySound(playerid, 17802, 0.0, 0.0, 0.0);
  192. }
  193. }
  194. }
  195. return 1;
  196. }
  197.  
  198. public OnPlayerDeath(playerid,killerid,reason)
  199. {
  200. new str[128];
  201. new name[32];
  202. GetPlayerName(killerid,name,32);
  203. if(Info[playerid][indm] == 1)
  204. {
  205. respawnindm(playerid);
  206. killstreak[killerid]++;
  207. killstreak[playerid] = 0;
  208. }
  209.  
  210. switch(killstreak[killerid])
  211. {
  212.  
  213. case 3:
  214. {
  215.  
  216. format(str,sizeof(str),""RED"[DM]"ORANGE" %s "GREY"is now "WHITE"Killing Spree"GREY"!!",name);
  217. SendClientMessageToAll(-1,str);
  218. }
  219. case 5:
  220. {
  221. format(str,sizeof(str),""RED"[DM]"ORANGE" %s "GREY"is now "WHITE"Dominating!!"GREY"!!",name);
  222. SendClientMessageToAll(-1,str);
  223. }
  224. case 6:
  225. {
  226. format(str,sizeof(str),""RED"[DM]"ORANGE" %s "GREY"is now "WHITE"UnStoppable!!"GREY"!!",name);
  227. SendClientMessageToAll(-1,str);
  228. }
  229. case 7:
  230. {
  231. format(str,sizeof(str),""RED"[DM]"ORANGE" %s "GREY"is now "WHITE"Wicked Sick!!"GREY"!!",name);
  232. SendClientMessageToAll(-1,str);
  233. }
  234. case 8:
  235. {
  236. format(str,sizeof(str),""RED"[DM]"ORANGE" %s "GREY"is now "WHITE"Monster like!!"GREY"!!",name);
  237. SendClientMessageToAll(-1,str);
  238. }
  239. case 9:
  240. {
  241. format(str,sizeof(str),""RED"[DM]"ORANGE" %s "GREY"is now "WHITE"GOD LIKE!!"GREY"!!",name);
  242. SendClientMessageToAll(-1,str);
  243. }
  244. case 10:
  245. {
  246. format(str,sizeof(str),""RED"[DM]"ORANGE" %s "GREY"is now "WHITE"Immortal!!"GREY"!!",name);
  247. SendClientMessageToAll(-1,str);
  248. SetPlayerArmour(killerid,100);
  249. }
  250. }
  251. return 1;
  252. }
  253.  
  254. public OnPlayerConnect(playerid)
  255. {
  256.  
  257. createtext(playerid,"Freeroam");
  258.  
  259. hsound[playerid] = 0;
  260. TextDrawShowForPlayer(playerid, Textdraw0);
  261. TextDrawShowForPlayer(playerid, Textdraw1[playerid]);
  262. Info[playerid][indm] = 0;
  263. killstreak[playerid] = 0;
  264. return 1;
  265. }
  266.  
  267. new Float:RandomSpawnsDE[][] =
  268. {
  269.  
  270. {242.5503,176.5623,1003.0300,93.6148},
  271. {240.5619,195.8680,1008.1719,91.7114},
  272. {253.4729,190.7446,1008.1719,115.2117},
  273. {288.745971, 169.350997, 1007.171875}
  274.  
  275.  
  276. };
  277.  
  278. new Float:RandomSpawnsRW[][] =
  279. {
  280. {1360.0864,-21.3368,1007.8828,183.3211},
  281. {1402.2295,-33.9128,1007.8819,273.5619},
  282. {253.4729,190.7446,1008.1719,115.2117},
  283. {1361.5745,-47.8980,1000.9238,104.6970}
  284.  
  285. };
  286.  
  287. new Float:RandomSpawnsSOS[][] =
  288. {
  289. {-1053.9221,1022.5436,1343.1633,286.6894},
  290. {-975.975708,1060.983032,1345.671875},
  291. {-1131.4167,1042.4703,1345.7369,230.2888}
  292. };
  293.  
  294.  
  295. new Float:RandomSpawnsSNIPE[][] =
  296. {
  297. {-2640.762939, 1406.682006, 906.460937},
  298. {-2664.6062,1392.3625,912.4063,60.4372},
  299. {-2670.5549,1425.4402,912.4063,179.1681}
  300. };
  301.  
  302.  
  303. new Float:RandomSpawnsSOS2[][] =
  304. {
  305. {1322.2629,2753.8525,10.8203,67.4993},
  306. {1197.6454,2795.0579,10.8203,13.2921},
  307. {1365.6454,2809.0579,10.8203,13.2921}
  308.  
  309. };
  310.  
  311. new Float:RandomSpawnsSHOT[][] =
  312. {
  313. {2205.2983,1553.3098,1008.3852,275.1326},
  314. {2172.6226,1577.2854,999.9670,186.4819},
  315. {2188.4739,1619.3770,999.9766,0.0467},
  316. {2218.1841,1615.2228,999.9827,334.6665}
  317. };
  318.  
  319. new Float:RandomSpawnsSNIPE2[][] =
  320. {
  321. {2209.0427,1063.0984,71.3284,328.9798 },
  322. {2217.0649,1091.5931,29.5850,346.5500 },
  323. {2286.3674,1171.7701,85.9375,151.3414 },
  324. {2289.5737,1054.5160,26.7031,240.9556 }
  325. };
  326.  
  327.  
  328. new Float:RandomSpawnsMINI[][] =
  329. {
  330. {-2356.9077,1539.1139,26.0469,84.7713 },
  331. {-2367.2000,1541.5798,17.3281,10.1972 },
  332.  
  333. {-2388.3159,1543.0730,26.0469,185.8829 },
  334. {-2411.0122,1547.8350,26.0469,280.8965 },
  335. {-2423.4104,1547.9592,23.1406,96.9681},
  336. {-2434.5415,1544.7043,8.3984,289.0432},
  337. {-2392.1448,1548.3545,2.1172,183.7622 },
  338. {-2435.7583,1538.8330,11.7656,274.9664},
  339. {-2373.3687,1551.5563,2.1172,133.3617},
  340. {-2372.2913,1537.6198,10.8209,28.3940}
  341. };
  342.  
  343. new Float:RandomSpawnsWZ[][] =
  344. {
  345. {241.3928,1873.1758,11.4531,273.7038},
  346. {254.0595,1861.3322,8.7578,140.2225},
  347. {253.7986,1817.8022,4.7175,82.2553},
  348. {243.0909,1802.6503,7.4141,45.5949},
  349. {217.8072,1823.2727,6.4141,246.4435},
  350. {264.9873,1843.3636,7.5076,50.9452},
  351. {245.5841,1824.6747,7.5547,280.2840},
  352. {314.2634,1847.7885,7.7266,284.6707},
  353. {261.1926,1883.6488,8.4375,272.7639},
  354. {271.4502,1878.3483,-2.4125,41.3287},
  355. {267.2027,1878.4490,-22.9237,358.2578},
  356. {268.9091,1883.4457,-30.0938,224.7766},
  357. {273.5457,1855.9456,8.7649,61.2620},
  358. {274.8059,1871.2070,8.7578,227.9569},
  359. {296.7946,1865.6255,8.6411,223.1364}
  360. };
  361.  
  362. new Float:RandomSpawnsSHIP[][] =
  363. {
  364. {-1334.0657,512.9581,11.1953,51.5368},
  365. {-1342.2621,498.1203,11.1953,274.9456},
  366. {-1296.5226,505.3504,11.1953,133.9676},
  367. {-1368.6232,517.2023,11.1971,44.0400},
  368. {-1396.0570,498.9916,11.2026,322.5726}
  369. };
  370.  
  371. CMD:de(playerid)
  372. {
  373.  
  374. PlayAudioStreamForPlayer(playerid, "https://api.soundcloud.com/tracks/92808996/stream?client_id=6fe9ed8a7148a74c9cedcb2e11c0639b");
  375. new Random = random(sizeof(RandomSpawnsDE));
  376. createdm(playerid,RandomSpawnsDE[Random][0], RandomSpawnsDE[Random][1], RandomSpawnsDE[Random][2], RandomSpawnsDE[Random][3],3,1,1,24,25,100,"~r~DEAGLE DM");
  377. createtext(playerid,"Deagle DM");
  378.  
  379. return 1;
  380. }
  381.  
  382. CMD:rw(playerid)
  383. {
  384. PlayAudioStreamForPlayer(playerid,"https://api.soundcloud.com/tracks/81448034/stream?client_id=6fe9ed8a7148a74c9cedcb2e11c0639b");
  385. new Random = random(sizeof(RandomSpawnsRW));
  386. createdm(playerid,RandomSpawnsRW[Random][0], RandomSpawnsRW[Random][1], RandomSpawnsRW[Random][2], RandomSpawnsRW[Random][3],1,2,2,26,28,100,"~r~Running Weapons DM!");
  387. createtext(playerid,"Running Dm");
  388. return 1;
  389. }
  390.  
  391. CMD:sos(playerid)
  392. {
  393. PlayAudioStreamForPlayer(playerid,"http://cache.glujar.com/1724_4958_O104_8958_79/prometheus-rising-(immediate-music).mp3");
  394. new Random = random(sizeof(RandomSpawnsSOS));
  395. createdm(playerid,RandomSpawnsSOS[Random][0], RandomSpawnsSOS[Random][1], RandomSpawnsSOS[Random][2], RandomSpawnsSOS[Random][3],10,3,3,26,32,100,"~r~Sawn-Off DM!");
  396. createtext(playerid,"Sawnoff DM");
  397. return 1;
  398. }
  399.  
  400. CMD:snipedm(playerid)
  401. {
  402.  
  403. PlayAudioStreamForPlayer(playerid,"https://api.soundcloud.com/tracks/58313369/stream?client_id=6fe9ed8a7148a74c9cedcb2e11c0639b");
  404. new Random = random(sizeof(RandomSpawnsSNIPE));
  405. createdm(playerid,RandomSpawnsSNIPE[Random][0], RandomSpawnsSNIPE[Random][1], RandomSpawnsSNIPE[Random][2], RandomSpawnsSNIPE[Random][3],3,4,4,25,34,100,"~r~Sniper DM!");
  406. createtext(playerid,"Sniper DM");
  407. return 1;
  408. }
  409.  
  410. CMD:sos2(playerid)
  411. {
  412. PlayAudioStreamForPlayer(playerid,"http://c.mp3fly.in/get.php?id=d1MijkVrf50&name=Bleach+OST+-+Quincys+Craft+%5BHQ%5D+%5BExtended%5D&hash=9841f31eb9bccfd7b187dec7b0bb21ac3d006d0e&expire=1460101802");
  413. new Random = random(sizeof(RandomSpawnsSOS2));
  414. createdm(playerid,RandomSpawnsSOS2[Random][0], RandomSpawnsSOS2[Random][1], RandomSpawnsSOS2[Random][2], RandomSpawnsSOS2[Random][3],0,5,5,26,0,100, "~r~Sawn Off DM 2");
  415. createtext(playerid,"Sawn off 2 DM");
  416. return 1;
  417. }
  418.  
  419. CMD:shotdm(playerid)
  420. {
  421.  
  422. PlayAudioStreamForPlayer(playerid,"https://api.soundcloud.com/tracks/81448034/stream?client_id=6fe9ed8a7148a74c9cedcb2e11c0639b");
  423. new Random = random(sizeof(RandomSpawnsSHOT));
  424. createdm(playerid,RandomSpawnsSHOT[Random][0], RandomSpawnsSHOT[Random][1], RandomSpawnsSHOT[Random][2], RandomSpawnsSHOT[Random][3],1,6,6,27,0,100, "~r~Shot GUN DM");
  425. createtext(playerid,"Shotgun DM");
  426. return 1;
  427. }
  428.  
  429. CMD:snipedm2(playerid)
  430. {
  431. PlayAudioStreamForPlayer(playerid,"http://a.tumblr.com/tumblr_me4ljiCUkS1qcbq9jo1.mp3");
  432. new Random = random(sizeof(RandomSpawnsSNIPE2));
  433. createdm(playerid,RandomSpawnsSNIPE2[Random][0], RandomSpawnsSNIPE2[Random][1], RandomSpawnsSNIPE2[Random][2], RandomSpawnsSNIPE2[Random][3],0,7,7,34,0,100,"~r~Sniper Off DM 2");
  434. createtext(playerid,"Sniper 2 DM");
  435. return 1;
  436. }
  437.  
  438. CMD:mini(playerid)
  439. {
  440.  
  441. PlayAudioStreamForPlayer(playerid,"https://api.soundcloud.com/tracks/131876344/stream?client_id=6fe9ed8a7148a74c9cedcb2e11c0639b");
  442. new Random = random(sizeof(RandomSpawnsMINI));
  443. createdm(playerid,RandomSpawnsMINI[Random][0], RandomSpawnsMINI[Random][1], RandomSpawnsMINI[Random][2], RandomSpawnsMINI[Random][3],0,8,8,38,0,100,"~r~MINIGUN DM");
  444. createtext(playerid,"MiniGun DM");
  445. return 1;
  446. }
  447. CMD:wz(playerid)
  448. {
  449. PlayAudioStreamForPlayer(playerid,"http://216.227.134.162/ost/bleach-original-soundtrack-i/ghoerkxghd/20-storm-center.mp3");
  450. new Random = random(sizeof(RandomSpawnsWZ));
  451. createdm(playerid,RandomSpawnsWZ[Random][0], RandomSpawnsWZ[Random][1], RandomSpawnsWZ[Random][2], RandomSpawnsWZ[Random][3],0,9,9,31,16,100,"~r~War Zone");
  452. createtext(playerid,"Warzone DM");
  453. return 1;
  454. }
  455.  
  456. CMD:shipdm(playerid)
  457. {
  458. PlayAudioStreamForPlayer(playerid,"https://api.soundcloud.com/tracks/114534810/stream?client_id=6fe9ed8a7148a74c9cedcb2e11c0639b");
  459. new Random = random(sizeof(RandomSpawnsSHIP));
  460. createdm(playerid,RandomSpawnsSHIP[Random][0], RandomSpawnsSHIP[Random][1], RandomSpawnsSHIP[Random][2], RandomSpawnsSHIP[Random][3],0,10,10,23,29,100,"~r~Ship DM");
  461. createtext(playerid,"Ship DM");
  462. return 1;
  463. }
  464. CMD:leave ( playerid )
  465. {
  466.  
  467.  
  468.  
  469. if ( Info[playerid][indm] == 0 )
  470. {
  471. SendClientMessage(playerid, -1, ""RED"ERROR: "GREY"You are not in a deathmatch arena!" );
  472. return 1;
  473. }
  474. if ( Info[playerid][indm] == 1 )
  475. {
  476.  
  477. Info[playerid][indm] = 0;
  478. Info[playerid][dmzone] = 0;
  479.  
  480.  
  481. SetPlayerVirtualWorld(playerid, 0);
  482. SpawnPlayer(playerid);
  483.  
  484. SetPlayerInterior(playerid,0);
  485. SendClientMessage(playerid, -1, ""RED"[DM] "GREY"You have left the deathmatch arena!" );
  486.  
  487. StopAudioStreamForPlayer(playerid);
  488.  
  489. SetCameraBehindPlayer(playerid);
  490. createtext(playerid,"Freeroam");
  491. return 1;
  492. }
  493.  
  494. return 1;
  495. }
  496.  
  497.  
  498.  
  499. CMD:dm(playerid)
  500. {
  501. new string[900],pde,prw,psos,psnipe,psos2,psnipe2,pshot,pmini,pwz,pship;
  502.  
  503. for(new i=0;i<MAX_PLAYERS;i++)//sorry for using for loop some bug appeared in foreach thats why
  504. {
  505. if(IsPlayerConnected(i))
  506. {
  507. switch(Info[i][dmzone])
  508. {
  509.  
  510. case 1:pde++;
  511. case 2:prw++;
  512. case 3:psos++;
  513. case 4:psnipe++;
  514. case 5:psos2++;
  515. case 6:pshot++;
  516. case 7:psnipe2++;
  517. case 8:pmini++;
  518. case 9:pwz++;
  519. case 10:pship++;
  520. }
  521. }
  522. }
  523.  
  524. format(string,sizeof(string),
  525. ""ORANGE"Map\t"ORANGE"Players\n\
  526. "WHITE"Deagle (/de)\t%d\n\
  527. Running Weapons (/rw)\t%d\n\
  528. Sawn-Off Shotgun (/sos)\t%d\n\
  529. Sniper (/sniperdm)\t%d\n\
  530. Sawn-Off Shotgun 2(/sos2)\t%d\n\
  531. Sniper DM 2 (/snipedm2)\t%d\n\
  532. ShotGun DM (/shotdm)\t%d\n\
  533. MiniGun DM (/mini)\t%d\n\
  534. War Zone (/wz)\t%d\n\
  535. Ship DM (/shipdm)\t%d\n",pde,prw,psos,psnipe,psos2,psnipe2,pshot,pmini,pwz,pship);
  536. printf("pde = %d",pde);
  537. printf("indm = %d",Info[playerid][indm]);
  538. printf("zone = %d",Info[playerid][dmzone]);
  539. ShowPlayerDialog(playerid, DIALOG_DM, DIALOG_STYLE_TABLIST_HEADERS, ""RED"BFE Deathmatch",string, "Select","Cancel");
  540. return 1;
  541. }
  542.  
  543.  
  544. CMD:headshot(playerid)
  545. {
  546. if(!IsPlayerAdmin(playerid))return SendClientMessage(playerid,-1,""RED"You are not Authorised to use this Command! ");
  547. if(hshot == 1)
  548. {
  549. hshot = 0;
  550. SendClientMessageToAll(-1,""RED"Headshot Turned OFF By Admin ");
  551. return 1;
  552. }
  553.  
  554. if(hshot == 0)
  555. {
  556. hshot=1;
  557. SendClientMessageToAll(-1,""RED"Headshot Turned ON By Admin ");
  558. return 1;
  559. }
  560. return 1;
  561. }
  562.  
  563.  
  564. CMD:hitsound(playerid)
  565. {
  566. if(hsound[playerid] == 0)
  567. {
  568. SendClientMessage(playerid,-1,""ORANGE"HITSOUND TURNED "RED"ON");
  569. hsound[playerid] = 1;
  570. return 1;
  571. }
  572. if(hsound[playerid] == 1)
  573. {
  574. SendClientMessage(playerid,-1,""ORANGE"HITSOUND TURNED "RED"OFF");
  575. hsound[playerid] = 0;
  576. return 1;
  577. }
  578. return 1;
  579. }
  580.  
  581.  
  582.  
  583. SetPlayerPosition (playerid, Float:X, Float:Y, Float:Z, Float:A)
  584. {
  585. SetPlayerPos(playerid, X, Y, Z);
  586. SetPlayerFacingAngle(playerid, A);
  587. }
  588.  
  589. createdm(playerid,Float:X,Float:Y,Float:Z,Float:A,interior,virtualworld,zone,weapon1,weapon2,health,text[])
  590. {
  591.  
  592. Info[playerid][indm] = 1;
  593. Info[playerid][dmzone] = zone;
  594.  
  595.  
  596.  
  597. if (IsPlayerInAnyVehicle(playerid))
  598. {
  599. RemovePlayerFromVehicle(playerid);
  600. }
  601. SetPlayerPosition(playerid, X,Y,Z,A);
  602. SetPlayerInterior(playerid, interior);
  603. ResetPlayerWeapons(playerid);
  604. GameTextForPlayer(playerid, text, 2000, 3);
  605. SetPlayerFacingAngle(playerid, A);
  606. SetPlayerHealth(playerid, health);
  607. GivePlayerWeapon(playerid, weapon1, 100000);
  608. GivePlayerWeapon(playerid, weapon2, 100000);
  609. SetPlayerVirtualWorld(playerid, virtualworld);
  610.  
  611. return 1;
  612. }
  613.  
  614.  
  615. respawnindm(playerid)
  616. {
  617. switch (Info[playerid][dmzone])
  618.  
  619. {
  620.  
  621. case 1:
  622. {
  623. new Random = random(sizeof(RandomSpawnsDE));
  624. createdm(playerid,RandomSpawnsDE[Random][0], RandomSpawnsDE[Random][1], RandomSpawnsDE[Random][2], RandomSpawnsDE[Random][3],3,1,1,24,25,100,"");
  625.  
  626. }
  627.  
  628. case 2:
  629. {
  630. new Random = random(sizeof(RandomSpawnsRW));
  631. createdm(playerid,RandomSpawnsRW[Random][0], RandomSpawnsRW[Random][1], RandomSpawnsRW[Random][2], RandomSpawnsRW[Random][3],1,2,2,26,28,100,"");
  632. return 1;
  633. }
  634.  
  635. case 3:
  636. {
  637. new Random = random(sizeof(RandomSpawnsSOS));
  638. createdm(playerid,RandomSpawnsSOS[Random][0], RandomSpawnsSOS[Random][1], RandomSpawnsSOS[Random][2], RandomSpawnsSOS[Random][3],10,3,3,26,32,100,"");
  639. }
  640.  
  641. case 4:
  642. {
  643. new Random = random(sizeof(RandomSpawnsSNIPE));
  644. createdm(playerid,RandomSpawnsSNIPE[Random][0], RandomSpawnsSNIPE[Random][1], RandomSpawnsSNIPE[Random][2], RandomSpawnsSNIPE[Random][3],3,4,4,25,34,100,"");
  645. }
  646. case 5:
  647. {
  648. new Random = random(sizeof(RandomSpawnsSOS2));
  649. createdm(playerid,RandomSpawnsSOS2[Random][0], RandomSpawnsSOS2[Random][1], RandomSpawnsSOS2[Random][2], RandomSpawnsSOS2[Random][3],0,5,5,31,16,100,"");
  650. }
  651.  
  652. case 6:
  653. {
  654. new Random = random(sizeof(RandomSpawnsSHOT));
  655. createdm(playerid,RandomSpawnsSHOT[Random][0], RandomSpawnsSHOT[Random][1], RandomSpawnsSHOT[Random][2], RandomSpawnsSHOT[Random][3],1,6,6,27,0,100, "");
  656. }
  657.  
  658. case 7:
  659. {
  660. new Random = random(sizeof(RandomSpawnsSNIPE2));
  661. createdm(playerid,RandomSpawnsSNIPE2[Random][0], RandomSpawnsSNIPE2[Random][1], RandomSpawnsSNIPE2[Random][2], RandomSpawnsSNIPE2[Random][3],0,7,7,34,0,100,"");
  662. }
  663. case 8:
  664. {
  665. new Random = random(sizeof(RandomSpawnsMINI));
  666. createdm(playerid,RandomSpawnsMINI[Random][0], RandomSpawnsMINI[Random][1], RandomSpawnsMINI[Random][2], RandomSpawnsMINI[Random][3],0,8,8,38,0,100,"");
  667. }
  668. case 9:
  669. {
  670. new Random = random(sizeof(RandomSpawnsWZ));
  671. createdm(playerid,RandomSpawnsWZ[Random][0], RandomSpawnsWZ[Random][1], RandomSpawnsWZ[Random][2], RandomSpawnsWZ[Random][3],0,9,9,31,16,100,"");
  672. }
  673. case 10:
  674. {
  675. new Random = random(sizeof(RandomSpawnsSHIP));
  676. createdm(playerid,RandomSpawnsSHIP[Random][0], RandomSpawnsSHIP[Random][1], RandomSpawnsSHIP[Random][2], RandomSpawnsSHIP[Random][3],0,10,10,23,29,100,"");
  677. }
  678. }
  679. return 1;
  680. }
  681.  
  682.  
  683. createtext(playerid,te[])
  684. {
  685.  
  686. TextDrawHideForPlayer(playerid, Textdraw1[playerid]);
  687.  
  688.  
  689. Textdraw1[playerid] = TextDrawCreate(469.000000, 420.000000, te);
  690. TextDrawBackgroundColor(Textdraw1[playerid], 255);
  691. TextDrawFont(Textdraw1[playerid], 2);
  692. TextDrawLetterSize(Textdraw1[playerid], 0.519998, 1.200000);
  693. TextDrawColor(Textdraw1[playerid], -16776961);
  694. TextDrawSetOutline(Textdraw1[playerid], 0);
  695. TextDrawSetProportional(Textdraw1[playerid], 1);
  696. TextDrawSetShadow(Textdraw1[playerid], 1);
  697.  
  698. TextDrawShowForPlayer(playerid, Textdraw1[playerid]);
  699.  
  700. return 1;
  701. }
Add Comment
Please, Sign In to add comment