Map Manager [Modular]

amxx Map Manager [Modular] 3.2.1

Нет прав для скачивания
Установка
  1. Скачать архив, распаковать
  2. В addons\amxmodx\configs\plugins-map_manager.ini закомментировать ненужные модули
  3. При наличии кастомного чат менеджера, желательно поставить его последним в plugins-map_manager.ini (для моего чм подобное не требуется).
  4. Настроить оставленные модули. Настройки располагаются в исходнике и в addons\amxmodx\configs\map_manager.cfg
  5. Скомпилировать плагины. Инструкция по локальной компиляции здесь
  6. Залить плагин на сервер, соблюдая структуру папок и файлов
Настройки
В addons/amxmodx/configs/map_manager.cfg
Код:
echo "Executing Map Manager Configuration File"

// Core

// EN: Prefix for addon messages in chat.
// RU: Префикс перед сообщениями плагина.
// !d - default, !t - team, !g - green
// ^1 - default, ^3 - team, ^4 - green
mapm_prefix "^4[MapManager]"

// EN: The number of maps in the vote.
// RU: Число карт в голосовании.
mapm_votelist_size "5"

// EN: How to display voting results.
       If you need to switch weapons, set to 2. Using the menu will disable weapon switching.
// RU: Как отображать состояния голосования.
//     Если вам требуется смена оружия, ставить 2. Использование меню блокирует смену оружия.
// 0 - disable, 1 - menu, 2 - hud
mapm_show_result_type "1"

// EN: Show chat message about selected map.
// RU: Вывод сообщений о выбранной карте.
// 0 - disable, 1 - all
mapm_show_selects "1"

// EN: Show percent in vote menu.
// RU: Вывод процентов в меню голосования.
// 0 - disable, 1 - always, 2 - after vote
mapm_show_percent "1"

// EN: Changes the numbering order in the menu.
//     Example: first row of menu but you need to click on 4.
// RU: Меняет порядок нумерации в меню.
//     Пример: первая строка меню, но нужно нажать на 4.
// 0 - disable, 1 - enable
mapm_random_nums "0"

// EN: Time before voting starts.
// RU: Время перед голосованием.
// seconds
mapm_prepare_time "5"

// EN: Time to vote.
// RU: Время на голосование.
// seconds
mapm_vote_time "10"

// EN: Offset for voting menu keys.
//     By default keys start at 1, set cvar to 4 and it will start at 5.
// RU: Смещение пунктов голосования.
//     По умолчанию пункты начинаются с 1, ставите квар равным 4 и начало будет с 5.
mapm_vote_item_offset "0"

// EN: Blocks the built-in core adding maps to voting.
//     With "1" you can achieve a hard limit on maps for the current online when voting, if addon "Online Sorter" is enabled
// RU: Блокирует встроенное в ядро добавление карт в голосование.
//     При "1" можно добиться жесткого ограничения карт по текущему онлайну при голосовании, если включен аддон "Online Sorter"
mapm_only_external_vote_items "0"

// EN: Allows voting to end early if all players have voted.
// RU: Позволяет завершить голосование досрочно, если проголосовали все игроки.
// 0 - disable, 1 - enable
mapm_early_finish_vote "0"


// Scheduler

// EN: Type of map change after voting.
//     Type 2 can be blocked by "mapm_last_round"
// RU: Тип смены карты после голосования.
//     Тип 2 может быть заблокирован кваром "mapm_last_round"
// 0 - after end vote, 1 - in round end, 2 - after end map
mapm_change_type "1"

// EN: Start voting N minutes before the end of the map.
// RU: Запуск голосования за N минут до конца карты.
// minutes
mapm_timeleft_to_vote "2"

// EN: Start voting N rounds before mp_winlimit or mp_maxrounds.
//     Should be above zero.
// RU: Запуск голосования за N раундов до mp_winlimit или mp_maxrounds.
//     Должно быть больше нуля.
// rounds
mapm_rounds_to_vote "2"

// EN: Start voting for N frags up to mp_fraglimit.
// RU: Запуск голосования за N фрагов до mp_fraglimit.
// frags
mapm_frags_to_vote "5"

// EN: Voting only at the beginning of a new round.
// RU: Голосование только в начале нового раунда.
// 0 - disable, 1 - enable
mapm_vote_in_new_round "0"

// EN: Allows you to finish the round after voting.
// RU: Позволяет доиграть раунд после голосования.
// 0 - disable, 1 - enable
mapm_last_round "0"

// EN: Allows you to play one more round if the last round finished in a draw.
//     Works with "mapm_last_round 1" or "mapm_change_type 1"
// RU: Позволяет сыграть еще один раунд, если последний раунд завершился ничьей.
//     Работает с "mapm_last_round 1" или "mapm_change_type 1"
// 0 - disable, 1 - enable
mapm_final_round "0"

// EN: Second vote with the two maps that received the most votes.
// RU: Второе голосование с двумя картами, которые набрали больше всех голосов.
// 0 - disable, 1 - enable
mapm_second_vote "0"

// EN: If the card gains less percent than in the cvar, then a second vote takes place.
// RU: Если карта набирает меньше процентов, чем в кваре, то происходит второе голосование.
mapm_second_vote_percent "50"

// EN: If the last player left, after how many minutes to change to the default card.
// RU: Если вышел последний игрок, через сколько минут сменить на карту по умолчанию.
// 0 - disable
// minutes
mapm_change_to_default_map "0"

// EN: Default map for previous cvar.
// RU: Карта по умолчанию для предыдущего квара.
mapm_default_map "de_dust2"

// EN: Type of map extension
// RU: Тип продления карты.
// 0 - minutes, 1 - rounds
mapm_extended_type "0"

// EN: The maximum number of map extensions.
// RU: Максимальное число продлений карты.
// -1 - бесконечное число продлений
mapm_extended_map_max "3"

// EN: Extension in minutes for mapm_extended_type "0".
// RU: Продление в минутах для mapm_extended_type "0".
// minutes
mapm_extended_time "15"

// EN: Extension in rounds for mapm_extended_type "1".
// RU: Продление в раундах для mapm_extended_type "1".
// rounds
mapm_extended_rounds "3"

// EN: Extends the current map if no one voted. Depends on mapm_extended_map_max.
// RU: Продляет текущую карту, если никто не голосовал. Зависит от mapm_extended_map_max.
// 0 - disable, 1 - enable
mapm_extend_map_if_no_votes "0"


// GUI

// EN: Cursor speed
//     The value is cached, updates after changing the map.
// RU: Скорость курсора
//     Значение кешировано, обновляет после смены карты.
mapm_cursor_sens "2.5"


// Advanced lists

// EN: When voting, show the name of the list the map is in.
// RU: При голосовании показывать имя списка, в котором состоит карта.
// 0 - disable, 1 - enable
mapm_show_list_name_in_vote "0"

// Blocklist

// EN: The number of last maps that will block from being voted.
// RU: Количество последних карт, которые заблокирует от попадания в голосование.
mapm_blocklist_ban_last_maps "10"


// Rtv

// EN: Type of RTV
// RU: Тип ртв.
// 0 - percents, 1 - players
mapm_rtv_mode "0"

// EN: Change map after vote from rtv if "mapm_change_type" is non-zero.
// RU: Сменить карту после голосования от rtv, если "mapm_change_type" не ноль.
// 0 - disable, 1 - enable
mapm_rtv_change_after_vote "0"

// EN: Required percentage of votes for early voting.
// RU: Необходимый процент голосов для досрочного голосования.
mapm_rtv_percent "60"

// EN: The required number of votes for early voting.
// RU: Необходимое число голосов для досрочного голосования.
mapm_rtv_players "5"

// EN: Disables RTV for N minutes after the start of the map.
// RU: Запрещает ртв на N минут после начала карты.
// minutes
mapm_rtv_delay "0"

// EN: Allows you to extend the map at rtv.
// RU: Позволяет продлевать карту при ртв.
// 0 - disable, 1 - enable
mapm_rtv_allow_extend "0"

// EN: Ignores spectators when counting required votes for RTV.
// RU: Игнорирует спектаторов в подсчете необходимых голосов для ртв.
// 0 - disable, 1 - enable
mapm_rtv_ignore_spectators "0"


// Nomination

// EN: Nomination type.
//     0 - standard, allows players to nominate multiple maps, of which a few random ones will be voted.
//     1 - fixed, the first players fill the nomination slots and no one else can nominate.
// RU: Тип номинации.
//     0 - стандартный, позволяет игрокам номинировать несколько карт, из которых несколько случайных попадут в голосование.
//     1 - фиксированный, первые игроки забивают слоты номинации и больше никто номинировать не может.
mapm_nom_type "0"

// EN: The maximum number of nominated maps in a vote.
// RU: Максимальное число номинированных карт в голосовании.
mapm_nom_maps_in_vote "3"

// EN: How many maps each player can nominate.
// RU: Сколько карт может номинировать каждый игрок.
mapm_nom_maps_per_player "3"

// EN: Do not close the nomination menu if the player has nominated the maximum number of maps.
// RU: Не закрывать меню номинации, если игрок номинировал максимум карт.
// 0 - disable, 1 - enable
mapm_nom_dont_close_menu "1"

// EN: Nomination spam protection. Forbids to remove the nomination more often than indicated in the cvar.
// RU: Защита от спама номинацией. Запрещает снимать номинацию чаще чем указано в кваре.
// seconds
mapm_nom_denominate_time "5"

// EN: Display maps in random order in the nomination menu.
// RU: Вывод карт в случайном порядке в меню номинации.
// 0 - disable, 1 - enable
mapm_nom_random_sort "0"

// EN: Delete maps from the nomination that are not in the new list of maps. Occurs when "Advanced lists" changes the current map list.
// RU: Удалять карты из номинации, которых нет в новом списке карт. Происходит, когда "Advanced lists" меняет текущий список карт.
// 0 - disable, 1 - enable
mapm_nom_remove_maps "1"

// EN: In the nomination menu, display active map lists (from "Advanced lists")
// RU: В меню номинации выводить активные списки карт (из "Advanced lists")
// 0 - disable, 1 - enable
mapm_nom_show_lists "0"

// EN: Enables a nomination for writing part of the map name in chat.
// RU: Включает номинацию по написанию части названия карты в чате.
// 0 - disable, 1 - enable
mapm_nom_fast_nomination "1"

// Online sorter

// EN: Will check the nominated maps against the current online when voting.
// RU: Проверит номинированные карты на соответствие текущему онлайну при голосовании.
// 0 - disable, 1 - enable
mapm_sort_check_nominated_maps "0"


// Effects

// EN: Black screen when voting.
// RU: Черный экран при голосовании.
// 0 - disable, 1 - enable
mapm_black_screen "1"

// EN: Chat blocking when voting.
//
//     If you have a chat manager, then it should be listed below in the list of plugins
//     By default, all MM plugins are placed in a separate plugins.ini, which reads later main plugins.ini,
//     because of which the chat manager is higher and the addon cannot block the chat during voting.
//
// RU: Блокировка чата при голосовании.
//
//     Если у вас стоит чат менеджер, то он должен быть прописан ниже в списке плагинов
//     По умолчанию все плагины ММ вынесены в отдельный plugins.ini, который читает позже
//     основного, из-за чего ЧМ стоит выше и аддон не может блокировать чат во время голосования.
//
// 0 - disable, 1 - enable
mapm_block_chat "1"

// EN: Blocking the voice while voting.
// RU: Блокировка голоса при голосовании.
// 0 - disable, 1 - enable
mapm_block_voice "1"

// EN: Freeze players when voting.
//     mapm_vote_in_new_round "1" uses mp_freezetime.
//     If you set the cvar value to "2", then freezing with flags will always be used.
//
//     Important: freezing with flags disables the addons "GUI" cursor.
//
// RU: Заморозка игроков при голосовании.
//     При mapm_vote_in_new_round "1" используется mp_freezetime.
//     Если поставить значение квара "2", то всегда будет использоваться заморозка с помощью флагов.
//
//     Важно: заморозка флагами блокирует курсор "GUI" аддона.
//
// 0 - disable, 1 - enable, 2 - force use flags
mapm_freeze_in_vote "1"


// Priority

// EN: Ignore priorities for nominated maps.
// RU: Игнорировать приоритеты для номинированных карт.
// 0 - disable, 1 - enable
mapm_priority_ignore_nomination "1"


// Online checker

// EN: Number of online checks.
// RU: Кол-во проверок онлайна.
// 0 - disable
mapm_online_check_count "3"

// EN: Online check interval
//     Important: the settings are applied only after restarting the map.
//
// RU: Интервал проверок онлайна
//     Важно: настройки применяются только после перезапуска карты.
//
// seconds
mapm_online_check_interval "30"

// EN: The time before the start of the online check.
// RU: Время до начала проверок онлайна.
// seconds
mapm_online_check_timeout "120"

Документация по файлу maps.ini:
Код:
; Doc for Map Manager maplist ini file
;
; Format:
; <map name> [min players, def 0] [max players, def 32] [priority, def 100]
;
; map name - map name as is
; min players - lower range for "Online sorter" addon, valid values from 0 to 32
; max player - higher range for "Online sorter" addon, valid values from 0 to 32, should be bigger than min players
; priority - value for "Priority" addon, valid values from 1 to 100;
;            with 1 map has 1% chance to be in vote list,
;            with 100 map has no limits in "Priority" addon but can be blocked with another addon
;
; Examples:
; de_nuke
; de_dust 0 10
; de_dust2 5 32 70
Документация по пакам для GUI:
Пак - это спрайт. Лимит спрайта 255 кадров, т.е. максимум можно добавить 255 картинок с картами на пак.
В каждом паке должны присутствовать два служебных кадра. Нулевой - неизвестная карта, первый - продление текущей.
Документация по файлу map_manager_settings.ini:
Код:
; Configuration file for "GUI" addon
;
; Sprite doc:
; All pics should be same size(512x512, 256x256, etc)
; Zero frame - reserved for "unknown map" frame, you should add "unknown map" frame in each pack.
; First frame - reserved for "extend map" frame, you should add "extend map" frame in each pack.
; From second frame begin frames for maps.
;
; Example
; <path to sprite> [sprite scale, def 0.1]
; <2-nd frame map in sprite> [count of pics with this map, def 1, for animation]
; <3-d frame map in sprite> [count]
; <4-th frame map in sprite> [count]
; <etc>
;
; Sprite scale info
; 0.09 - for 512x512 sprites
; 0.18 - for 256x256 sprites
;
; Examples:
; sprites/map_manager/pack.spr
; de_dust2
; de_dust
; de_inferno
; sprites/map_manager/pack2.spr
; cs_assault
; cs_italy

sprites/map_manager/maps.spr 0.18
as_oilrig 4
cs_747 3
cs_assault 4
cs_backalley 3
cs_italy 3
cs_militia 3
cs_office 3
cs_siege 3
de_airstrip 4
de_aztec 4
de_cbble 5
de_chateau 4
de_dust 4
de_dust2 6
de_inferno 4
de_nuke 6
de_piranesi 5
de_prodigy 4
de_storm 4
de_survivor 6
de_torn 4
de_train 5
de_vertigo 6
Документация по файлу map_manager_settings.ini:
Код:
;nomination

; Say command for opening maplist menu.
[nomination_maplist_commands]
maps
/maps

; Say command for nominated maps.
[nomination_nominated_maps_commands]
nominations
/nominations

;sounds

; Sound played when vote started
; Can be empty
[sound_vote_started]
"sound/Gman/Gman_Choose2.wav"

; Sound played when vote finished
; Can be empty
[sound_vote_finished]
;

; Sounds for countdown
; key should be number for countdown
; value should be sound for this countdown
[sounds_countdown]
"1" = "sound/fvox/one.wav"
"2" = "sound/fvox/two.wav"
"3" = "sound/fvox/three.wav"
"4" = "sound/fvox/four.wav"
"5" = "sound/fvox/five.wav"
"6" = "sound/fvox/six.wav"
"7" = "sound/fvox/seven.wav"
"8" = "sound/fvox/eight.wav"
"9" = "sound/fvox/nine.wav"
"10" = "sound/fvox/ten.wav"
Документация по файлу maplists.ini:
Код:
; Configuration file for "Advanced lists" addon
;
; Format:
; <name> <filename> <clear old list> <start> <stop>
; filename - file must be in amxx configs dir
; anytime - this list will be always loaded
;
; Examples:
; "Day Maps" "maps.ini" "1" "6:00" "22:59"
; "Night Maps" "nightmaps.ini" "1" "23:00" "5:59"
; "Another maps" "another.ini" "0" "anytime"
Документация по файлу plugins-map_manager.ini:
Код:
; Main plugins

; Core functions for setting up voting.
map_manager_core.amxx

; Module for automatic launch of voting.
; Functions:
; - Start vote by timeleft, rounds left(works with cvars "mp_winlimit", "mp_maxrounds"),
;   fragsleft(only regamedll function, cvar "mp_fraglimit").
; - Vote in new round - allows you to end the current round
; - Last round - allows you to end the round after voting
; - Second vote - additional vote with two maps with the most votes.
; - Change to default map - changes a map by default only when the last player left,
;   after that the usual rotation of cards in the list continues.
; - Map extension.
map_manager_scheduler.amxx

; Addons

; Rock the vote
map_manager_rtv.amxx

; Module for map nomination.
; Function:
; - Fast nomination with message in chat.
;   Example: You have "de_dust" and "de_dust2" in your map list. When writing "dust" in the chat,
;   you will be shown a menu with all maps containing "dust" to clarify the nomination.
; - Menu with a list of all maps(by default "/maps" in chat)
map_manager_nomination.amxx

