Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Делай качественно для людей!
- Сайт - seroff-community.ru
- */
- #include <amxmodx>
- #include <cstrike>
- #include <fun>
- #define PLUGIN "Auto Reset Score"
- #define VERSION "1.0"
- #define AUTHOR "Seroff"
- #define scorem 5
- public plugin_init() {
- register_plugin(PLUGIN, VERSION, AUTHOR);
- register_event("DeathMsg", "death", "a", "1>0");
- }
- public death(){
- new id = read_data(2);
- new score = get_user_frags(id);
- new deaths = cs_get_user_deaths(id);
- if(score < deaths > scorem){
- set_task(5.0,"reset",id);
- }
- }
- public reset(id){
- set_user_frags(id, 0);
- cs_set_user_deaths(id, 0);
- ColorChat(id, "^4[^1Сервер^4]^1 ^3%s^1, Ваш счет успешно обнулен !", get_name(id));
- console_cmd(id,"spk buttons/bell1.wav");
- }
- stock get_name(id)
- {
- new name[33];
- get_user_name(id, name, 32);
- return name;
- }
- stock ColorChat(const id, const input[], any:...)
- {
- new count = 1, players[32];
- static msg[191];
- vformat(msg, 190, input, 3);
- replace_all(msg, 190, "!g", "^4"); // Зелёный
- replace_all(msg, 190, "!n", "^1"); // Стандартный
- replace_all(msg, 190, "!t", "^3"); // Цвет команды
- if (id) players[0] = id; else get_players(players, count, "ch")
- {
- for (new i = 0; i < count; i++)
- {
- if (is_user_connected(players[i]))
- {
- message_begin(MSG_ONE, get_user_msgid("SayText"), _, players[i]);
- write_byte(players[i]);
- write_string(msg);
- message_end();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment