Спойлер #include #if AMXX_VERSION_NUM < 183 #include #else #define DontChange print_team_default #define Blue print_team_blue #define Red print_team_red #define Grey print_team_grey #endif #define PLUGIN "Map Manager RU" #define VERSION "1.1.2" #define AUTHOR "Mistrick" #pragma semicolon 1 #define SELECT_MAPS 5// MAX 8 #define VOTE_TIME 15 #define NOMINATE_MAX 3 #define NOMINATE_PLAYER_MAX 3 #define MAP_BLOCK 10 #define HUD_RESULT_COLOR 0, 55, 255 #define TASK_CHANGELEVEL 978562 #define TASK_SHOWMENU 978262 #define TASK_SHOWTIMER 978362 #define TASK_TIMER 978462 #define TASK_VOTEMENU 978162 enum _:BLOCKED_DATA { MAP[33], COUNT } enum _:NOMINATE_DATA { MAP[33], PLAYER, ID } new const FILE_MAPS[] = "addons/amxmodx/configs/maps.ini"; new const FILE_BLOCKEDMAPS[] = "addons/amxmodx/data/blockedmaps.ini"; new const PREFIX[] = "[MM]"; new Array:g_iMapsArray, Array:g_iNominateArray; new g_pLoadMapsType, g_pChangeMap, g_pChangeMapRounds, g_pShowSelects, g_pShowResultAfterVote, g_pShowResultType; new g_pDebug, g_pTimeStartVote, g_pTimeStartVoteBeforeEnd, g_pTimeLimit, g_pExendedMax, g_pChatTime; new g_pExendedTime, g_pRockChange, g_pRockPercent, g_pRockDelay, g_pRockShow, g_pNextMap, g_pFriendlyFire; new bool:g_bBeInVote, bool:g_bVoteFinished, bool:g_bRockVote, bool:g_bHasVoted[33], bool:g_bRockVoted[33]; new g_iExtendedMax, g_iRound, g_iStartPlugin, g_iLoadMaps, g_iForwardStartVote, g_iForwardFinishVote; new g_iInMenu[SELECT_MAPS], g_iVoteItem[SELECT_MAPS + 1], g_iTotal, g_iVoteTime, g_iRockVote; new g_iNominatedMaps[33], g_iPage[33]; new g_szInMenuMapName[SELECT_MAPS][33], g_BlockedMaps[MAP_BLOCK][BLOCKED_DATA], g_szCurrentMap[32]; new const g_szPrefixes[][] = {"deathrun_", "speedrun_", "de_"}; new const g_szSound[][] = { "", "fvox/one", "fvox/two", "fvox/three", "fvox/four", "fvox/five", "fvox/six", "fvox/seven", "fvox/eight", "fvox/nine", "fvox/ten" }; public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR); g_pLoadMapsType = register_cvar("mm_loadmapstype", "1");//0 - load all maps from maps folder, 1 - load maps from file g_pChangeMap = register_cvar("mm_changemap", "1");//0 - after end vote, 1 - in round end, 2 - after end map g_pChangeMapRounds = register_cvar("mm_changemap_rounds", "0");// 0 - disable g_pTimeStartVoteBeforeEnd = register_cvar("mm_timestartvote_before_end", "2");//minutes g_pTimeStartVote = register_cvar("mm_timestartvote", "20");//if timelimit == 0 g_pShowSelects = register_cvar("mm_showselects", "0");//0 - disable, 1 - all, 2 - self g_pShowResultAfterVote = register_cvar("mm_show_result_aftervote", "1");//0 - disable, 1 - enable g_pShowResultType = register_cvar("mm_showresulttype", "0");//0 - menu, 1 - hud g_pExendedTime = register_cvar("mm_extendedtime", "15");//minutes g_pExendedMax = register_cvar("mm_extendedmap_max", "3"); g_pNextMap = register_cvar("amx_nextmap", ""); g_pRockPercent = register_cvar("mm_rtv_percent", "60"); g_pRockChange = register_cvar("mm_rtv_change", "0");//0 - after vote, 1 - in round end g_pRockDelay = register_cvar("mm_rtv_delay", "0");//minutes g_pRockShow = register_cvar("mm_rtv_show", "1");//0 - all, 1 - self g_pChatTime = get_cvar_pointer("mp_chattime"); g_pTimeLimit = get_cvar_pointer("mp_timelimit"); g_pFriendlyFire = get_cvar_pointer("mp_friendlyfire"); g_pDebug = register_cvar("mm_debug", "0"); register_clcmd("mm_startvote", "Command_StartVote", ADMIN_MAP); register_clcmd("mm_stopvote", "Command_StopVote", ADMIN_MAP); register_clcmd("say ff", "Command_FriendlyFire"); register_clcmd("say maps", "Command_MapsList"); register_clcmd("say /maps", "Command_MapsList"); register_clcmd("say rtv", "Command_RTV"); register_clcmd("say /rtv", "Command_RTV"); register_clcmd("say rockthevote", "Command_RTV"); register_clcmd("say nextmap", "Command_Nextmap"); register_clcmd("say timeleft", "Command_Timeleft"); register_clcmd("say currentmap", "Command_CurrentMap"); register_clcmd("say", "Command_Say"); register_clcmd("say_team", "Command_Say"); register_event("SendAudio", "Event_RoundEnd", "a", "2=%!MRAD_terwin", "2=%!MRAD_ctwin", "2=%!MRAD_rounddraw"); register_event("TextMsg", "Event_GameRestart", "a", "2=#Game_Commencing", "2=#Game_will_restart_in"); register_event("30", "Event_MapEnd", "a"); register_menucmd(register_menuid("Vote_Menu"), 1023, "VoteMenu_Handler"); register_menucmd(register_menuid("MapsList_Menu"), 1023, "MapsListMenu_Handler"); g_iNominateArray = ArrayCreate(NOMINATE_DATA); g_iStartPlugin = get_systime(); g_iForwardStartVote = CreateMultiForward("mapmanager_startvote", ET_IGNORE); g_iForwardFinishVote = CreateMultiForward("mapmanager_finishvote", ET_IGNORE); Load_BlockedMaps(); Load_MapList(); set_task(5.0, "CheckTime", .flags = "b"); set_task(11.0, "SoundTimer", .flags = "d"); set_cvar_string("mapcyclefile", FILE_MAPS); if(get_pcvar_num(g_pDebug)) { log_to_file("mapmanager_debug.log", "PLUGIN_INIT: %s", g_szCurrentMap); } } public plugin_end() { if(g_iExtendedMax) { set_pcvar_num(g_pTimeLimit, get_pcvar_num(g_pTimeLimit) - g_iExtendedMax * get_pcvar_num(g_pExendedTime)); } new const TEMP_FILE[] = "addons/amxmodx/data/temp.ini"; new iTemp = fopen(TEMP_FILE, "wt"); for(new i = 0; i < MAP_BLOCK; i++) { if(g_BlockedMaps[COUNT]) { fprintf(iTemp, "^"%s^" ^"%d^"^n", g_BlockedMaps[MAP], g_BlockedMaps[COUNT]); } } fprintf(iTemp, "^"%s^" ^"%d^"^n", g_szCurrentMap, MAP_BLOCK); fclose(iTemp); delete_file(FILE_BLOCKEDMAPS); new iRename = rename_file(TEMP_FILE, FILE_BLOCKEDMAPS, 1); if(get_pcvar_num(g_pDebug)) { log_to_file("mapmanager_debug.log", "PLUGIN_END: File Renamed? %d", iRename); } } public client_disconnect(id) { if(task_exists(id + TASK_VOTEMENU)) remove_task(id + TASK_VOTEMENU); if(g_bRockVoted[id]) { g_bRockVoted[id] = false; g_iRockVote--; } if(g_iNominatedMaps[id]) { clear_nominated_maps(id); } } //***** Commands *****// public Command_StartVote(id, flag) { if(~get_user_flags(id) & flag) return PLUGIN_HANDLED; StartVote(id); return PLUGIN_HANDLED; } public Command_StopVote(id, flag) { if(~get_user_flags(id) & flag) return PLUGIN_HANDLED; if(g_bBeInVote) { g_bBeInVote = false; if(task_exists(TASK_SHOWMENU)) remove_task(TASK_SHOWMENU); if(task_exists(TASK_SHOWTIMER)) remove_task(TASK_SHOWTIMER); if(task_exists(TASK_TIMER)) remove_task(TASK_TIMER); for(new id = 1; id = get_pcvar_num(g_pTimeStartVote) * 60) { StartVote(0); } } return PLUGIN_CONTINUE; } public StartVote(id) { if(!g_iLoadMaps) { if(id) client_print_color(id, DontChange, "^4%s^1 Р’ файле нет валидных карт.", PREFIX); return PLUGIN_HANDLED; } if(g_bBeInVote) { if(id) client_print_color(id, DontChange, "^4%s^1 Голосование запущено.", PREFIX); return PLUGIN_HANDLED; } g_bBeInVote = true; g_iTotal = 0; arrayset(g_iVoteItem, 0, SELECT_MAPS + 1); arrayset(g_iInMenu, -1, SELECT_MAPS); arrayset(g_bHasVoted, false, 33); new Num, NomInMenu = 0, Data[NOMINATE_DATA]; new iMax = 8, Limits[2]; Limits[0] = SELECT_MAPS; Limits[1] = g_iLoadMaps - get_blocked_maps(); for(new i = 0; i < sizeof(Limits); i++) { if(iMax > Limits) iMax = Limits; } new iNomMax, iNomNum = ArraySize(g_iNominateArray); iNomMax = iNomNum > NOMINATE_MAX ? NOMINATE_MAX : iNomNum; for(new i = 0; i < iMax; i++) { if(NomInMenu < iNomMax) { Num = random_num(0, ArraySize(g_iNominateArray) - 1); ArrayGetArray(g_iNominateArray, Num, Data); formatex(g_szInMenuMapName, 32, Data[MAP]); g_iInMenu = Data[ID]; NomInMenu++; ArrayDeleteItem(g_iNominateArray, Num); g_iNominatedMaps[Data[PLAYER]]--; } else { do Num = random_num(0, g_iLoadMaps - 1); while(in_menu(Num) || is_blocked(Num)); g_iInMenu = Num; ArrayGetString(g_iMapsArray, Num, g_szInMenuMapName, 32); } } set_task(1.0, "Show_Timer", TASK_SHOWTIMER, _, _, "a", 10); set_task(11.0, "Show_Menu", TASK_SHOWMENU); new iRet; ExecuteForward(g_iForwardStartVote, iRet); if(get_pcvar_num(g_pDebug)) { log_to_file("mapmanager_debug.log", "START_VOTE: RTV? %d", g_bRockVote ? 1 : 0); } return PLUGIN_HANDLED; } public Show_Timer() { static iTimer; if(iTimer == 0) iTimer = 10; new szSec[16]; get_ending(iTimer, "секунд", "секунда", "секунды", szSec, charsmax(szSec)); for(new i = 1; i
У меня не получается под спойлер кинуть( с планшета я, компьютер на неделе только покупать буду. А так вообще в исходнике, через notepad поставь кодировку utf без ВОМ и все. Скомпилируй еще, да.