; Module for blocking the last played maps from getting into the voting.
map_manager_blocklist.amxx

; Module for displaying maps in voting for the current online.
; Read "maps.ini" for setup information.
; Read about cvar "mapm_only_external_vote_items". By default, maps not for the current online are added
; if there are not enough maps for the current online to fill all the slots.
map_manager_online_sorter.amxx

; Module for visual effects.
; Function:
; - Black screen when voting is in progress.
; - Block chat and voice.
; - Freeze players.
map_manager_effects.amxx

; Chat commands for info.
; Timeleft, thetime, nextmap, currentmap.
map_manager_informer.amxx

; Module for sounds in vote.
; Check settings in "map_manager_settings.ini"
map_manager_sounds.amxx

; Scheduler for lists of maps.
; Allows you to set specific maps lists at specific times of the day.
; Check settings in "maplists.ini"
; map_manager_adv_lists.amxx

; Module for setting simple map priorities
; Priority meaning:
; With a priority of 100, there are no restrictions for the map, if the priority is 1 then
; the map has 1% to get into the vote.
;
; You can set -1 to disable auto-adding the map to the vote but you can nominate this map.
;
; Read "maps.ini" for setup information.
; map_manager_priority.amxx

; Starts the vote if the current online does not match the map online settings.
; map_manager_online_checker.amxx

; Experimental GUI version of vote based on sprites. Try if you can handle sprites and module config.
; map_manager_gui.amxx
API
Последняя версия API
map_manager.inc
Код:
#if defined _map_manager_core_included
    #endinput
#endif
#define _map_manager_core_included

#if AMXX_VERSION_NUM >= 175
    #pragma reqlib map_manager_core
    #if !defined AMXMODX_NOAUTOLOAD
        #pragma loadlib map_manager_core
    #endif
#else
    #pragma library map_manager_core
#endif

#include <map_manager_consts>
#include <map_manager_stocks>

/**
* Load maps from file.
* File loads from configs dir.
*
* @param filename              File name
* @param clearlist             Clear old maplist before new load.
* @param silent                If false then will be call forward mapm_maplist_loaded.
*
* @noreturn
*/
native mapm_load_maplist(filename[], bool:clearlist = true, bool:silent = false);

/**
* Load maps from file.
* File loads from configs dir.
*
* @param array                 Array with item size MapStruct.
* @param filename              File name
*
* @return                      1 if success load, 0 otherwise
*/
native mapm_load_maplist_to_array(Array:array, filename[]);

/**
* Block default load maplist.
* Use before call plugin_cfg().
*
* @noreturn
*/
native mapm_block_load_maplist();

/**
* Add map to maplist
*
* @param name                  Map name
* @param minplayers            Min players for sort
* @param maxplayers            Max players for sort
* @param priority              Map priority
*
* @return                      0 if invalid map or already in array
*/
native mapm_add_map_to_list(name[], minplayers = 0, maxplayers = 32, priority = 0);

/**
* Get map index in mapslist array.
*
* @param map                   Map name
*
* @return                      Map index or INVALID_MAP_INDEX if map not exist in mapslist
*/
native mapm_get_map_index(map[]);

/**
* Get prefix from core.
*
* @param prefix                Prefix string
* @param len                   String lenght
*
* @noreturn
*/
native mapm_get_prefix(prefix[], len);

/**
* Set value for vote finished variable.
*
* @param value                 Bool value
*
* @noreturn
*/
native mapm_set_vote_finished(bool:value);

/**
* Start vote.
*
* @param type                  Vote type, use const VOTE_BY_*
*
* @noreturn
*/
native mapm_start_vote(type);

/**
* Stop vote.
*
* @noreturn
*/
native mapm_stop_vote();

/**
* Blocks show vote menu from core.
*
* @noreturn
*/
native mapm_block_show_vote();

/**
* Get votelist size const from core.
*
* @return Votelist size
*/
native mapm_get_votelist_size();

/**
* Set max items in vote.
*
* @param value                 Amount items in vote
*
* @noreturn
*/
native mapm_set_votelist_max_items(value);

/**
* Push map in votelist.
*
* @note Use native in forward mapm_prepare_votelist().
*
* @param map                   Map name
* @param type                  Type for addons
* @param ignore_check          Allow ignore some checks, bit sum, use const CHECK_*
*
* @return                      Result of pushing, const PUSH_*
*/
native mapm_push_map_to_votelist(map[], type = PUSH_BY_NATIVE, ignore_check = CHECK_NOT_IGNORED);

/**
* Get amount maps in votelist.
*
* @note Use in mapm_analysis_of_results()
*
* @noreturn
*/
native mapm_get_count_maps_in_vote();

/**
* Get info about votelist item.
*
* @note Use in mapm_analysis_of_results()
*
* @param item                  Index in votelist
* @param map                   Map name
* @param len                   Map name string lenght
*
* @return                      Votes
*/
native mapm_get_voteitem_info(item, map[], len);

/**
* Returns vote type.
*
* @return                      Type of vote, used const VOTE_BY_*
*/
native mapm_get_vote_type();

/**
* Adds votes to vote item.
*
* @note Use while vote continues.
*
* @param item                  Index in votelist
* @param value                 Map name
*
* @return                      1 if success
*/
native mapm_add_vote_to_item(item, value);

/**
* Set displayed name for item.
*
* @note Use in forward mapm_displayed_item_name
*
* @param item                  Index in votelist
* @param name                  Displayed name
*
* @noreturn
*/
native mapm_set_displayed_name(item, name[]);

/**
* Returns if vote started.
*
* @return                      true/false
*/
native bool:is_vote_started();

/**
* Returns if vote finished.
*
* @return                      true/false
*/
native bool:is_vote_finished();

/**
* Called after load map list.
*
* @param maplist               Array with loaded maps
* @param nextmap               Nextmap after current map in loaded list
*
* @noreturn
*/
forward mapm_maplist_loaded(Array:maplist, const nextmap[]);

/**
* Called after clear maplist.
*
* @noreturn
*/
forward mapm_maplist_unloaded();

/**
* Called every second before vote or in vote.
*
* @param type                  Type of countdown, used const COUNTDOWN_*
* @param time                  Current second of countdown
*
* @noreturn
*/
forward mapm_countdown(type, time);

/**
* Called before vote.
*
* @param type                  Type of vote, used const VOTE_BY_*
*
* @noreturn
*/
forward mapm_prepare_votelist(type);

/**
* Called when core or addons are trying add map in votelist.
*
* @param map                   Map name
* @param type                  Type of vote, used const VOTE_BY_*
* @param index                 Index in mapslist array
*
* @return                      MAP_ALLOWED
*                              MAP_BLOCKED
*/
forward mapm_can_be_in_votelist(const map[], type, index);

/**
* Called for permission to extend current map.
*
* @param type                  Type of vote, used const VOTE_BY_*
*
* @return                      EXTEND_ALLOWED to allow extend current map
*                              EXTEND_BLOCKED to block extend current map
*/
forward mapm_can_be_extended(type);

/**
* Called when can change displayed name.
*
* @param type                  Type of vote, used const VOTE_BY_*
* @param item                  Vote item index, from 0 to MAX_VOTELIST_SIZE
* @param name                  Original vote item name
*
* @noreturn
*/
forward mapm_displayed_item_name(type, item, name[]);

/**
* Called when core start show menu with vote.
*
* @param type                  Type of vote, used const VOTE_BY_*
*
* @noreturn
*/
forward mapm_vote_started(type);

/**
* Called when core canceled vote.
*
* @param type                  Type of vote, used const VOTE_BY_*
*
* @noreturn
*/
forward mapm_vote_canceled(type);

/**
* Called before vote finish.
*
* @param type                  Type of vote, used const VOTE_BY_*
* @param total_votes           Count of players votes
*
* @return                      ALLOW_VOTE to allow finish vote
*                              ABORT_VOTE to block finish vote, forward mapm_vote_finished() will not be called
*/
forward mapm_analysis_of_results(type, total_votes);

/**
* Called when vote finished.
*
* @note Can be blocked in forward mapm_analysis_of_results()
*
* @param map                   Nextmap
* @param type                  Type of vote, used const VOTE_BY_*
* @param total_votes           Count of players votes
*
* @noreturn
*/
forward mapm_vote_finished(const map[], type, total_votes);
map_manager_adv_lists.inc
Код:
#if defined _map_manager_adv_lists_included
    #endinput
#endif
#define _map_manager_adv_lists_included

#if AMXX_VERSION_NUM >= 175
    #pragma reqlib map_manager_adv_lists
    #if !defined AMXMODX_NOAUTOLOAD
        #pragma loadlib map_manager_adv_lists
    #endif
#else
    #pragma library map_manager_adv_lists
#endif

/**
* Array size of advanced list.
*
* @return                      Number of active lists
*/
native mapm_advl_get_active_lists();

