Advertisement
Guest User

Untitled

a guest
Jun 13th, 2022
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.85 KB | None | 0 0
  1. #include <amxmodx>
  2.  
  3. #include <amxmisc>
  4.  
  5. #define FILE_NAME "screenshot_logs.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_ss", "ScreenShot", ADMIN_KICK, "amx_ss <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.  
  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_console, "Nick: ^"%s^" - Ip: %s", name_player,ip_player);
  59.  
  60.  
  61.  
  62. pozes=5
  63.  
  64. poze=1
  65.  
  66.  
  67.  
  68. client_print(id, print_chat, "^"%s^" must give you 5 photos, one of them must be GREEN !", name_player);
  69.  
  70.  
  71.  
  72. new hostname[64], name_admin[32], timer[32];
  73.  
  74.  
  75.  
  76. get_cvar_string("hostname",hostname,63);
  77.  
  78. get_user_name(id, name_admin, 31);
  79.  
  80. get_time("%m/%d/%Y - %H:%M:%S", timer,31);
  81.  
  82.  
  83.  
  84. client_print(player, print_center, "PHOTO # %d CS", poze+1);
  85.  
  86.  
  87.  
  88. client_print(player, print_chat, "--------------------------------------------");
  89.  
  90. client_print(player, print_chat, "Admin: ^"%s^" made you a screenshot !", name_admin);
  91.  
  92. client_print(player, print_chat, "Your nick: ^"%s^" - Your Ip: %s", name_player, ip_player);
  93.  
  94. client_print(player, print_chat, "Date and time: %s - Server: ^"%s^"", timer, hostname);
  95.  
  96. client_print(player, print_chat, "--------------------------------------------");
  97.  
  98.  
  99.  
  100. client_cmd(player,"snapshot");
  101.  
  102. write_logfile(name_admin, name_player, ip_player, timer, charsmax(timer));
  103.  
  104. poze++
  105.  
  106. param=player
  107.  
  108. set_task(1.0,"GreenShot",3322,_,_,"b");
  109.  
  110. return PLUGIN_HANDLED
  111.  
  112. }
  113.  
  114. write_logfile(name_admin[], name_player[], ip_player[], timer[], bufflength)
  115. {
  116. new szFile[164], szConfigsDir[128];
  117. get_configsdir(szConfigsDir, charsmax(szConfigsDir));
  118.  
  119. formatex(szFile, charsmax(szFile), "%s/%s", szConfigsDir, FILE_NAME);
  120.  
  121. if(file_exists(szFile))
  122. {
  123. new iFile = fopen(szFile, "w+");
  124. new szMessage[192];
  125. replace(timer, bufflength, "-", "at");
  126. formatex(szMessage, charsmax(szMessage), "[%s] Admin %s did ss on %s (%s)", timer, name_admin, name_player, ip_player);
  127. fputs(iFile, szMessage);
  128. fclose(iFile);
  129. } else log_amx("Error! File ^"%s^" does not exists", szFile);
  130.  
  131. }
  132.  
  133.  
  134. public GreenShot(id, level, cid)
  135.  
  136. {
  137.  
  138. if(poze < pozes) {
  139.  
  140.  
  141. if(poze==3) {
  142.  
  143.  
  144.  
  145. message_begin(MSG_ONE, gmsgFade, {0,0,0},param)
  146.  
  147. write_short(14<<7)
  148.  
  149. write_short(58<<6)
  150.  
  151. write_short(1<<0)
  152.  
  153. write_byte(5)
  154.  
  155. write_byte(255)
  156.  
  157. write_byte(0)
  158.  
  159. write_byte(255)
  160.  
  161. message_end()
  162.  
  163. }
  164.  
  165.  
  166.  
  167. new hostname[64], name_player[32], ip_player[32], timer[32];
  168.  
  169. new frags = get_user_frags (param)
  170.  
  171. new deaths = get_user_deaths (param)
  172.  
  173.  
  174.  
  175. get_cvar_string("hostname",hostname,63);
  176.  
  177. get_user_name(param,name_player,31);
  178.  
  179. get_user_ip(param, ip_player, 31, 1);
  180.  
  181. get_time("%m/%d/%Y - %H:%M:%S", timer,31);
  182.  
  183.  
  184.  
  185. client_print(param, print_center, "PHOTO # %d", poze+1);
  186.  
  187.  
  188.  
  189. client_print(param, print_chat, "--------------------------------------------");
  190.  
  191. client_print(param, print_chat, "Your frags: %d - Your deaths: %d",frags, deaths);
  192.  
  193. client_print(param, print_chat, "Your nick: ^"%s^" - Your Ip: %s", name_player, ip_player);
  194.  
  195. client_print(param, print_chat, "Date and time: %s - Server: ^"%s^"", timer, hostname);
  196.  
  197. client_print(param, print_chat, "--------------------------------------------");
  198.  
  199.  
  200.  
  201. client_cmd(param,"snapshot");
  202.  
  203. poze++
  204.  
  205.  
  206.  
  207. } else {
  208.  
  209.  
  210.  
  211. client_cmd(param,"snapshot");
  212.  
  213. client_cmd(param,"kill;wait;jointeam 6");
  214.  
  215.  
  216.  
  217. get_user_name(param, name_player, 31);
  218.  
  219.  
  220.  
  221. client_print(0, print_chat, "SS was taken from ^"%s^" !", name_player);
  222.  
  223.  
  224.  
  225. client_print(param, print_chat, "%s, 5 photos were taken.", name_player);
  226.  
  227. client_print(param, print_chat, "Use say_team @ and it will be seen only by admins!");
  228.  
  229.  
  230.  
  231. remove_task(3322);
  232.  
  233.  
  234.  
  235. }
  236.  
  237.  
  238.  
  239. return PLUGIN_HANDLED;
  240.  
  241. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement