Spoiler
#include < amxmodx > #include < amxmisc > #include < fakemeta > #include < colorchat > #define PLUGIN "AMXBans: Screens" #define VERSION "0.3" #define AUTHOR "GmStaff" new victim new CvarMaxss, CvarInterval, CvarTimestamptype, CvarHUDText; new CvarBanTime, CvarBanReason; new CountMenu new CvarCountScreens new g_max_players new g_user_ids[33] new g_player[33] public plugin_init ( ) { register_plugin ( PLUGIN, VERSION, AUTHOR ); register_clcmd ( "amx_ssban", "cmdScreen", ADMIN_BAN, "<authid, nick or #userid> <count of screens>" ); register_clcmd ( "amx_ssbanmenu", "cmdScreenMenu", ADMIN_BAN, " - display screens menu" ); CvarMaxss = register_cvar ( "amx_maxscreens", "10" ); CvarInterval = register_cvar ( "amx_interval", "1.0" ); CvarTimestamptype = register_cvar ( "amx_stamptype", "3" ); CvarHUDText = register_cvar ( "amx_hudtext", "Cheese! <img src='https://amxx.pl/public/style_emoticons/<#EMO_DIR#>/smile.png' class='bbc_emoticon' alt=':)' />" ); CvarCountScreens = register_cvar ( "amx_screenscount", "1 2 3 4 5 6 7 8 9"); CvarBanTime = register_cvar ( "amx_ssbantime", "0" ); CvarBanReason = register_cvar ( "amx_ssbanreason", "Screens, go gm-community.net" ); register_cvar ( "amxbans_ssversion", VERSION, FCVAR_SERVER | FCVAR_SPONLY ); g_max_players = get_maxplayers(); } public plugin_cfg ( ) { new line[ 128 ], token[ 10 ], szKey[ 16 ]; get_pcvar_string ( CvarCountScreens, line, 127 ); CountMenu = menu_create ( "\rCount of screens\w", "CountScreensMenu" ); while ( contain ( line, " " ) != -1 ) { strbreak ( line, token, 9, line, 127 ); format( szKey, charsmax ( szKey ), "Make %s screen(s)", token ) menu_additem ( CountMenu, szKey, token ); } } public cmdScreenMenu ( id, level, cid ) { if ( !cmd_access ( id, level, cid, 1 ) ) return PLUGIN_HANDLED; new menu = menu_create ( "\rChoose player", "PlayersMenu" ); new i, name[ 32 ], tempid[ 10 ]; for ( i = 1; i <= g_max_players; i++ ) { if ( is_user_connected ( i ) ) { get_user_name ( i, name, 31 ); num_to_str ( i, tempid, 9 ); g_user_ids[ i ] = get_user_userid ( i ); menu_additem ( menu, name, tempid, 0 ); } } menu_display ( id, menu, 0 ); return PLUGIN_HANDLED; } public PlayersMenu ( id, menu, item ) { if ( item == MENU_EXIT ) { return PLUGIN_HANDLED; } new data[ 6 ], iName[ 64 ]; new access, callback; menu_item_getinfo ( menu, item, access, data, 5, iName, 63, callback ); g_player[ id ] = str_to_num ( data ); menu_display ( id, CountMenu, 0 ); return PLUGIN_HANDLED; } public CountScreensMenu ( id, menu, item ) { if ( item == MENU_EXIT ) { return PLUGIN_HANDLED; } new data[ 6 ], iName[ 64 ]; new access, callback; new player = g_player[id]; menu_item_getinfo ( menu, item, access, data,5, iName, 63, callback ); if ( g_user_ids[ player ] == get_user_userid ( player ) ) { client_cmd ( id, "amx_ssban #%d %s", g_user_ids[ player ], data ); } return PLUGIN_HANDLED; } public cmdScreen ( id, level, cid ) { if ( !cmd_access ( id, level, cid, 3 ) ) { return PLUGIN_HANDLED; } new arg1[ 24 ], arg2[ 4 ]; read_argv ( 1, arg1, 23 ); read_argv ( 2, arg2, 3 ); new screens = str_to_num ( arg2 ); victim = cmd_target ( id, arg1, 1 ); if ( screens > get_pcvar_num ( CvarMaxss ) ) { console_print ( id, "Gm# You cannot take that many screenshots!" ); return PLUGIN_HANDLED; } if ( !victim ) { return PLUGIN_HANDLED; } new Float: interval = get_pcvar_float ( CvarInterval ); new array[ 2 ]; array[ 0 ] = id; array[ 1 ] = victim; set_task ( interval, "takeScreen", 0, array, 2, "a", screens ); set_task ( interval * screens + 1.0, "victimBan" ); return PLUGIN_HANDLED; } public takeScreen ( array[ 2 ] ) { new victim = array[ 1 ]; new id = array[ 0 ]; new timestamp[ 32 ], HUDText[ 32 ], name[ 32 ], adminname[ 32 ]; get_time ( "%m/%d/%Y - %H:%M:%S", timestamp, 31 ); get_user_name ( victim, name, 31 ); get_user_name ( id, adminname, 31 ); get_pcvar_string ( CvarHUDText, HUDText, 31 ); switch( get_pcvar_num ( CvarTimestamptype ) ) { case 0: { ColorChat( id, RED, "Gm#^x01 Screenshot taken on player ^x03%s^x01 by admin ^x04%s^x01", name, adminname ); client_cmd ( victim, "snapshot" ); } case 1: { ColorChat( id, RED, "Gm#^x01 Screenshot taken on player ^x03%s^x01 by admin ^x04%s^x01 (Date: %s)", name, adminname, timestamp ); client_cmd(victim, "snapshot"); } case 2: { set_hudmessage( 225, 225, 225, 0.02, 0.90, 0, 1.0, 2.0 ); show_hudmessage ( victim, "%s", HUDText ); client_cmd ( victim, "snapshot" ); } case 3: { set_hudmessage( 225, 225, 225, 0.02, 0.90, 0, 1.0, 2.0 ); show_hudmessage ( victim, "%s", HUDText ); ColorChat ( id, RED, "Gm#^x01 Screenshot taken on player ^x03%s^x01 by admin ^x04%s^x01 (Date: %s)", name, adminname, timestamp ); client_cmd ( victim, "snapshot" ); } } return PLUGIN_CONTINUE; } public victimBan ( id ) { new array[ 2 ], Reason[ 50 ]; array[ 0 ] = id; array[ 1 ] = victim; new victimId = get_user_userid ( victim ); get_pcvar_string ( CvarBanReason, Reason, 31 ); client_cmd ( id, "amx_ban %i #%i ^"%s^"", get_pcvar_num ( CvarBanTime ), victimId, Reason); }
CFG. niżej...
Spoiler
// [Ru] Конфигурационный файл AMXBans 6.0 // [Ru] Перевод специально для Gm-Community.Net by Shidla [SGC] // [Ru] Место расположения файла: $moddir/addons/amxmodx/configs/amxbans.cfg // [En] AMXBans Configuration File // [En] File location: $moddir/addons/amxmodx/configs/amxbans.cfg echo [AMXBans] Запуск amxbans.cfg // [Ru] Префикс SQL базы // [Ru] ВНИМАНИЕ: Префикс указанный в файле sql.cfg больше НЕ используется AMXBans!!! // [En] your sql database prefix // [En] NOTE: The Prefix defined in your sql.cfg is NOT used for AMXBans anymore!!! amx_sql_prefix "amx" // [Ru] Использовать флагирование (наблюдение) игрока(-ом) только на этом сервере или на всех (1 - на всех). // [En] Use the flagging only for this Server, or for all servers? amxbans_flagged_all_server 1 // [Ru] Как AMXBans должен управлять админами. // [Ru] 0=SQL (база), 1=users.ini, 2=Не загружать админов. // [En] How AMXBans should handle the admins // [En] 0=sql, 1=users.ini, 2=load no admins amxbans_use_admins_file 1 // [Ru] AMXBans попробует автоматически получить адрес сервера. // [Ru] Вы можете сами указать адрес и порт по примеру - "<ip>:<port>". // [En] AMXBans trys to get the address from the server automatically. // [En] You can set a different one here - ex. "<ip>:<port>" amxbans_server_address "" // [Ru] Число игроков, отображаемых в меню отключённых / последних игроков // [En] Number of players in the Disconnected Menu amxbans_discon_players_saved 10 // [Ru] Время бана, используемое при собственной причине бана. Значение используется, если у админа статическое значение времени бана. Указывать в минутах // [Ru] -1 для отключения собственных причин. // [En] Bantime to use for custom banreasons, if a user has static bantime <minutes> // [En] -1 to disable custom reasons amxbans_custom_statictime -1 // [Ru] Этот параметр отвечает за имя забанившего админа в Web части, если банил сервер. // [Ru] Пример: amxbans_servernick "Забанен сервером". // [Ru] Что бы использовать имя сервера из hostname, оставьте поле пустым. // [En] Set this cvar to what the adminname should be on the webpages, if the server make the ban. // [En] Ie. amxbans_servernick "My Great server" // [En] Leave emty if you want to use the default hostname from server.cfg amxbans_servernick "" // [Ru] Установите значения 1 / 2 / 3 для включения отладочных сообщений из AMXBans'ов в логи AMXX. // [Ru] При значении 3 логи будут наиболее полными, но ошибки могут зафлудить ваши логи. Значение 2 оптимально. // [En] Set this to 1 / 2 / 3 to enable debug messages from amxbans to amxx logs. // [En] with debug 3 you get the most output, but a bug can flood your logs. 2 should be ok normally amxbans_debug 0 // [Ru] Не используйте http:// в этом параметре. Эта ссылка будет показана забаненому в консоли. // [En] Don't use http:// in this cvar. The url will be shown to banned players in the console. amxbans_complain_url "www.Cs-Sensimilla.xaa.pl" // [Ru] Установите значение 1 если вы хотите что бы в базе данных отображалось имя карты. // [En] Set this to 1 if you want the map name to show in the DB. amxbans_add_mapname_in_servername 1 // [Ru] Если вы хотите видеть в HLSW событие бана, установите значение 1. // [En] If you want to see ban announcments in the HLSW chat, set this to 1 amxbans_show_in_hlsw 1 // [Ru] Показывать ли HUD-сообщение (зеленое) слева при бане. // [En] Print green hudmessages on the top left when banning amxbans_show_hud_messages 1 // [Ru] Какой флаг доступа должен иметь админ, чтобы получить доступ к банам с большой длительностью. // [En] What flag should admins have to get the high ban times. amxbans_higher_ban_time_admin "n" // [Ru] Какой флаг доступа должен иметь админ, что бы его ник НЕ писался при бане\разбанивании. // [En] What flag should admins have to NOT get their Nick printed when banning/Unbanning amxbans_admin_mole_access "r" // [Ru] Если у админа есть admin_mole_access, должен ли его ник отображаться при бане. // [En] If an admin has the admin_mole_access, should his name be shown when he bans? amxbans_show_name_evenif_mole 1 // [Ru] Показывать админам сообщение о бане игрока в amx_chat. 0 - отключить. // [En] Show if a player has been banned before as amx_chat to admins. 0 to disable amxbans_show_prebanned 1 // [Ru] Сколько нужно иметь предыдущих банов, что бы писать об этом предупреждение в админ чат. // [En] How many previous offences does the player needs, to be notified in the amx_chat? amxbans_show_prebanned_num 2 // [Ru] Причина бана по-умолчанию. // [En] Currently not known amxbans_default_ban_reason unknown // [Ru] 1 - можно банить игроков, даже если они вне сервера. 0 - отключить. // [En] To be able to ban players not in the server. 1 enabled and 0 disabled. amxbans_ban_evenif_disconnected 1 // [Ru] Пометка / наблюдение игрока(-ом), время. Идентично времени банов ниже. // [En] Flagtimes, like the bantimes below amx_setflagtimes "1 h" "4 h" "10 h" "1 d" "1 w" "4 w" "12 w" "0" // [Ru] Время бана для админов с d-флагом, установите максимальное время в минутах, ограничено параметром "amxbans_consolebanmax". // [Ru] ВАЖНО: Сначала вводите меньшие значения, затем более большие, и так далее. Количество значений - от 1 до 12. // [Ru] "0 m" = вечный бан // [Ru] Допустимые значения: // [Ru] 1 - 59 может использоваться с флагом m (минуты) // [Ru] 1 - 23 может использоваться с флагом h (часы) // [Ru] 1 - 6 может использоваться с флагом d (дни) // [Ru] Флаг w - недели // [Ru] // [Ru] Пример: // [Ru] "5 m" - 5 минут // [Ru] "1 h" - 1 час // [Ru] "1 d" - 1 день // [Ru] "1 w" - 1 неделя // [En] Ban times for admins with d-flag, set the highest time in minutes they can ban with "amxbans_consolebanmax" // [En] IMPORTANT: Put the lowest value first and the highest value last. You can have 1 to 12 values // [En] "0 m" = permanent ban! // [En] Values you can use: // [En] 1 - 59 with the flag m is for minutes // [En] 1 - 23 with the flag h is for hours // [En] 1 - 6 with the flag d is for days // [En] The w flag is for weeks // [En] // [En] Example: // [En] "5 m" is 5 minutes // [En] "1 h" is 1 hour // [En] "1 d" is 1 day // [En] "1 w" is 1 week amx_setlowbantimes "5 m" "30 m" "1 h" "3 h" "10 h" "1 d" "0 m" // [Ru] Время бана для админов с d и n флагами. // [Ru] ВАЖНО: Сначала вводите меньшие значения, затем более большие, и так далее. Количество значений - от 1 до 12. // [Ru] "0 m" = вечный бан // [Ru] Допустимые значения: // [Ru] 1 - 59 может использоваться с флагом m (минуты) // [Ru] 1 - 23 может использоваться с флагом h (часы) // [Ru] 1 - 6 может использоваться с флагом d (дни) // [Ru] Флаг w - недели // [Ru] // [Ru] Пример: // [Ru] "5 m" - 5 минут // [Ru] "1 h" - 1 час // [Ru] "1 d" - 1 день // [Ru] "1 w" - 1 неделя // [En] Ban times for admin with n-flag and d-flag // [En] IMPORTANT: Put the lowest value first and the highest value last. You can have 1 to 12 values // [En] "0 m" = permanent ban! // [En] Values you can use: // [En] 1 - 59 with the flag m is for minutes // [En] 1 - 23 with the flag h is for hours // [En] 1 - 6 with the flag d is for days // [En] The w flag is for weeks // [En] // [En] Example: // [En] "5 m" is 5 minutes // [En] "1 h" is 1 hour // [En] "1 d" is 1 day // [En] "1 w" is 1 week amx_sethighbantimes "5 m" "30 m" "1 h" "3 h" "1 d" "1 w" "0 m" /************* Another AMXBans plugins: Start config ******************************/ // [Ru] Остальные плагины amxbans // [Ru] Требуется плагин amxbans_freeze // // "a" = заморозить // "b" = отобрать оружие // "c" = заблокировать чат // "d" = игрок будет светиться красным (не проверено) // [En] 3rd party amxbans plugins // [En] needs the amxbans_freeze plugin // // "a" = freeze // "b" = strip weapons // "c" = block chat // "d" = player glow red (not testet) amxbans_freeze_mode "abc" /************* AMXBans: SSBan ***********************************************/ // [Ru] Требуется плагин amxbans_ssban // [En] needs the amxbans_ssban plugin // [Ru] Максимальное количество скриншотов, которое разрешено сделать. // [En] How many screens are the admins allowed to take? amx_maxscreens "5" // [Ru] Интервал между скриншотами. // [En] How much time between each screenshot? amx_interval "1.0" // [Ru] Вид "водяного знака". // 0: функция выключена. // 1: администратору пишется в чат сообщение о снятии скриншота с жертвы. // 2: игроку накладывается hud сообщение в левом нижнем углу. // 3: администратору выводится в чат сообщение, игроку накладывается hud сообщение. // [En] Watermark options // 0: disabled. // 1: administrator receives a message that the screen was taken. // 2: the player is superimposed hud in the lower left corner // 3: both amx_stamptype "3" // [Ru] HUD-сообщение при amx_stamptype = 2/3 // [En] Message when amx_stamptype = 2/3 amx_hudtext "Orientuj Sie <img src='https://amxx.pl/public/style_emoticons/<#EMO_DIR#>/wink.png' class='bbc_emoticon' alt=';)' />" // [Ru] Количество скриншотов в меню. Подробнее — http://gm4.in/2z // [En] Count of screens in menu amx_screenscount "1 2 3 4 5 6 7 8 9" // [Ru] Время бана // [En] Ban time amx_ssbantime "0" // [Ru] Причина бана // [En] Ban reason amx_ssbanreason "Wrzuc screny na Cs-Sensimilla.xaa.pl" /************* Another AMXBans plugins: End config ******************************/ // [Ru] Перевод специально для Gm-Community.Net by Shidla [SGC] // [Ru] Вывод сообщения AMXBans // [En] AMXBans configuration file echo echo [AMXBans] amxbans.cfg успешно выполнен!
Proszę również o przekomplikowanie, ponieważ mam problem z kompem i nie moge lokalnie
Użytkownik lajtowy123 edytował ten post 27.10.2011 10:06