/**
* Get list name.
*
* @param item                  Number of active list
* @param list_name             String for list name
* @param size                  String size
*
* @noreturn
*/
native mapm_advl_get_list_name(item, list_name[], size);

/**
* Get Array pointer by index
*
* @param item                  Number of active list
*
* @return                      Array pointer
*/
native Array:mapm_advl_get_list_array(item);
map_manager_blocklist.inc
Код:
#if defined _map_manager_blocklist_included
    #endinput
#endif
#define _map_manager_blocklist_included

#if AMXX_VERSION_NUM >= 175
    #pragma reqlib map_manager_blocklist
    #if !defined AMXMODX_NOAUTOLOAD
        #pragma loadlib map_manager_blocklist
    #endif
#else
    #pragma library map_manager_blocklist
#endif

/**
* Check map if it in blocklist.
*
* @param map                   Map name
*
* @return                      Blocked count
*/
native mapm_get_blocked_count(map[]);
map_manager_consts.inc
Код:
#if defined _map_manager_consts_included
  #endinput
#endif
#define _map_manager_consts_included

#define VERSION_HASH ""

const MAPNAME_LENGTH = 32;

enum _:MapStruct {
    Map[MAPNAME_LENGTH],
    MinPlayers,
    MaxPlayers,
    MapPriority
};

enum _:NomStruct {
    NomMap[MAPNAME_LENGTH],
    NomPlayer
};

// used as return value in forward "mapm_can_be_in_votelist"
enum {
    MAP_ALLOWED,
    MAP_BLOCKED
};

enum (<<=1) {
    CHECK_NOT_IGNORED = 0,
    CHECK_IGNORE_MAP_ALLOWED = 1 << 0,
    CHECK_IGNORE_VALID_MAP
};

// used as return value in native "mapm_push_map_to_votelist"
enum {
    PUSH_BLOCKED = -1,
    PUSH_CANCELED,
    PUSH_SUCCESS
};

// used for type param in native "mapm_push_map_to_votelist"
enum {
    PUSH_BY_CORE,
    PUSH_BY_NATIVE,
    PUSH_BY_SECOND_VOTE,
    PUSH_BY_NOMINATION,
    PUSH_BY_ONLINE_SORTER
};

enum {
    VOTE_BY_CMD,
    VOTE_BY_RTV,
    VOTE_BY_SCHEDULER,
    VOTE_BY_SCHEDULER_SECOND,
    VOTE_BY_INCORRECT_ONLINE
};

// used as return value in forward "mapm_analysis_of_results"
enum {
    ALLOW_VOTE,
    ABORT_VOTE,
    ABORT_VOTE_WITH_FORWARD
};

// used for cvar "mapm_extended_type"
enum {
    EXTEND_MINUTES,
    EXTEND_ROUNDS
};

// used as return value in forward "mapm_can_be_extended"
enum {
    EXTEND_ALLOWED,
    EXTEND_BLOCKED
};

const INVALID_MAP_INDEX = -1;

// used for type param in forward "mapm_countdown"
enum {
    COUNTDOWN_UNKNOWN = -1,
    COUNTDOWN_PREPARE,
    COUNTDOWN_VOTETIME
}

// used for cvar "mapm_show_result_type"
enum {
    SHOW_DISABLED,
    SHOW_MENU,
    SHOW_HUD
};

// used for cvar "mapm_show_percent"
enum {
    PERCENT_DISABLED,
    PERCENT_ALWAYS,
    PERCENT_AFTER_VOTE
};

// used for forward "mapm_can_be_nominated"
enum {
    NOMINATION_ALLOWED,
    NOMINATION_BLOCKED
};
map_manager_nomination.inc
Код:
#if defined _map_manager_nom_included
    #endinput
#endif
#define _map_manager_nom_included

#if AMXX_VERSION_NUM >= 175
    #pragma reqlib map_manager_nomination
    #if !defined AMXMODX_NOAUTOLOAD
        #pragma loadlib map_manager_nomination
    #endif
#else
    #pragma library map_manager_nomination
#endif

/**
* Returns true if nomination ignore vote.
*
* @return                      true/false
*/
native bool:is_nomination_ignore_vote();

/**
* Set ignore or not adding nominated maps to vote.
*
* @param ignore                Yes or not
*
* @noreturn
*/
native map_nomination_set_ignore(bool:ignore);

/**
* Called when player want to nominate map.
*
* @param id                    Player index
* @param map                   Map which player want to nominate
*
* @return                      NOMINATION_ALLOWED to allow nomination
*                              NOMINATION_BLOCKED to block nomination
*/
forward mapm_can_be_nominated(id, map[]);
map_manager_scheduler.inc
Код:
#if defined _map_manager_scheduler_included
  #endinput
