DMRadar.pwn 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271
  1. #include <a_samp>
  2. // Sews DMRadar... A simple set-up to identify DM, and watching who is responsible.
  3. // This contains a function and the concept comes from PEN:LS.
  4. // Credits to Sneaky, and who-ever made the basis for, pen1...
  5. #define L1KILLER_COLOR 0x9F0000C8
  6. #define L1KILLER1_COLOR 0x9F000099
  7. #define L1KILLER2_COLOR 0x9F000088
  8. #define L1KILLER3_COLOR 0x9F000077
  9. #define L1KILLER4_COLOR 0x9F000066
  10. #define L1KILLER5_COLOR 0x9F000055
  11. #define L1KILLER6_COLOR 0x9F000044
  12. #define L1KILLER7_COLOR 0x9F000033
  13. #define L1KILLER8_COLOR 0x9F000022
  14. #define L1KILLER9_COLOR 0x9F000011
  15. #define L1KILLER10_COLOR 0x9F000000
  16. #define L2KILLER_COLOR 0xAE0000C8
  17. #define L2KILLER1_COLOR 0xAE000099
  18. #define L2KILLER2_COLOR 0xAE000088
  19. #define L2KILLER3_COLOR 0xAE000077
  20. #define L2KILLER4_COLOR 0xAE000066
  21. #define L2KILLER5_COLOR 0xAE000055
  22. #define L2KILLER6_COLOR 0xAE000044
  23. #define L2KILLER7_COLOR 0xAE000033
  24. #define L2KILLER8_COLOR 0xAE000022
  25. #define L2KILLER9_COLOR 0xAE000011
  26. #define L2KILLER10_COLOR 0xAE000000
  27. #define L3KILLER_COLOR 0x8D0000C8
  28. #define L3KILLER1_COLOR 0x8D000099
  29. #define L3KILLER2_COLOR 0x8D000088
  30. #define L3KILLER3_COLOR 0x8D000077
  31. #define L3KILLER4_COLOR 0x8D000066
  32. #define L3KILLER5_COLOR 0x8D000055
  33. #define L3KILLER6_COLOR 0x8D000044
  34. #define L3KILLER7_COLOR 0x8D000033
  35. #define L3KILLER8_COLOR 0x8D000022
  36. #define L3KILLER9_COLOR 0x8D000011
  37. #define L3KILLER10_COLOR 0x8D000000
  38. #define L4KILLER_COLOR 0xCC0000C8
  39. #define L4KILLER1_COLOR 0xCC000099
  40. #define L4KILLER2_COLOR 0xCC000088
  41. #define L4KILLER3_COLOR 0xCC000077
  42. #define L4KILLER4_COLOR 0xCC000066
  43. #define L4KILLER5_COLOR 0xCC000055
  44. #define L4KILLER6_COLOR 0xCC000044
  45. #define L4KILLER7_COLOR 0xCC000033
  46. #define L4KILLER8_COLOR 0xCC000022
  47. #define L4KILLER9_COLOR 0xCC000011
  48. #define L4KILLER10_COLOR 0xCC000000
  49. #define L5KILLER_COLOR 0xE50000C8
  50. #define L5KILLER1_COLOR 0xE5000099
  51. #define L5KILLER2_COLOR 0xE5000088
  52. #define L5KILLER3_COLOR 0xE5000077
  53. #define L5KILLER4_COLOR 0xE5000066
  54. #define L5KILLER5_COLOR 0xE5000055
  55. #define L5KILLER6_COLOR 0xE5000044
  56. #define L5KILLER7_COLOR 0xE5000033
  57. #define L5KILLER8_COLOR 0xE5000022
  58. #define L5KILLER9_COLOR 0xE5000011
  59. #define L5KILLER10_COLOR 0xE5000000
  60. #define L6KILLER_COLOR 0xFF0000C8
  61. #define L6KILLER1_COLOR 0xFF000099
  62. #define L6KILLER2_COLOR 0xFF000088
  63. #define L6KILLER3_COLOR 0xFF000077
  64. #define L6KILLER4_COLOR 0xFF000066
  65. #define L6KILLER5_COLOR 0xFF000055
  66. #define L6KILLER6_COLOR 0xFF000044
  67. #define L6KILLER7_COLOR 0xFF000033
  68. #define L6KILLER8_COLOR 0xFF000022
  69. #define L6KILLER9_COLOR 0xFF000011
  70. #define L6KILLER10_COLOR 0xFF000000
  71. #define INBETWEEN_COLOR 0x969696C8
  72. #define INBETWEEN1_COLOR 0x96969699
  73. #define INBETWEEN2_COLOR 0x96969688
  74. #define INBETWEEN3_COLOR 0x96969677
  75. #define INBETWEEN4_COLOR 0x96969666
  76. #define INBETWEEN5_COLOR 0x96969655
  77. #define INBETWEEN6_COLOR 0x96969644
  78. #define INBETWEEN7_COLOR 0x96969633
  79. #define INBETWEEN8_COLOR 0x96969622
  80. #define INBETWEEN9_COLOR 0x96969611
  81. #define INBETWEEN10_COLOR 0x96969600
  82. #define INNOCENT_COLOR 0x33FF66C8
  83. #define INNOCENT1_COLOR 0x33FF6699
  84. #define INNOCENT2_COLOR 0x33FF6688
  85. #define INNOCENT3_COLOR 0x33FF6677
  86. #define INNOCENT4_COLOR 0x33FF6666
  87. #define INNOCENT5_COLOR 0x33FF6655
  88. #define INNOCENT6_COLOR 0x33FF6644
  89. #define INNOCENT7_COLOR 0x33FF6633
  90. #define INNOCENT8_COLOR 0x33FF6622
  91. #define INNOCENT9_COLOR 0x33FF6611
  92. #define INNOCENT10_COLOR 0x33FF6600
  93. forward CopScanner();
  94. forward CrimProxDetector(Float:radi, playerid,col1,col2,col3,col4,col5,col6,col7,col8,col9,col10);
  95. new pDKCount[MAX_PLAYERS];
  96. new pCommited[MAX_PLAYERS];
  97. new Covert = 1;
  98. new Float:radardist = 500.0;
  99. public OnFilterScriptInit()
  100. {
  101. print("DM Radar");
  102. print("modified from penls");
  103. SetTimer("CopScanner", 1000, 1);
  104. return 1;
  105. }
  106. public OnFilterScriptExit()
  107. {
  108. return 1;
  109. }
  110. public OnPlayerConnect(playerid)
  111. {
  112. SetPVarInt(playerid, "Concerned", 0);
  113. pDKCount[playerid]=0;
  114. pCommited[playerid]=0;
  115. return 1;
  116. }
  117. public OnPlayerDisconnect(playerid, reason)
  118. {
  119. pDKCount[playerid]=0;
  120. pCommited[playerid]=0;
  121. return 1;
  122. }
  123. public OnPlayerDeath(playerid, killerid, reason)
  124. {
  125. SetPlayerColor(playerid,0x9A9999C8);
  126. pDKCount[playerid] = pDKCount[playerid] - 2;
  127. if(killerid!=INVALID_PLAYER_ID)
  128. {
  129. if(GetPVarInt(playerid, "Concerned")&&!GetPVarInt(killerid, "Concerned"))
  130. {
  131. pDKCount[killerid] = pDKCount[killerid] + 5;
  132. }
  133. if(!GetPVarInt(killerid, "Concerned"))
  134. {
  135. pDKCount[killerid] = pDKCount[killerid] + (GetPlayerScore(playerid));
  136. pCommited[killerid] = 1;
  137. }
  138. if(GetPVarInt(killerid, "Concerned"))
  139. {
  140. if(!Covert)
  141. {
  142. SendClientMessage(playerid, L6KILLER10_COLOR, " You have been killed for DMing.");
  143. SendClientMessage(playerid, L6KILLER10_COLOR, " If you have issues, /report. But really, Stop DMing...");
  144. }
  145. new DMername[24];
  146. new string[70];
  147. GetPlayerName(playerid, DMername, 24);
  148. format(string, sizeof(string), "You have killed %s and he had %i points.", DMername, pDKCount[playerid]);
  149. SendClientMessage(playerid, L6KILLER10_COLOR, string);
  150. pDKCount[playerid] = pDKCount[playerid] - 8;
  151. }
  152. }
  153. return 1;
  154. }
  155. public OnPlayerCommandText(playerid, cmdtext[])
  156. {
  157. if(!strcmp(cmdtext, "/covertops", true))
  158. {
  159. if(GetPVarInt(playerid, "Concerned")&&!Covert)
  160. {
  161. SendClientMessage(playerid, 0xFFFFFFFF, "CovertOps Enabled");
  162. Covert = 1;
  163. return 1;
  164. }
  165. if(!GetPVarInt(playerid, "Concerned")&&Covert)
  166. {
  167. SendClientMessage(playerid, 0xFFFFFFFF, "CovertOps Disabled");
  168. SendClientMessageToAll(0xFFFFFFFF, "DM/Non-RP Countermeasures, deplyed...");
  169. Covert = 0;
  170. return 1;
  171. }
  172. }
  173. return 0;
  174. }
  175. public CopScanner()
  176. {
  177. for(new i=0; i<MAX_PLAYERS; i++)
  178. {
  179. if(!IsPlayerConnected(i) || IsPlayerNPC(i)) continue;
  180. {
  181. if(pDKCount[i] >= 40) // High Kills
  182. {
  183. CrimProxDetector(radardist, i,L6KILLER1_COLOR,L6KILLER2_COLOR,L6KILLER3_COLOR,L6KILLER4_COLOR,L6KILLER5_COLOR,L6KILLER6_COLOR,L6KILLER7_COLOR,L6KILLER8_COLOR,L6KILLER9_COLOR,L6KILLER10_COLOR);
  184. }
  185. else if(pDKCount[i] < 40 && pDKCount[i] >= 32)
  186. {
  187. CrimProxDetector(radardist, i,L5KILLER1_COLOR,L5KILLER2_COLOR,L5KILLER3_COLOR,L5KILLER4_COLOR,L5KILLER5_COLOR,L5KILLER6_COLOR,L5KILLER7_COLOR,L5KILLER8_COLOR,L5KILLER9_COLOR,L5KILLER10_COLOR);
  188. }
  189. else if(pDKCount[i] < 32 && pDKCount[i] >= 24)
  190. {
  191. CrimProxDetector(radardist, i,L4KILLER1_COLOR,L4KILLER2_COLOR,L4KILLER3_COLOR,L4KILLER4_COLOR,L4KILLER5_COLOR,L4KILLER6_COLOR,L4KILLER7_COLOR,L4KILLER8_COLOR,L4KILLER9_COLOR,L4KILLER10_COLOR);
  192. }
  193. else if(pDKCount[i] < 24 && pDKCount[i] >= 16)
  194. {
  195. CrimProxDetector(radardist, i,L3KILLER1_COLOR,L3KILLER2_COLOR,L3KILLER3_COLOR,L3KILLER4_COLOR,L3KILLER5_COLOR,L3KILLER6_COLOR,L3KILLER7_COLOR,L3KILLER8_COLOR,L3KILLER9_COLOR,L3KILLER10_COLOR);
  196. }
  197. else if(pDKCount[i] < 16 && pDKCount[i] >= 8)
  198. {
  199. CrimProxDetector(radardist, i,L2KILLER1_COLOR,L2KILLER2_COLOR,L2KILLER3_COLOR,L2KILLER4_COLOR,L2KILLER5_COLOR,L2KILLER6_COLOR,L2KILLER7_COLOR,L2KILLER8_COLOR,L2KILLER9_COLOR,L2KILLER10_COLOR);
  200. }
  201. else if(pDKCount[i] < 8 && pDKCount[i] >= 0)
  202. {
  203. CrimProxDetector(radardist, i,L1KILLER1_COLOR,L1KILLER2_COLOR,L1KILLER3_COLOR,L1KILLER4_COLOR,L1KILLER5_COLOR,L1KILLER6_COLOR,L1KILLER7_COLOR,L1KILLER8_COLOR,L1KILLER9_COLOR,L1KILLER10_COLOR);
  204. }
  205. else if(pDKCount[i] < 2 && !pCommited[i]) // Low Kills
  206. {
  207. CrimProxDetector(radardist, i,INNOCENT1_COLOR,INNOCENT2_COLOR,INNOCENT3_COLOR,INNOCENT4_COLOR,INNOCENT5_COLOR,INNOCENT6_COLOR,INNOCENT7_COLOR,INNOCENT8_COLOR,INNOCENT9_COLOR,INNOCENT10_COLOR);
  208. }
  209. else
  210. {
  211. CrimProxDetector(radardist, i,INBETWEEN1_COLOR,INBETWEEN2_COLOR,INBETWEEN3_COLOR,INBETWEEN4_COLOR,INBETWEEN5_COLOR,INBETWEEN6_COLOR,INBETWEEN7_COLOR,INBETWEEN8_COLOR,INBETWEEN9_COLOR,INBETWEEN10_COLOR);
  212. }
  213. }
  214. }
  215. }
  216. public CrimProxDetector(Float:radi, playerid,col1,col2,col3,col4,col5,col6,col7,col8,col9,col10)
  217. {
  218. new Float:posx, Float:posy, Float:posz;
  219. new Float:oldposx, Float:oldposy, Float:oldposz;
  220. new Float:tempposx, Float:tempposy;
  221. new count;
  222. GetPlayerPos(playerid, oldposx, oldposy, oldposz);
  223. for(count = 10; count >= 0; count=count-1)
  224. {
  225. for(new i = 0; i <= MAX_PLAYERS; i++)
  226. {
  227. if(!IsPlayerConnected(i) || IsPlayerNPC(i) || !GetPVarInt(i, "Concerned")) continue;
  228. {
  229. GetPlayerPos(i, posx, posy, posz);
  230. tempposx = (oldposx -posx);
  231. tempposy = (oldposy -posy);
  232. if (((tempposx < radi/count) && (tempposx > -radi/count)) && ((tempposy < radi/count) && (tempposy > -radi/count)))
  233. {
  234. //printf("DEBUG: player %d has at range %d",i,count);
  235. if (count == 10) {SetPlayerMarkerForPlayer(i,playerid,col1);return 1;}
  236. else if (count == 9) {SetPlayerMarkerForPlayer(i,playerid,col1);return 1;}
  237. else if (count == 8) {SetPlayerMarkerForPlayer(i,playerid,col2);return 1;}
  238. else if (count == 7) {SetPlayerMarkerForPlayer(i,playerid,col3);return 1;}
  239. else if (count == 6) {SetPlayerMarkerForPlayer(i,playerid,col4);return 1;}
  240. else if (count == 5) {SetPlayerMarkerForPlayer(i,playerid,col5);return 1;}
  241. else if (count == 4) {SetPlayerMarkerForPlayer(i,playerid,col6);return 1;}
  242. else if (count == 3) {SetPlayerMarkerForPlayer(i,playerid,col7);return 1;}
  243. else if (count == 2) {SetPlayerMarkerForPlayer(i,playerid,col8);return 1;}
  244. else if (count == 1) {SetPlayerMarkerForPlayer(i,playerid,col9);return 1;}
  245. else {SetPlayerMarkerForPlayer(i,playerid,col10);return 1;}
  246. }
  247. }
  248. }
  249. }
  250. return 1;
  251. }