seroff

AutoResetScore 1.0+ By Seroff

Apr 24th, 2016
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.52 KB | None | 0 0
  1. /*
  2. Делай качественно для людей!
  3. Сайт - seroff-community.ru
  4. */
  5.  
  6. #include <amxmodx>
  7. #include <cstrike>
  8. #include <fun>
  9.  
  10. #define PLUGIN "Auto Reset Score"
  11. #define VERSION "1.0"
  12. #define AUTHOR "Seroff"
  13.  
  14. #define scorem 5
  15.  
  16. public plugin_init() {
  17. register_plugin(PLUGIN, VERSION, AUTHOR);
  18. register_event("DeathMsg", "death", "a", "1>0");
  19. }
  20.  
  21. public death(){
  22. new id = read_data(2);
  23. new score = get_user_frags(id);
  24. new deaths = cs_get_user_deaths(id);
  25. if(score < deaths > scorem){
  26. set_task(5.0,"reset",id);
  27. }
  28. }
  29.  
  30. public reset(id){
  31. set_user_frags(id, 0);
  32. cs_set_user_deaths(id, 0);
  33. ColorChat(id, "^4[^1Сервер^4]^1 ^3%s^1, Ваш счет успешно обнулен !", get_name(id));
  34. console_cmd(id,"spk buttons/bell1.wav");
  35. }
  36.  
  37. stock get_name(id)
  38. {
  39. new name[33];
  40. get_user_name(id, name, 32);
  41. return name;
  42. }
  43.  
  44. stock ColorChat(const id, const input[], any:...)
  45. {
  46. new count = 1, players[32];
  47. static msg[191];
  48. vformat(msg, 190, input, 3);
  49.  
  50. replace_all(msg, 190, "!g", "^4"); // Зелёный
  51. replace_all(msg, 190, "!n", "^1"); // Стандартный
  52. replace_all(msg, 190, "!t", "^3"); // Цвет команды
  53.  
  54. if (id) players[0] = id; else get_players(players, count, "ch")
  55. {
  56. for (new i = 0; i < count; i++)
  57. {
  58. if (is_user_connected(players[i]))
  59. {
  60. message_begin(MSG_ONE, get_user_msgid("SayText"), _, players[i]);
  61. write_byte(players[i]);
  62. write_string(msg);
  63. message_end();
  64. }
  65. }
  66. }
  67. }
Advertisement
Add Comment
Please, Sign In to add comment