#endif
#define _map_manager_scheduler_included

#if AMXX_VERSION_NUM >= 175
    #pragma reqlib map_manager_scheduler
    #if !defined AMXMODX_NOAUTOLOAD
        #pragma loadlib map_manager_scheduler
    #endif
#else
    #pragma library map_manager_scheduler
#endif

enum IgnoreFlags (<<=1) {
    IGNORE_DISABLED = 0,
    IGNORE_TIMER_CHECK = 1 << 0,
    IGNORE_ROUND_CHECK,
    IGNORE_FRAGS_CHECK
};

enum LastRoundState {
    LRS_Not, // Not last round
    LRS_Last, // Last round, round that can be played after voting
    LRS_Final // Final round, one more round after the last one if the last one ended in a draw
}

/**
* Get ignore flags for starting vote.
*
* @return                      Ignore flags
*/
native IgnoreFlags:map_scheduler_get_ignore_check();

/**
* Set ignore flags for starting vote.
*
* @param flags                 Flags from IgnoreFlags enum
*
* @noreturn
*/
native map_scheduler_set_ignore_check(IgnoreFlags:flags);

/**
* Start vote by scheduler, work with own cvars.
*
* @param type                  Type of vote, used const VOTE_BY_*
*
* @noreturn
*/
native map_scheduler_start_vote(type);

/**
* Extend current map time.
*
* @param count                 Extend time param, bonus time = count * cvarnum(extend_time)
*
* @noreturn
*/
native map_scheduler_extend_map(count = 1);

/**
* Returns true if vote will in next round.
*
* @return                      true/false
*/
native bool:is_vote_will_in_next_round();

/**
* Returns state of last round.
*
* @return                      LastRoundState value
*/
native LastRoundState:get_last_round_state();

/**
* Returns true if one map mode active.
*
* @return                      true/false
*/
native bool:is_one_map_mode();
map_manager_stocks.inc
Код:
#if defined _map_manager_stocks_included
  #endinput
#endif
#define _map_manager_stocks_included

stock valid_map(map[])
{
    if(is_map_valid(map)) return true;
  
    new len = strlen(map) - 4;
  
    if(len < 0) return false;
  
    if(equali(map[len], ".bsp")) {
        map[len] = '^0';
        if(is_map_valid(map)) return true;
    }
  
    return false;
}
stock get_map_prefix(map[], prefix[], size)
{
    copy(prefix, size, map);
    for(new i; prefix[i]; i++) {
        if(prefix[i] == '_') {
            prefix[i + 1] = 0;
            return 1;
        }
    }
    return 0;
}
stock bool:is_string_with_space(string[])
{
    for(new i; string[i]; i++) {
        if(string[i] == ' ') return true;
    }
    return false;
}
stock trim_bracket(text[])
{
    for(new i; text[i]; i++) {
        if(text[i] == '[') {
            text[i] = 0;
            break;
        }
    }
}
stock intermission()
{
    emessage_begin(MSG_ALL, SVC_INTERMISSION);
    emessage_end();
}
stock get_players_num(ignore = 0)
{
    static maxplayers;
    if(!maxplayers) {
        maxplayers = get_maxplayers();
    }
    new pnum;
    for(new i = 1; i <= maxplayers; i++) {
        if(ignore > 0 && i == ignore
            || !is_user_connected(i)
            || is_user_bot(i)
            || is_user_hltv(i)) {
            continue;
        }

        if(ignore == -1) {
            new team = get_user_team(i);
            if(team == 0 || team == 3) {
                continue;
            }
        }

        pnum++;
    }
    return pnum;
}
stock send_audio(id, audio[], pitch)
{
    static msg_send_audio;
  
    if(!msg_send_audio) {
        msg_send_audio = get_user_msgid("SendAudio");
    }

    message_begin( id ? MSG_ONE_UNRELIABLE : MSG_BROADCAST, msg_send_audio, _, id);
    write_byte(id);
    write_string(audio);
    write_short(pitch);
    message_end();
}
stock replace_color_tag(string[], len)
{
    while(replace(string, len, "^^1", "^1")) {}
    while(replace(string, len, "^^3", "^3")) {}
    while(replace(string, len, "^^4", "^4")) {}
    while(replace(string, len, "!d", "^1")) {}
    while(replace(string, len, "!t", "^3")) {}
    while(replace(string, len, "!g", "^4")) {}
}
Сверху Снизу