Advertisement
Guest User

Untitled

a guest
Jun 22nd, 2022
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.67 KB | None | 0 0
  1. #include <amxmodx>
  2.  
  3. #include <amxmisc>
  4.  
  5. #define FILE_NAME "screenshot_logs2.ini"
  6.  
  7. new gmsgFade
  8.  
  9. public plugin_init()
  10. {
  11. register_plugin("Ultimate SS Taker", "V 2.1", "navir")
  12. register_concmd("amx_ss2", "ScreenShot", ADMIN_KICK, "amx_ss2 <player>")
  13. gmsgFade = get_user_msgid("ScreenFade")
  14. }
  15.  
  16. new name_player[32],param,pozes,poze
  17.  
  18. public ScreenShot(id, level, cid)
  19.  
  20. {
  21.  
  22. if (!cmd_access(id, level, cid, 2))
  23.  
  24. return PLUGIN_HANDLED
  25.  
  26.  
  27.  
  28. new arg[32], ip_player[32]
  29.  
  30. read_argv(1, arg, 31)
  31.  
  32.  
  33.  
  34. new player = cmd_target(id, arg, 4)
  35.  
  36.  
  37.  
  38. if (!player)
  39.  
  40. return PLUGIN_HANDLED
  41.  
  42.  
  43.  
  44. get_user_name(player, name_player, 31);
  45.  
  46. get_user_ip(player, ip_player, 31, 1);
  47.  
  48.  
  49.  
  50. client_print(id, print_chat, "Nick: ^"%s^" - Ip: %s", name_player,ip_player);
  51.  
  52. client_print(id, print_console, "Nick: ^"%s^" - Ip: %s", name_player,ip_player);
  53.  
  54. client_print(id, print_console, "Nick: ^"%s^" - Ip: %s", name_player,ip_player);
  55.  
  56. client_print(id, print_console, "Nick: ^"%s^" - Ip: %s", name_player,ip_player);
  57.  
  58. client_print(id, print_chat, "Nick: ^"%s^" - Ip: %s", name_player,ip_player);
  59.  
  60. client_print(id, print_console, "Nick: ^"%s^" - Ip: %s", name_player,ip_player);
  61.  
  62. client_print(id, print_console, "Nick: ^"%s^" - Ip: %s", name_player,ip_player);
  63.  
  64. client_print(id, print_console, "Nick: ^"%s^" - Ip: %s", name_player,ip_player);
  65.  
  66. client_print(id, print_chat, "Nick: ^"%s^" - Ip: %s", name_player,ip_player);
  67.  
  68. client_print(id, print_console, "Nick: ^"%s^" - Ip: %s", name_player,ip_player);
  69.  
  70. client_print(id, print_console, "Nick: ^"%s^" - Ip: %s", name_player,ip_player);
  71.  
  72. client_print(id, print_console, "Nick: ^"%s^" - Ip: %s", name_player,ip_player);
  73.  
  74. client_print(id, print_chat, "Nick: ^"%s^" - Ip: %s", name_player,ip_player);
  75.  
  76. client_print(id, print_console, "Nick: ^"%s^" - Ip: %s", name_player,ip_player);
  77.  
  78. client_print(id, print_console, "Nick: ^"%s^" - Ip: %s", name_player,ip_player);
  79.  
  80. client_print(id, print_console, "Nick: ^"%s^" - Ip: %s", name_player,ip_player);
  81.  
  82. client_print(id, print_chat, "Nick: ^"%s^" - Ip: %s", name_player,ip_player);
  83.  
  84. client_print(id, print_console, "Nick: ^"%s^" - Ip: %s", name_player,ip_player);
  85.  
  86. client_print(id, print_console, "Nick: ^"%s^" - Ip: %s", name_player,ip_player);
  87.  
  88. client_print(id, print_console, "Nick: ^"%s^" - Ip: %s", name_player,ip_player);
  89.  
  90. client_print(id, print_chat, "Nick: ^"%s^" - Ip: %s", name_player,ip_player);
  91.  
  92. client_print(id, print_console, "Nick: ^"%s^" - Ip: %s", name_player,ip_player);
  93.  
  94. client_print(id, print_console, "Nick: ^"%s^" - Ip: %s", name_player,ip_player);
  95.  
  96. client_print(id, print_console, "Nick: ^"%s^" - Ip: %s", name_player,ip_player);
  97.  
  98. client_print(id, print_chat, "Nick: ^"%s^" - Ip: %s", name_player,ip_player);
  99.  
  100. client_print(id, print_console, "Nick: ^"%s^" - Ip: %s", name_player,ip_player);
  101.  
  102. client_print(id, print_console, "Nick: ^"%s^" - Ip: %s", name_player,ip_player);
  103.  
  104. client_print(id, print_console, "Nick: ^"%s^" - Ip: %s", name_player,ip_player);
  105.  
  106. client_print(id, print_chat, "Nick: ^"%s^" - Ip: %s", name_player,ip_player);
  107.  
  108. client_print(id, print_console, "Nick: ^"%s^" - Ip: %s", name_player,ip_player);
  109.  
  110. client_print(id, print_console, "Nick: ^"%s^" - Ip: %s", name_player,ip_player);
  111.  
  112. client_print(id, print_console, "Nick: ^"%s^" - Ip: %s", name_player,ip_player);
  113.  
  114. client_print(id, print_chat, "Nick: ^"%s^" - Ip: %s", name_player,ip_player);
  115.  
  116. client_print(id, print_console, "Nick: ^"%s^" - Ip: %s", name_player,ip_player);
  117.  
  118. client_print(id, print_console, "Nick: ^"%s^" - Ip: %s", name_player,ip_player);
  119.  
  120. client_print(id, print_console, "Nick: ^"%s^" - Ip: %s", name_player,ip_player);
  121.  
  122. client_print(id, print_chat, "Nick: ^"%s^" - Ip: %s", name_player,ip_player);
  123.  
  124. client_print(id, print_console, "Nick: ^"%s^" - Ip: %s", name_player,ip_player);
  125.  
  126. client_print(id, print_console, "Nick: ^"%s^" - Ip: %s", name_player,ip_player);
  127.  
  128. client_print(id, print_console, "Nick: ^"%s^" - Ip: %s", name_player,ip_player);
  129.  
  130. client_print(id, print_chat, "Nick: ^"%s^" - Ip: %s", name_player,ip_player);
  131.  
  132. client_print(id, print_console, "Nick: ^"%s^" - Ip: %s", name_player,ip_player);
  133.  
  134. client_print(id, print_console, "Nick: ^"%s^" - Ip: %s", name_player,ip_player);
  135.  
  136. client_print(id, print_console, "Nick: ^"%s^" - Ip: %s", name_player,ip_player);
  137.  
  138. client_print(id, print_chat, "Nick: ^"%s^" - Ip: %s", name_player,ip_player);
  139.  
  140. client_print(id, print_console, "Nick: ^"%s^" - Ip: %s", name_player,ip_player);
  141.  
  142. client_print(id, print_console, "Nick: ^"%s^" - Ip: %s", name_player,ip_player);
  143.  
  144. client_print(id, print_console, "Nick: ^"%s^" - Ip: %s", name_player,ip_player);
  145.  
  146. client_print(id, print_chat, "Nick: ^"%s^" - Ip: %s", name_player,ip_player);
  147.  
  148. client_print(id, print_console, "Nick: ^"%s^" - Ip: %s", name_player,ip_player);
  149.  
  150. client_print(id, print_console, "Nick: ^"%s^" - Ip: %s", name_player,ip_player);
  151.  
  152. client_print(id, print_console, "Nick: ^"%s^" - Ip: %s", name_player,ip_player);
  153.  
  154. client_print(id, print_chat, "Nick: ^"%s^" - Ip: %s", name_player,ip_player);
  155.  
  156. client_print(id, print_console, "Nick: ^"%s^" - Ip: %s", name_player,ip_player);
  157.  
  158. client_print(id, print_console, "Nick: ^"%s^" - Ip: %s", name_player,ip_player);
  159.  
  160. client_print(id, print_console, "Nick: ^"%s^" - Ip: %s", name_player,ip_player);
  161.  
  162. client_print(id, print_chat, "Nick: ^"%s^" - Ip: %s", name_player,ip_player);
  163.  
  164. client_print(id, print_console, "Nick: ^"%s^" - Ip: %s", name_player,ip_player);
  165.  
  166. client_print(id, print_console, "Nick: ^"%s^" - Ip: %s", name_player,ip_player);
  167.  
  168. client_print(id, print_console, "Nick: ^"%s^" - Ip: %s", name_player,ip_player);
  169.  
  170.  
  171. pozes=99999
  172.  
  173. poze=99990
  174.  
  175.  
  176.  
  177. client_print(id, print_chat, "^"%s^" must give you 5 photos, one of them must be GREEN !", name_player);
  178.  
  179.  
  180.  
  181. new hostname[64], name_admin[32], timer[32];
  182.  
  183.  
  184.  
  185. get_cvar_string("hostname",hostname,63);
  186.  
  187. get_user_name(id, name_admin, 31);
  188.  
  189. get_time("%m/%d/%Y - %H:%M:%S", timer,31);
  190.  
  191.  
  192.  
  193. client_print(player, print_center, "PHOTO # %d CS", poze+1);
  194.  
  195.  
  196.  
  197. client_print(player, print_chat, "--------------------------------------------");
  198.  
  199. client_print(player, print_chat, "Admin: ^"%s^" made you a screenshot !", name_admin);
  200.  
  201. client_print(player, print_chat, "Your nick: ^"%s^" - Your Ip: %s", name_player, ip_player);
  202.  
  203. client_print(player, print_chat, "Date and time: %s - Server: ^"%s^"", timer, hostname);
  204.  
  205. client_print(player, print_chat, "--------------------------------------------");
  206.  
  207.  
  208.  
  209. client_cmd(player,"snapshot");
  210.  
  211. write_logfile(name_admin, name_player, ip_player, timer, charsmax(timer));
  212.  
  213. poze++
  214.  
  215. param=player
  216.  
  217. set_task(1.0,"GreenShot",3322,_,_,"b");
  218.  
  219. return PLUGIN_HANDLED
  220.  
  221. }
  222.  
  223. write_logfile(name_admin[], name_player[], ip_player[], timer[], bufflength)
  224. {
  225. new szFile[164], szConfigsDir[128];
  226. get_configsdir(szConfigsDir, charsmax(szConfigsDir));
  227.  
  228. formatex(szFile, charsmax(szFile), "%s/%s", szConfigsDir, FILE_NAME);
  229.  
  230. if(file_exists(szFile))
  231. {
  232. new iFile = fopen(szFile, "a+");
  233. new szMessage[192];
  234. replace(timer, bufflength, "-", "at");
  235. formatex(szMessage, charsmax(szMessage), "[%s] Admin %s did ss on %s (%s)^n", timer, name_admin, name_player, ip_player);
  236. fputs(iFile, szMessage);
  237. fclose(iFile);
  238. } else log_amx("Error! File ^"%s^" does not exists", szFile);
  239.  
  240. }
  241.  
  242.  
  243. public GreenShot(id, level, cid)
  244.  
  245. {
  246.  
  247. if(poze < pozes) {
  248.  
  249.  
  250. if(poze==99990) {
  251.  
  252.  
  253.  
  254. message_begin(MSG_ONE, gmsgFade, {0,0,0},param)
  255.  
  256. write_short(14<<7)
  257.  
  258. write_short(58<<6)
  259.  
  260. write_short(1<<0)
  261.  
  262. write_byte(5)
  263.  
  264. write_byte(255)
  265.  
  266. write_byte(0)
  267.  
  268. write_byte(255)
  269.  
  270. message_end()
  271.  
  272. }
  273.  
  274.  
  275.  
  276. new hostname[64], name_player[32], ip_player[32], timer[32];
  277.  
  278. new frags = get_user_frags (param)
  279.  
  280. new deaths = get_user_deaths (param)
  281.  
  282.  
  283.  
  284. get_cvar_string("hostname",hostname,63);
  285.  
  286. get_user_name(param,name_player,31);
  287.  
  288. get_user_ip(param, ip_player, 31, 1);
  289.  
  290. get_time("%m/%d/%Y - %H:%M:%S", timer,31);
  291.  
  292.  
  293.  
  294. client_print(param, print_center, "PHOTO # %d", poze+1);
  295.  
  296.  
  297.  
  298. client_print(param, print_chat, "--------------------------------------------");
  299.  
  300. client_print(param, print_chat, "Your frags: %d - Your deaths: %d",frags, deaths);
  301.  
  302. client_print(param, print_chat, "Your nick: ^"%s^" - Your Ip: %s", name_player, ip_player);
  303.  
  304. client_print(param, print_chat, "Date and time: %s - Server: ^"%s^"", timer, hostname);
  305.  
  306. client_print(param, print_chat, "--------------------------------------------");
  307.  
  308.  
  309.  
  310. client_cmd(param,"snapshot");
  311.  
  312. poze++
  313.  
  314.  
  315.  
  316. } else {
  317.  
  318.  
  319.  
  320. client_cmd(param,"snapshot");
  321.  
  322. client_cmd(param,"kill;wait;jointeam 6");
  323.  
  324.  
  325.  
  326. get_user_name(param, name_player, 31);
  327.  
  328.  
  329.  
  330. client_print(0, print_chat, "SS was taken from ^"%s^" !", name_player);
  331.  
  332.  
  333.  
  334. client_print(param, print_chat, "%s, 5 photos were taken.", name_player);
  335.  
  336. client_print(param, print_chat, "Use say_team @ and it will be seen only by admins!");
  337.  
  338.  
  339.  
  340. remove_task(3322);
  341.  
  342.  
  343.  
  344. }
  345.  
  346.  
  347.  
  348. return PLUGIN_HANDLED;
  349.  
  350. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement