Advertisement
Guest User

mDM v0.2

a guest
Jul 11th, 2014
327
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 16.61 KB | None | 0 0
  1. #include <a_samp>
  2. #include <zcmd>
  3. new string[128];
  4. enum pinfo
  5. {
  6. DM,
  7. KillStreak,
  8. }
  9. new PlayerInfo[MAX_PLAYERS][pinfo];
  10. public OnFilterScriptInit()
  11. {
  12. return 1;
  13. }
  14.  
  15. public OnFilterScriptExit()
  16. {
  17. return 1;
  18. }
  19. public OnPlayerConnect(playerid)
  20. {
  21. PlayerInfo[playerid][DM] = 0;
  22. PlayerInfo[playerid][KillStreak] = 0;
  23. return 1;
  24. }
  25. public OnPlayerDisconnect(playerid, reason)
  26. {
  27. PlayerInfo[playerid][DM] = 0;
  28. PlayerInfo[playerid][KillStreak] = 0;
  29. return 1;
  30. }
  31. forward Unfreeze(playerid);
  32.  
  33. CMD:dm(playerid,params[])
  34. {
  35. TogglePlayerControllable(playerid, false); // Freeze the player
  36. SetTimerEx("Unfreeze", 5000, false, "i", playerid); // Make a 5 second timer for that player to get u
  37. PlayerInfo[playerid][DM] = 1;
  38. SetPlayerInterior(playerid, 10);
  39. new rand = random(2);
  40. if(rand == 0) SetPlayerPos(playerid, -1330.84,1057.67,1346.45);
  41. else SetPlayerPos(playerid, -974.35,1060.86,1345.64);
  42. PlayerInfo[playerid][KillStreak] = 0;
  43. ResetPlayerWeapons(playerid);
  44. GivePlayerWeapon(playerid,31,700);
  45. return 1;
  46. }
  47. CMD:leave(playerid,params[])
  48. {
  49. PlayerInfo[playerid][DM] = 0;
  50. PlayerInfo[playerid][KillStreak] = 0;
  51. SetPlayerHealth(playerid,0);
  52. SetPlayerInterior(playerid, 0);
  53. ResetPlayerWeapons(playerid);
  54. // SetPlayerPos here to your spawn location
  55. }
  56. public OnPlayerSpawn(playerid)
  57. {
  58. if(PlayerInfo[playerid][DM] = 1)
  59. {
  60. TogglePlayerControllable(playerid, false); // Freeze the player
  61. SetTimerEx("Unfreeze", 5000, false, "i", playerid); // Make a 5 second timer for that player to get u
  62. SetPlayerInterior(playerid, 10);
  63. new rand = random(2);
  64. if(rand == 0) SetPlayerPos(playerid, -1330.84,1057.67,1346.45);
  65. else SetPlayerPos(playerid, -974.35,1060.86,1345.64);
  66. PlayerInfo[playerid][KillStreak] = 0;
  67. ResetPlayerWeapons(playerid);
  68. GivePlayerWeapon(playerid,31,700);
  69. }
  70. return 1;
  71. }
  72. public OnPlayerDeath(playerid, killerid, reason)
  73. {
  74. new killername[24];
  75. new pname[24];
  76. GetPlayerName(playerid,pname,sizeof(pname));
  77. GetPlayerName(killerid,killername,sizeof(killername));
  78. new Float:health;
  79. GetPlayerHealth(killerid,health);
  80. if(PlayerInfo[killerid][KillStreak] = 0 && health > 50.0)
  81. {
  82. PlayerInfo[killerid][KillStreak] = 1;
  83. PlayerInfo[playerid][KillStreak] = 0;
  84. SetPlayerHealth (killerid,health + 10.0);
  85. for(new i=0; i<MAX_PLAYERS; i++)
  86. {
  87. if(PlayerInfo[i][DM] == 1)
  88. {
  89. format(string,sizeof(string),"{A6A6A6}[KILL]{FFFFFF}%s(%d) has raped %s(%d)",PlayerName(killerid),killerid,PlayerName(playerid),playerid);
  90. SendClientMessage(i,-1,string);
  91. }
  92. }
  93. return 0;
  94. }
  95. if(PlayerInfo[killerid][KillStreak] = 1 && health > 50.0)
  96. {
  97. PlayerInfo[killerid][KillStreak] = 2;
  98. PlayerInfo[playerid][KillStreak] = 0;
  99. SetPlayerHealth (killerid,health + 10.0);
  100. for(new i=0; i<MAX_PLAYERS; i++)
  101. {
  102. if(PlayerInfo[i][DM] == 1)
  103. {
  104. format(string,sizeof(string),"{A6A6A6}[KILL]{FFFFFF}%s(%d) has raped %s(%d)",PlayerName(killerid),killerid,PlayerName(playerid),playerid);
  105. SendClientMessage(i,-1,string);
  106. }
  107. }
  108. return 0;
  109. }
  110. if(PlayerInfo[killerid][KillStreak] = 2 && health > 50.0)
  111. {
  112. PlayerInfo[killerid][KillStreak] = 3;
  113. PlayerInfo[playerid][KillStreak] = 0;
  114. SetPlayerHealth (killerid,health + 10.0);
  115. for(new i=0; i<MAX_PLAYERS; i++)
  116. {
  117. if(PlayerInfo[i][DM] == 1)
  118. {
  119. format(string,sizeof(string),"{A6A6A6}[KILL]{FFFFFF}%s(%d) has raped %s(%d)",PlayerName(killerid),killerid,PlayerName(playerid),playerid);
  120. SendClientMessage(i,-1,string);
  121. }
  122. }
  123. return 0;
  124. }
  125. if(PlayerInfo[killerid][KillStreak] = 3 && health > 50.0)
  126. {
  127. PlayerInfo[killerid][KillStreak] = 4;
  128. PlayerInfo[playerid][KillStreak] = 0;
  129. SetPlayerHealth (killerid,health + 10.0);
  130. for(new i=0; i<MAX_PLAYERS; i++)
  131. {
  132. if(PlayerInfo[i][DM] == 1)
  133. {
  134. format(string,sizeof(string),"{A6A6A6}[KILL]{FFFFFF}%s(%d) has raped %s(%d)",PlayerName(killerid),killerid,PlayerName(playerid),playerid);
  135. SendClientMessage(i,-1,string);
  136. }
  137. }
  138. return 0;
  139. }
  140. if(PlayerInfo[killerid][KillStreak] = 4 && health > 50.0)
  141. {
  142. PlayerInfo[killerid][KillStreak] = 5;
  143. PlayerInfo[playerid][KillStreak] = 0;
  144. SetPlayerHealth (killerid,health + 10.0);
  145. GivePlayerWeapon(killerid,24,700);
  146. for(new i=0; i<MAX_PLAYERS; i++)
  147. {
  148. if(PlayerInfo[i][DM] == 1)
  149. {
  150. format(string,sizeof(string),"{A6A6A6}[KILLSTREAK]{FFFFFF}%s(%d) is on a {FF0000}five {FFFFFF}kill streak and he has recieved a {D9D975}deagle{FFFFFF}!",PlayerName(playerid),playerid);
  151. SendClientMessage(i,-1,string);
  152. }
  153. }
  154. return 0;
  155. }
  156. if(PlayerInfo[killerid][KillStreak] = 5 && health > 50.0)
  157. {
  158. PlayerInfo[killerid][KillStreak] = 6;
  159. PlayerInfo[playerid][KillStreak] = 0;
  160. SetPlayerHealth (killerid,health + 10.0);
  161. for(new i=0; i<MAX_PLAYERS; i++)
  162. {
  163. if(PlayerInfo[i][DM] == 1)
  164. {
  165. format(string,sizeof(string),"{A6A6A6}[KILL]{FFFFFF}%s(%d) has raped %s(%d)",PlayerName(killerid),killerid,PlayerName(playerid),playerid);
  166. SendClientMessage(i,-1,string);
  167. }
  168. }
  169. return 0;
  170. }
  171. if(PlayerInfo[killerid][KillStreak] = 6 && health > 50.0)
  172. {
  173. PlayerInfo[killerid][KillStreak] = 7;
  174. PlayerInfo[playerid][KillStreak] = 0;
  175. SetPlayerHealth (killerid,health + 10.0);
  176. for(new i=0; i<MAX_PLAYERS; i++)
  177. {
  178. if(PlayerInfo[i][DM] == 1)
  179. {
  180. format(string,sizeof(string),"{A6A6A6}[KILL]{FFFFFF}%s(%d) has raped %s(%d)",PlayerName(killerid),killerid,PlayerName(playerid),playerid);
  181. SendClientMessage(i,-1,string);
  182. }
  183. }
  184. return 0;
  185. }
  186. if(PlayerInfo[killerid][KillStreak] = 7 && health > 50.0)
  187. {
  188. PlayerInfo[killerid][KillStreak] = 8;
  189. PlayerInfo[playerid][KillStreak] = 0;
  190. SetPlayerHealth (killerid,health + 10.0);
  191. for(new i=0; i<MAX_PLAYERS; i++)
  192. {
  193. if(PlayerInfo[i][DM] == 1)
  194. {
  195. format(string,sizeof(string),"{A6A6A6}[KILL]{FFFFFF}%s(%d) has raped %s(%d)",PlayerName(killerid),killerid,PlayerName(playerid),playerid);
  196. SendClientMessage(i,-1,string);
  197. }
  198. }
  199. return 0;
  200. }
  201. if(PlayerInfo[killerid][KillStreak] = 8 && health > 50.0)
  202. {
  203. PlayerInfo[killerid][KillStreak] = 9;
  204. PlayerInfo[playerid][KillStreak] = 0;
  205. SetPlayerHealth (killerid,health + 10.0);
  206. for(new i=0; i<MAX_PLAYERS; i++)
  207. {
  208. if(PlayerInfo[i][DM] == 1)
  209. {
  210. format(string,sizeof(string),"{A6A6A6}[KILL]{FFFFFF}%s(%d) has raped %s(%d)",PlayerName(killerid),killerid,PlayerName(playerid),playerid);
  211. SendClientMessage(i,-1,string);
  212. }
  213. }
  214. return 0;
  215. }
  216. if(PlayerInfo[killerid][KillStreak] = 9 && health > 50.0)
  217. {
  218. PlayerInfo[killerid][KillStreak] = 10;
  219. PlayerInfo[playerid][KillStreak] = 0;
  220. SetPlayerHealth (killerid,health + 10.0);
  221. GivePlayerWeapon(killerid,26,700);
  222. for(new i=0; i<MAX_PLAYERS; i++)
  223. {
  224. if(PlayerInfo[i][DM] == 1)
  225. {
  226. format(string,sizeof(string),"{A6A6A6}[KILLSTREAK]{FFFFFF}%s(%d) is on a {FF0000}ten {FFFFFF}kill streak and he has recieved a {D9D975}Sawn Off Shotgun{FFFFFF}!",PlayerName(playerid),playerid);
  227. SendClientMessage(i,-1,string);
  228. }
  229. }
  230. return 0;
  231. }
  232.  
  233. if(PlayerInfo[killerid][KillStreak] = 0 && health < 50.0)
  234. {
  235. PlayerInfo[killerid][KillStreak] = 1;
  236. PlayerInfo[playerid][KillStreak] = 0;
  237. SetPlayerHealth (killerid,health + 10.0);
  238. for(new i=0; i<MAX_PLAYERS; i++)
  239. {
  240. if(PlayerInfo[i][DM] == 1)
  241. {
  242. format(string,sizeof(string),"{A6A6A6}[KILL]{FFFFFF}%s(%d) has killed %s(%d)",PlayerName(killerid),killerid,PlayerName(playerid),playerid);
  243. SendClientMessage(i,-1,string);
  244. }
  245. }
  246. return 0;
  247. }
  248. if(PlayerInfo[killerid][KillStreak] = 1 && health < 50.0)
  249. {
  250. PlayerInfo[killerid][KillStreak] = 2;
  251. PlayerInfo[playerid][KillStreak] = 0;
  252. SetPlayerHealth (killerid,health + 10.0);
  253. for(new i=0; i<MAX_PLAYERS; i++)
  254. {
  255. if(PlayerInfo[i][DM] == 1)
  256. {
  257. format(string,sizeof(string),"{A6A6A6}[KILL]{FFFFFF}%s(%d) has killed %s(%d)",PlayerName(killerid),killerid,PlayerName(playerid),playerid);
  258. SendClientMessage(i,-1,string);
  259. }
  260. }
  261. return 0;
  262. }
  263. if(PlayerInfo[killerid][KillStreak] = 2 && health < 50.0)
  264. {
  265. PlayerInfo[killerid][KillStreak] = 3;
  266. PlayerInfo[playerid][KillStreak] = 0;
  267. SetPlayerHealth (killerid,health + 10.0);
  268. for(new i=0; i<MAX_PLAYERS; i++)
  269. {
  270. if(PlayerInfo[i][DM] == 1)
  271. {
  272. format(string,sizeof(string),"{A6A6A6}[KILL]{FFFFFF}%s(%d) has killed %s(%d)",PlayerName(killerid),killerid,PlayerName(playerid),playerid);
  273. SendClientMessage(i,-1,string);
  274. }
  275. }
  276. return 0;
  277. }
  278. if(PlayerInfo[killerid][KillStreak] = 3 && health < 50.0)
  279. {
  280. PlayerInfo[killerid][KillStreak] = 4;
  281. PlayerInfo[playerid][KillStreak] = 0;
  282. SetPlayerHealth (killerid,health + 10.0);
  283. for(new i=0; i<MAX_PLAYERS; i++)
  284. {
  285. if(PlayerInfo[i][DM] == 1)
  286. {
  287. format(string,sizeof(string),"{A6A6A6}[KILL]{FFFFFF}%s(%d) has killed %s(%d)",PlayerName(killerid),killerid,PlayerName(playerid),playerid);
  288. SendClientMessage(i,-1,string);
  289. }
  290. }
  291. return 0;
  292. }
  293. if(PlayerInfo[killerid][KillStreak] = 4 && health < 50.0)
  294. {
  295. PlayerInfo[killerid][KillStreak] = 5;
  296. PlayerInfo[playerid][KillStreak] = 0;
  297. SetPlayerHealth (killerid,health + 10.0);
  298. GivePlayerWeapon(killerid,24,700);
  299. for(new i=0; i<MAX_PLAYERS; i++)
  300. {
  301. if(PlayerInfo[i][DM] == 1)
  302. {
  303. format(string,sizeof(string),"{A6A6A6}[KILLSTREAK]{FFFFFF}%s(%d) is on a {FF0000}five {FFFFFF}kill streak and he has recieved a {D9D975}deagle{FFFFFF}!",PlayerName(playerid),playerid);
  304. SendClientMessage(i,-1,string);
  305. }
  306. }
  307. return 0;
  308. }
  309. if(PlayerInfo[killerid][KillStreak] = 5 && health < 50.0)
  310. {
  311. PlayerInfo[killerid][KillStreak] = 6;
  312. PlayerInfo[playerid][KillStreak] = 0;
  313. SetPlayerHealth (killerid,health + 10.0);
  314. for(new i=0; i<MAX_PLAYERS; i++)
  315. {
  316. if(PlayerInfo[i][DM] == 1)
  317. {
  318. format(string,sizeof(string),"{A6A6A6}[KILL]{FFFFFF}%s(%d) has killed %s(%d)",PlayerName(killerid),killerid,PlayerName(playerid),playerid);
  319. SendClientMessage(i,-1,string);
  320. }
  321. }
  322. return 0;
  323. }
  324. if(PlayerInfo[killerid][KillStreak] = 6 && health < 50.0)
  325. {
  326. PlayerInfo[killerid][KillStreak] = 7;
  327. PlayerInfo[playerid][KillStreak] = 0;
  328. SetPlayerHealth (killerid,health + 10.0);
  329. for(new i=0; i<MAX_PLAYERS; i++)
  330. {
  331. if(PlayerInfo[i][DM] == 1)
  332. {
  333. format(string,sizeof(string),"{A6A6A6}[KILL]{FFFFFF}%s(%d) has killed %s(%d)",PlayerName(killerid),killerid,PlayerName(playerid),playerid);
  334. SendClientMessage(i,-1,string);
  335. }
  336. }
  337. return 0;
  338. }
  339. if(PlayerInfo[killerid][KillStreak] = 7 && health < 50.0)
  340. {
  341. PlayerInfo[killerid][KillStreak] = 8;
  342. PlayerInfo[playerid][KillStreak] = 0;
  343. SetPlayerHealth (killerid,health + 10.0);
  344. for(new i=0; i<MAX_PLAYERS; i++)
  345. {
  346. if(PlayerInfo[i][DM] == 1)
  347. {
  348. format(string,sizeof(string),"{A6A6A6}[KILL]{FFFFFF}%s(%d) has killed %s(%d)",PlayerName(killerid),killerid,PlayerName(playerid),playerid);
  349. SendClientMessage(i,-1,string);
  350. }
  351. }
  352. return 0;
  353. }
  354. if(PlayerInfo[killerid][KillStreak] = 8 && health < 50.0)
  355. {
  356. PlayerInfo[killerid][KillStreak] = 9;
  357. PlayerInfo[playerid][KillStreak] = 0;
  358. SetPlayerHealth (killerid,health + 10.0);
  359. for(new i=0; i<MAX_PLAYERS; i++)
  360. {
  361. if(PlayerInfo[i][DM] == 1)
  362. {
  363. format(string,sizeof(string),"{A6A6A6}[KILL]{FFFFFF}%s(%d) has killed %s(%d)",PlayerName(killerid),killerid,PlayerName(playerid),playerid);
  364. SendClientMessage(i,-1,string);
  365. }
  366. }
  367. return 0;
  368. }
  369. if(PlayerInfo[killerid][KillStreak] = 9 && health < 50.0)
  370. {
  371. PlayerInfo[killerid][KillStreak] = 10;
  372. PlayerInfo[playerid][KillStreak] = 0;
  373. GivePlayerWeapon(killerid,26,700);
  374. GivePlayerMoney(killerid,15000);
  375. for(new i=0; i<MAX_PLAYERS; i++)
  376. {
  377. if(PlayerInfo[i][DM] == 1)
  378. {
  379. format(string,sizeof(string),"{A6A6A6}[KILLSTREAK]{FFFFFF}%s(%d) is on a {FF0000}ten {FFFFFF}kill streak and he has recieved a {D9D975}Sawn Off Shotgun{FFFFFF}!",PlayerName(playerid),playerid);
  380. SendClientMessage(i,-1,string);
  381. }
  382. }
  383. return 0;
  384. }
  385.  
  386. return 1;
  387. }
  388. stock PlayerName(playerid)
  389. {
  390. new name[MAX_PLAYER_NAME];
  391. GetPlayerName(playerid, name, MAX_PLAYER_NAME);
  392. return name;
  393. }
  394. public Unfreeze(playerid)
  395. {
  396. TogglePlayerControllable(playerid, true); // Unfreeze the player after 5 seconds
  397. return 1;
  398. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement