Advertisement
iFenomenal

Rank CsGoUpdate 2019

Feb 11th, 2019
399
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.74 KB | None | 0 0
  1.  
  2. /* Plugin generated by AMXX-Studio */
  3.  
  4. #include <amxmodx>
  5. #include <amxmisc>
  6. #include <colorchat>
  7.  
  8. #define PLUGIN "Rank Go"
  9. #define VERSION "1.0"
  10. #define AUTHOR "pornhub"
  11.  
  12.  
  13. #define SilverII 200
  14. #define SilverIII 400
  15. #define SilverIV 800
  16. #define SilverE 1200
  17. #define SilverEM 1600
  18. #define GNI 2000
  19. #define GNII 2600
  20. #define GNIII 3200
  21. #define GNM 3600
  22. #define MGI 4200
  23. #define MGII 4800
  24. #define MGE 5400
  25. #define DMG 6200
  26. #define LE 7000
  27. #define LEM 8000
  28. #define SMFC 9000
  29. #define TGE 10000
  30.  
  31.  
  32. new KILLS[33];
  33. new File[128];
  34.  
  35. public plugin_init() {
  36. register_plugin(PLUGIN, VERSION, AUTHOR)
  37.  
  38. register_clcmd ( "say", "hook_say" );
  39. register_event ( "DeathMsg", "eDeath", "a" );
  40.  
  41. new DataDir[64]
  42. get_datadir(DataDir, 63)
  43. format(File, 127, "%s/CsGoRank.dat", DataDir)
  44. }
  45.  
  46. public hook_say ( e_Index )
  47. {
  48. static s_Said[ 192 ];
  49. read_args ( s_Said, charsmax ( s_Said ) );
  50.  
  51. if ( equal ( s_Said, "" ) || equal (s_Said, " " ))
  52. return 1;
  53. remove_quotes ( s_Said );
  54.  
  55.  
  56. new chatreply[192]
  57. parse(s_Said, chatreply, 191)
  58.  
  59. if (!chatreply[0])
  60. {
  61. return 1;
  62. }
  63.  
  64. static s_Name[ 32 ];
  65. get_user_name ( e_Index, s_Name, 31 );
  66.  
  67. if ( get_user_flags(e_Index) & ADMIN_KICK )
  68. {
  69. if ( KILLS[e_Index] < SilverII )
  70. {
  71. ColorChat ( 0, TEAM_COLOR, "^1[^4Silver I^1]^3%s^1:^4%s", s_Name, s_Said );
  72. }
  73. else if ( SilverII <= KILLS[e_Index] < SilverIII )
  74. {
  75. ColorChat ( 0, TEAM_COLOR, "^1[^4Silver II^1]^3%s^1:^4%s", s_Name, s_Said );
  76. }
  77. else if ( SilverIII <= KILLS[e_Index] < SilverIV )
  78. {
  79. ColorChat ( 0, TEAM_COLOR, "^1[^4Silver III^1]^3%s^1:^4%s", s_Name, s_Said );
  80. }
  81. else if ( SilverIV <= KILLS[e_Index] < SilverE )
  82. {
  83. ColorChat ( 0, TEAM_COLOR, "^1[^4Silver IV^1]^3%s^1:^4%s", s_Name, s_Said );
  84. }
  85. else if ( SilverE <= KILLS[e_Index] < SilverEM )
  86. {
  87. ColorChat ( 0, TEAM_COLOR, "^1[^4Silver Elite^1]^3%s^1:^4%s", s_Name, s_Said );
  88. }
  89. else if ( SilverEM <= KILLS[e_Index] < GNI )
  90. {
  91. ColorChat ( 0, TEAM_COLOR, "^1[^4Silver Elite Master^1]^3%s^1:^4%s", s_Name, s_Said );
  92. }
  93. else if ( GNI <= KILLS[e_Index] < GNII )
  94. {
  95. ColorChat ( 0, TEAM_COLOR, "^1[^4Gold Nova I^1]^3%s^1:^4%s", s_Name, s_Said );
  96. }
  97. else if ( GNII <= KILLS[e_Index] < GNIII )
  98. {
  99. ColorChat ( 0, TEAM_COLOR, "^1[^4Gold Nova II^1]^3%s^1:^4%s", s_Name, s_Said );
  100. }
  101. else if ( GNIII <= KILLS[e_Index] < GNM )
  102. {
  103. ColorChat ( 0, TEAM_COLOR, "^1[^4Gold Nova III^1]^3%s^1:^4%s", s_Name, s_Said );
  104. }
  105. else if ( GNM <= KILLS[e_Index] < MGI )
  106. {
  107. ColorChat ( 0, TEAM_COLOR, "^1[^4Gold Nova Master^1]^3%s^1:^4%s", s_Name, s_Said );
  108. }
  109. else if ( MGI <= KILLS[e_Index] < MGII )
  110. {
  111. ColorChat ( 0, TEAM_COLOR, "^1[^4Master Guardian I^1]^3%s^1:^4%s", s_Name, s_Said );
  112. }
  113. else if ( MGII <= KILLS[e_Index] < MGE )
  114. {
  115. ColorChat ( 0, TEAM_COLOR, "^1[^4Master Guardian II^1]^3%s^1:^4%s", s_Name, s_Said );
  116. }
  117. else if ( MGE <= KILLS[e_Index] < DMG )
  118. {
  119. ColorChat ( 0, TEAM_COLOR, "^1[^4Master Guardian Elite^1]^3%s^1:^4%s", s_Name, s_Said );
  120. }
  121. else if ( DMG <= KILLS[e_Index] < LE )
  122. {
  123. ColorChat ( 0, TEAM_COLOR, "^1[^4Distinguished Master Guardian^1]^3%s^1:^4%s", s_Name, s_Said );
  124. }
  125. else if ( LE <= KILLS[e_Index] < LEM )
  126. {
  127. ColorChat ( 0, TEAM_COLOR, "^1[^4Legendary Eagle^1]^3%s^1:^4%s", s_Name, s_Said );
  128. }
  129. else if ( LEM <= KILLS[e_Index] < SMFC )
  130. {
  131. ColorChat ( 0, TEAM_COLOR, "^1[^4Legendary Eagle Master^1]^3%s^1:^4%s", s_Name, s_Said );
  132. }
  133. else if ( SMFC <= KILLS[e_Index] < TGE )
  134. {
  135. ColorChat ( 0, TEAM_COLOR, "^1[^4Supreme Master First Class^1]^3%s^1:^4%s", s_Name, s_Said );
  136. }
  137. else if ( TGE <= KILLS[e_Index] )
  138. {
  139. ColorChat ( 0, TEAM_COLOR, "^1[^4The Global Elite^1]^3%s^1:^4%s", s_Name, s_Said );
  140. }
  141. }
  142. else
  143. {
  144. if ( KILLS[e_Index] < SilverII )
  145. {
  146. ColorChat ( 0, TEAM_COLOR, "^1[^4Silver I^1]^3%s^4:^1%s", s_Name, s_Said );
  147. }
  148. else if ( SilverII <= KILLS[e_Index] < SilverIII )
  149. {
  150. ColorChat ( 0, TEAM_COLOR, "^1[^4Silver II^1]^3%s^4:^1%s", s_Name, s_Said );
  151. }
  152. else if ( SilverIII <= KILLS[e_Index] < SilverIV )
  153. {
  154. ColorChat ( 0, TEAM_COLOR, "^1[^4Silver III^1]^3%s^4:^1%s", s_Name, s_Said );
  155. }
  156. else if ( SilverIV <= KILLS[e_Index] < SilverE )
  157. {
  158. ColorChat ( 0, TEAM_COLOR, "^1[^4Silver IV^1]^3%s^4:^1%s", s_Name, s_Said );
  159. }
  160. else if ( SilverE <= KILLS[e_Index] < SilverEM )
  161. {
  162. ColorChat ( 0, TEAM_COLOR, "^1[^4Silver Elite^1]^3%s^4:^1%s", s_Name, s_Said );
  163. }
  164. else if ( SilverEM <= KILLS[e_Index] < GNI )
  165. {
  166. ColorChat ( 0, TEAM_COLOR, "^1[^4Silver Elite Master^1]^3%s^4:^1%s", s_Name, s_Said );
  167. }
  168. else if ( GNI <= KILLS[e_Index] < GNII )
  169. {
  170. ColorChat ( 0, TEAM_COLOR, "^1[^4Gold Nova I^1]^3%s^4:^1%s", s_Name, s_Said );
  171. }
  172. else if ( GNII <= KILLS[e_Index] < GNIII )
  173. {
  174. ColorChat ( 0, TEAM_COLOR, "^1[^4Gold Nova II^1]^3%s^4:^1%s", s_Name, s_Said );
  175. }
  176. else if ( GNIII <= KILLS[e_Index] < GNM )
  177. {
  178. ColorChat ( 0, TEAM_COLOR, "^1[^4Gold Nova III^1]^3%s^4:^1%s", s_Name, s_Said );
  179. }
  180. else if ( GNM <= KILLS[e_Index] < MGI )
  181. {
  182. ColorChat ( 0, TEAM_COLOR, "^1[^4Gold Nova Master^1]^3%s^4:^1%s", s_Name, s_Said );
  183. }
  184. else if ( MGI <= KILLS[e_Index] < MGII )
  185. {
  186. ColorChat ( 0, TEAM_COLOR, "^1[^4Master Guardian I^1]^3%s^4:^1%s", s_Name, s_Said );
  187. }
  188. else if ( MGII <= KILLS[e_Index] < MGE )
  189. {
  190. ColorChat ( 0, TEAM_COLOR, "^1[^4Master Guardian II^1]^3%s^4:^1%s", s_Name, s_Said );
  191. }
  192. else if ( MGE <= KILLS[e_Index] < DMG )
  193. {
  194. ColorChat ( 0, TEAM_COLOR, "^1[^4Master Guardian Elite^1]^3%s^4:^1%s", s_Name, s_Said );
  195. }
  196. else if ( DMG <= KILLS[e_Index] < LE )
  197. {
  198. ColorChat ( 0, TEAM_COLOR, "^1[^4Distinguished Master Guardian^1]^3%s^4:^1%s", s_Name, s_Said );
  199. }
  200. else if ( LE <= KILLS[e_Index] < LEM )
  201. {
  202. ColorChat ( 0, TEAM_COLOR, "^1[^4Legendary Eagle^1]^3%s^4:^1%s", s_Name, s_Said );
  203. }
  204. else if ( LEM <= KILLS[e_Index] < SMFC )
  205. {
  206. ColorChat ( 0, TEAM_COLOR, "^1[^4Legendary Eagle Master^1]^3%s^4:^1%s", s_Name, s_Said );
  207. }
  208. else if ( SMFC <= KILLS[e_Index] < TGE )
  209. {
  210. ColorChat ( 0, TEAM_COLOR, "^1[^4Supreme Master First Class^1]^3%s^4:^1%s", s_Name, s_Said );
  211. }
  212. else if ( TGE <= KILLS[e_Index] )
  213. {
  214. ColorChat ( 0, TEAM_COLOR, "^1[^4The Global Elite^1]^3%s^4:^1%s", s_Name, s_Said );
  215. }
  216. }
  217. return 1;
  218. }
  219.  
  220. public eDeath ( )
  221. {
  222.  
  223. new iKiller = read_data ( 1 );
  224. new iVictim = read_data ( 2 );
  225.  
  226. new weapon [ 32 ];
  227. read_data ( 4, weapon, sizeof ( weapon ) -1 );
  228. if ( iKiller == iVictim )
  229. {
  230. return 1;
  231. }
  232. if ( is_user_alive(iKiller) && is_user_connected(iKiller) )
  233. {
  234. KILLS[iKiller]++;
  235. SaveSts(iKiller);
  236. }
  237. return 1;
  238. }
  239.  
  240. public client_connect(id)
  241. {
  242. LoadSts ( id );
  243. }
  244.  
  245. public client_disconnect ( id )
  246. {
  247. SaveSts ( id );
  248. }
  249.  
  250. public SaveSts(id) {
  251. new Name[32];
  252. get_user_name(id, Name, 31);
  253.  
  254. static Data[1024]
  255. formatex(Data, sizeof(Data) - 1, "^"%i^"", KILLS[id])
  256.  
  257. new Save[512]
  258. format(Save, 511, "^"%s^" %s", Name, Data )
  259.  
  260. new Line[128], Linie, IsPlayer = false, Arg1[32]
  261.  
  262. new FileOpen = fopen(File, "rt")
  263. while(!feof(FileOpen)) {
  264. fgets(FileOpen, Line, 127)
  265. trim(Line)
  266.  
  267. parse(Line, Arg1, 31)
  268.  
  269. if (equali(Arg1, Name)) {
  270. write_file(File, Save, Linie)
  271. IsPlayer = true
  272. break
  273. }
  274.  
  275. Linie++
  276. }
  277. fclose(FileOpen)
  278. if (!IsPlayer) {
  279. write_file(File, Save, -1)
  280. }
  281. }
  282.  
  283. public LoadSts(id) {
  284. new Name[32];
  285. get_user_name(id, Name, 31);
  286.  
  287. new Line[128], IsPlayer = false, Arg1[32], Arg2[32];
  288.  
  289. new FileOpen = fopen(File, "rt")
  290. while(!feof(FileOpen)) {
  291. fgets(FileOpen, Line, 127)
  292. trim(Line)
  293.  
  294. parse(Line, Arg1, 31, Arg2, 31)
  295.  
  296. if (equali(Arg1, Name)) {
  297. KILLS[id] = str_to_num(Arg2)
  298. IsPlayer = true
  299. break
  300. }
  301. }
  302. fclose(FileOpen)
  303.  
  304. if (!IsPlayer) {
  305. KILLS[id] = 0;
  306. }
  307. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement