diff --git a/addons/amxmodx/configs/maplists.ini b/addons/amxmodx/configs/maplists.ini index bf79e4d..6fa66be 100644 --- a/addons/amxmodx/configs/maplists.ini +++ b/addons/amxmodx/configs/maplists.ini @@ -3,6 +3,6 @@ ; anytime - this list will be always loaded ; example ; "Day Maps" "maps.ini" "1" "6:00" "22:59" -; "Nigth Maps" "nightmaps.ini" "1" "23:00" "5:59" +; "Night Maps" "nightmaps.ini" "1" "23:00" "5:59" ; "Another maps" "another.ini" "0" "anytime" diff --git a/addons/amxmodx/scripting/include/map_manager.inc b/addons/amxmodx/scripting/include/map_manager.inc index bc65302..1f0f75c 100644 --- a/addons/amxmodx/scripting/include/map_manager.inc +++ b/addons/amxmodx/scripting/include/map_manager.inc @@ -47,7 +47,7 @@ native mapm_load_maplist_to_array(Array:array, filename[]); native mapm_get_map_index(map[]); /** - * Get prefix const from core. + * Get prefix from core. * * @param prefix Prefix string * @param len String lenght diff --git a/addons/amxmodx/scripting/map_manager_core.sma b/addons/amxmodx/scripting/map_manager_core.sma index b95051f..68aa689 100644 --- a/addons/amxmodx/scripting/map_manager_core.sma +++ b/addons/amxmodx/scripting/map_manager_core.sma @@ -7,7 +7,7 @@ #endif #define PLUGIN "Map Manager: Core" -#define VERSION "3.0.0-Beta-5" +#define VERSION "3.0.0" #define AUTHOR "Mistrick" #pragma semicolon 1 @@ -359,8 +359,6 @@ prepare_vote(type) return 0; } - // server_print("--prepare vote--"); - g_bVoteStarted = true; g_bVoteFinished = false; @@ -386,7 +384,7 @@ prepare_vote(type) new map_info[MapStruct]; for(new random_map; g_iVoteItems < vote_max_items; g_iVoteItems++) { do { - random_map = random(array_size); + random_map = random_num(0, array_size - 1); ArrayGetArray(g_aMapsList, random_map, map_info); } while(is_map_in_vote(map_info[MapName]) || !is_map_allowed(map_info[MapName], PUSH_BY_CORE, random_map)); @@ -413,7 +411,7 @@ prepare_vote(type) arrayset(g_iRandomNums, -1, sizeof(g_iRandomNums)); for(new i; i < g_iVoteItems + g_bCanExtend; i++) { do { - g_iRandomNums[i] = random(g_iVoteItems + g_bCanExtend); + g_iRandomNums[i] = random_num(0, g_iVoteItems + g_bCanExtend - 1); } while(in_array(i, g_iRandomNums[i])); } } else { @@ -579,7 +577,6 @@ finish_vote() g_bVoteStarted = false; // vote results - // server_print("--finish vote--"); // pre forward new ret; @@ -601,7 +598,7 @@ finish_vote() } } else { - max_vote = random(g_iVoteItems); + max_vote = random_num(0, g_iVoteItems - 1); } // post forward diff --git a/addons/amxmodx/scripting/map_manager_nomination.sma b/addons/amxmodx/scripting/map_manager_nomination.sma index a367779..166da18 100644 --- a/addons/amxmodx/scripting/map_manager_nomination.sma +++ b/addons/amxmodx/scripting/map_manager_nomination.sma @@ -8,7 +8,7 @@ #endif #define PLUGIN "Map Manager: Nomination" -#define VERSION "0.0.7" +#define VERSION "0.0.8" #define AUTHOR "Mistrick" #pragma semicolon 1 @@ -345,7 +345,7 @@ show_nomination_menu(id, Array:maplist, custom_title[] = "") for(new i = 0, index, nom_index; i < size; i++) { if(random_sort) { do { - index = random(size); + index = random_num(0, size - 1); } while(in_array(array, index)); ArrayPushCell(array, index); } else { @@ -428,7 +428,7 @@ public mapm_prepare_votelist(type) } new nom_info[NomStruct]; for(new i, index; i < get_num(MAPS_IN_VOTE) && ArraySize(g_aNomList); i++) { - index = random(ArraySize(g_aNomList)); + index = random_num(0, ArraySize(g_aNomList) - 1); ArrayGetArray(g_aNomList, index, nom_info); ArrayDeleteItem(g_aNomList, index); g_iNomMaps[nom_info[NomPlayer]]--; diff --git a/addons/amxmodx/scripting/map_manager_online_sorter.sma b/addons/amxmodx/scripting/map_manager_online_sorter.sma index f18b7f1..e532719 100644 --- a/addons/amxmodx/scripting/map_manager_online_sorter.sma +++ b/addons/amxmodx/scripting/map_manager_online_sorter.sma @@ -2,7 +2,7 @@ #include #define PLUGIN "Map Manager: Online sorter" -#define VERSION "0.0.1" +#define VERSION "0.0.2" #define AUTHOR "Mistrick" #pragma semicolon 1 @@ -38,18 +38,16 @@ public mapm_prepare_votelist(type) new Array:array = ArrayCreate(MAPNAME_LENGTH, 1); new map_info[MapStruct], size = ArraySize(g_aMapsList); - // server_print("Found maps for current online:"); for(new i; i < size; i++) { ArrayGetArray(g_aMapsList, i, map_info); if(map_info[MinPlayers] <= players_num <= map_info[MaxPlayers]) { ArrayPushString(array, map_info[MapName]); - // server_print("%d - %s", ArraySize(array), map_info[MapName]); } } new map[MAPNAME_LENGTH], max_items = mapm_get_votelist_size(); for(new i, index; i < max_items && ArraySize(array); i++) { - index = random(ArraySize(array)); + index = random_num(0, ArraySize(array) - 1); ArrayGetString(array, index, map, charsmax(map)); ArrayDeleteItem(array, index); if(mapm_push_map_to_votelist(map, PUSH_BY_ONLINE_SORTER) == PUSH_BLOCKED) { diff --git a/addons/amxmodx/scripting/map_manager_rtv.sma b/addons/amxmodx/scripting/map_manager_rtv.sma index 7478ecc..2155fc1 100644 --- a/addons/amxmodx/scripting/map_manager_rtv.sma +++ b/addons/amxmodx/scripting/map_manager_rtv.sma @@ -7,7 +7,7 @@ #endif #define PLUGIN "Map Manager: Rtv" -#define VERSION "0.0.3" +#define VERSION "0.0.4" #define AUTHOR "Mistrick" #pragma semicolon 1 @@ -85,7 +85,7 @@ public clcmd_rtv(id) new need_votes; if(get_num(MODE) == MODE_PERCENTS) { - need_votes = floatround(get_players_num() * get_num(PERCENT) / 100.0) - g_iVotes; + need_votes = floatround(get_players_num() * get_num(PERCENT) / 100.0, floatround_ceil) - g_iVotes; } else { need_votes = get_num(PLAYERS) - g_iVotes; }