forked from UNLOZE/sm-plugins
Merge remote-tracking branch 'unloze/master'
and fix like everything
This commit is contained in:
@@ -32,48 +32,7 @@
|
||||
"ze_FFXIV_Wanderers_Palace_v5_2f" {}
|
||||
"ze_FFVII_Temple_Ancient_v3_3" {}
|
||||
}
|
||||
"2" // cosmo
|
||||
{
|
||||
"_max" "1"
|
||||
"ze_ffvii_cosmo_canyon_v1beta1" {}
|
||||
"ze_ffvii_cosmo_canyon_v1_1" {}
|
||||
"ze_ffvii_cosmo_canyon_v2_1" {}
|
||||
"ze_ffvii_cosmo_canyon_v4fix" {}
|
||||
"ze_ffvii_cosmo_canyon_v5test2" {}
|
||||
"ze_ffvii_cosmo_canyon_v5fix" {}
|
||||
}
|
||||
"3" // wester
|
||||
{
|
||||
"_max" "1"
|
||||
"ze_ffxii_westersand_v2_11a" {}
|
||||
"ze_ffxii_westersand_v2d" {}
|
||||
"ze_FFXII_Westersand_v5_2" {}
|
||||
"ze_FFXII_Westersand_v7" {}
|
||||
"ze_FFXII_Westersand_v7_2" {}
|
||||
}
|
||||
"4" // mako
|
||||
{
|
||||
"_max" "1"
|
||||
"ze_FFVII_Mako_Reactor_b2" {}
|
||||
"ze_FFVII_Mako_Reactor_v1_4_1" {}
|
||||
"ze_FFVII_Mako_Reactor_v3_1" {}
|
||||
"ze_FFVII_Mako_Reactor_v5_3" {}
|
||||
"ZE_FFVII_Mako_Reactor_V6_B08" {}
|
||||
}
|
||||
"5" // wanderes
|
||||
{
|
||||
"_max" "1"
|
||||
"ze_ffxiv_wanderers_palace_css" {}
|
||||
"ze_ffxiv_wanderers_palace_v4_5s" {}
|
||||
"ze_FFXIV_Wanderers_Palace_v5_2f" {}
|
||||
}
|
||||
"6" // minas
|
||||
{
|
||||
"_max" "1"
|
||||
"ze_lotr_minas_tirith_v2_2fix" {}
|
||||
"ze_lotr_minas_tirith_v3_3" {}
|
||||
}
|
||||
"7" // rooftop
|
||||
"2" // rooftop
|
||||
{
|
||||
"_max" "2"
|
||||
"ze_gargantua_v2_0" {}
|
||||
@@ -82,216 +41,444 @@
|
||||
"ze_rooftop_runaway2_v5" {}
|
||||
"ze_rooftop_reborn_v3_2" {}
|
||||
}
|
||||
"3" // random
|
||||
{
|
||||
"_max" "1"
|
||||
"ze_random_v9" {}
|
||||
"ze_random_v10_fix" {}
|
||||
"ze_random_escape_b7_3" {}
|
||||
}
|
||||
"4" // shroom
|
||||
{
|
||||
"_max" "2"
|
||||
"ze_shroomforest2_v1" {}
|
||||
"ze_shroomforest_v4_5" {}
|
||||
"ze_shroomforest3_b6_2" {}
|
||||
}
|
||||
"5" // pirates
|
||||
{
|
||||
"_max" "1"
|
||||
"ze_pirates_port_royal_v5_4s2" {}
|
||||
"ze_pirates_port_royal_v3_6" {}
|
||||
}
|
||||
"6" // jurassic
|
||||
{
|
||||
"_max" "2"
|
||||
"ze_jurassic_park_story_v1" {}
|
||||
"ze_jurassicpark_c1v4" {}
|
||||
"ze_jurassicpark_v2_10_ob" {}
|
||||
}
|
||||
}
|
||||
|
||||
"ze_Ancient_wrath_v1_fix2"
|
||||
{
|
||||
"MinPlayers" "20"
|
||||
}
|
||||
|
||||
"ze_assassins_creed_v1"
|
||||
{
|
||||
"MinPlayers" "20"
|
||||
}
|
||||
|
||||
"ze_bioshock_v6_3"
|
||||
{
|
||||
"MinPlayers" "20"
|
||||
}
|
||||
|
||||
"ze_castlevania_v1_3"
|
||||
{
|
||||
"MinPlayers" "20"
|
||||
}
|
||||
|
||||
"ze_dark_souls_ptd_v0_4"
|
||||
{
|
||||
"MinPlayers" "35"
|
||||
}
|
||||
|
||||
"ze_deadcore_s6"
|
||||
{
|
||||
"MinPlayers" "40"
|
||||
}
|
||||
"ze_abandoned_project_v1_2"
|
||||
{
|
||||
"MinPlayers" "20"
|
||||
}
|
||||
"ze_amkoescape_v1337"
|
||||
{
|
||||
"MinPlayers" "20"
|
||||
}
|
||||
"ze_Ancient_wrath_v1_fix2"
|
||||
{
|
||||
"MinPlayers" "20"
|
||||
}
|
||||
"ze_antartika_b2"
|
||||
{
|
||||
"MinPlayers" "40"
|
||||
}
|
||||
"ze_ashen_keep_v0_3"
|
||||
{
|
||||
"MinPlayers" "40"
|
||||
}
|
||||
"ze_avalanche_reboot_beta3"
|
||||
{
|
||||
"MinPlayers" "40"
|
||||
}
|
||||
"ze_bathroom_v2_5s"
|
||||
{
|
||||
"MinPlayers" "20"
|
||||
}
|
||||
"ze_bioshock_v6_3"
|
||||
{
|
||||
"MinPlayers" "40"
|
||||
}
|
||||
"ze_boredom_v543656"
|
||||
{
|
||||
"MinPlayers" "40"
|
||||
}
|
||||
"ze_castlevania_v1_3"
|
||||
{
|
||||
"MinPlayers" "40"
|
||||
}
|
||||
"ze_chicken_ranch_v2_1s"
|
||||
{
|
||||
"MinPlayers" "20"
|
||||
}
|
||||
"ze_christmas_infection_v2_3"
|
||||
{
|
||||
"MinPlayers" "40"
|
||||
}
|
||||
"ze_chroma_v0_4"
|
||||
{
|
||||
"MinPlayers" "40"
|
||||
}
|
||||
"ze_dark_souls_ptd_v0_4"
|
||||
{
|
||||
"MinPlayers" "40"
|
||||
}
|
||||
"ze_destruction_of_exorath_re3"
|
||||
{
|
||||
"MinPlayers" "20"
|
||||
}
|
||||
"ze_doom3_v1"
|
||||
{
|
||||
"MinPlayers" "40"
|
||||
}
|
||||
|
||||
"ze_doom_v3_1"
|
||||
{
|
||||
"MinPlayers" "35"
|
||||
}
|
||||
|
||||
"ze_fapescape_rote_v1_3f"
|
||||
{
|
||||
"MinPlayers" "40"
|
||||
"MinPlayers" "40"
|
||||
}
|
||||
|
||||
"ze_ffvii_cosmo_canyon_v1_1"
|
||||
"ze_fapescape_v1_2"
|
||||
{
|
||||
"MinPlayers" "35"
|
||||
"MinPlayers" "20"
|
||||
}
|
||||
|
||||
"ze_ffvii_cosmo_canyon_v2_1"
|
||||
{
|
||||
"MinPlayers" "35"
|
||||
}
|
||||
|
||||
"ze_ffvii_cosmo_canyon_v5fix"
|
||||
{
|
||||
"MinPlayers" "20"
|
||||
"MinPlayers" "40"
|
||||
"Cooldown" "45"
|
||||
}
|
||||
|
||||
"ZE_FFVII_Mako_Reactor_V6_B08"
|
||||
"ze_FFVII_Temple_Ancient_v3_3"
|
||||
{
|
||||
"MinPlayers" "20"
|
||||
"MinPlayers" "40"
|
||||
}
|
||||
|
||||
"ze_FFXII_Feywood_b3_1"
|
||||
{
|
||||
"MinPlayers" "20"
|
||||
"MinPlayers" "40"
|
||||
"Cooldown" "45"
|
||||
}
|
||||
"ze_FFVII_Mako_Reactor_v5_3"
|
||||
{
|
||||
"MinTime" "2200"
|
||||
"MaxTime" "1600"
|
||||
"Cooldown" "45"
|
||||
"MinPlayers" "20"
|
||||
}
|
||||
"ZE_FFVII_Mako_Reactor_V6_B08"
|
||||
{
|
||||
"Cooldown" "45"
|
||||
"MinPlayers" "40"
|
||||
}
|
||||
|
||||
"ze_FFXII_Paramina_Rift_v1_4"
|
||||
{
|
||||
"MinPlayers" "20"
|
||||
"MinPlayers" "40"
|
||||
"Cooldown" "45"
|
||||
}
|
||||
|
||||
"ze_ffxii_ridorana_cataract_t4"
|
||||
{
|
||||
"MinPlayers" "40"
|
||||
"MinPlayers" "40"
|
||||
}
|
||||
|
||||
"ze_FFXII_Westersand_v5_2"
|
||||
"ze_ffxii_westersand_v2d"
|
||||
{
|
||||
"MinPlayers" "35"
|
||||
"MinPlayers" "40"
|
||||
}
|
||||
|
||||
"ze_FFXII_Westersand_v7_2"
|
||||
"ze_ffxii_westersand_v5_2"
|
||||
{
|
||||
"MinPlayers" "20"
|
||||
"MinPlayers" "40"
|
||||
"Cooldown" "45"
|
||||
}
|
||||
"ze_ffxii_westersand_v7_2"
|
||||
{
|
||||
"MinPlayers" "40"
|
||||
"Cooldown" "45"
|
||||
}
|
||||
|
||||
"ze_FFXII_Westersand_v8zeta1"
|
||||
{
|
||||
"MinPlayers" "20"
|
||||
"MinPlayers" "40"
|
||||
"Cooldown" "45"
|
||||
}
|
||||
"ze_ffxiv_wanderers_palace_v4_5s"
|
||||
{
|
||||
"MinPlayers" "40"
|
||||
}
|
||||
"ze_FFXIV_Wanderers_Palace_v5_2f"
|
||||
{
|
||||
"MinPlayers" "40"
|
||||
"MinPlayers" "40"
|
||||
"Cooldown" "45"
|
||||
}
|
||||
"ze_frostdrake_tower_v1s"
|
||||
{
|
||||
"MinPlayers" "35"
|
||||
"MinPlayers" "40"
|
||||
}
|
||||
|
||||
"ze_GoT_The_North_b4"
|
||||
"ze_frozentemple_b8_2"
|
||||
{
|
||||
"MinPlayers" "35"
|
||||
"MinPlayers" "20"
|
||||
}
|
||||
|
||||
"ze_grau_s2"
|
||||
{
|
||||
"MinPlayers" "40"
|
||||
}
|
||||
|
||||
"ze_gris_fyk"
|
||||
{
|
||||
"MinPlayers" "40"
|
||||
"MinPlayers" "40"
|
||||
}
|
||||
|
||||
"ze_harry_potter_v2_1"
|
||||
"ze_halloween_house_b4s"
|
||||
{
|
||||
"MinPlayers" "35"
|
||||
"MinPlayers" "40"
|
||||
}
|
||||
"ze_hellz_rescuebase_v5_b1"
|
||||
{
|
||||
"MinPlayers" "20"
|
||||
}
|
||||
|
||||
"ze_hsc_a4_5"
|
||||
{
|
||||
"MinPlayers" "40"
|
||||
"MinPlayers" "40"
|
||||
}
|
||||
"ze_industrial_dejavu_v3_3_1"
|
||||
{
|
||||
"MinPlayers" "40"
|
||||
}
|
||||
"ze_Infected_Sewers_v6_5"
|
||||
{
|
||||
"MinPlayers" "40"
|
||||
}
|
||||
"ze_interception_b4"
|
||||
{
|
||||
"MinPlayers" "20"
|
||||
}
|
||||
"ze_johnny_nukem_b8_1"
|
||||
{
|
||||
"MinPlayers" "40"
|
||||
}
|
||||
"ze_journey_v1_2"
|
||||
{
|
||||
"MinPlayers" "40"
|
||||
}
|
||||
|
||||
"ze_last_man_standing_v4_2"
|
||||
{
|
||||
"MinPlayers" "35"
|
||||
"MinPlayers" "40"
|
||||
}
|
||||
"ze_legoland_crackheads_v2"
|
||||
{
|
||||
"MinPlayers" "20"
|
||||
}
|
||||
"ze_l0v0l_v1_4"
|
||||
{
|
||||
"MinPlayers" "20"
|
||||
}
|
||||
"ze_lila_panic_escape_v3_1"
|
||||
{
|
||||
"MinPlayers" "20"
|
||||
}
|
||||
"ze_lolxd_final_s"
|
||||
{
|
||||
"MinPlayers" "20"
|
||||
}
|
||||
"ze_LOTR_Isengard_v2_3"
|
||||
{
|
||||
"MinPlayers" "20"
|
||||
}
|
||||
|
||||
"ze_lotr_minas_tirith_v2_2fix"
|
||||
{
|
||||
"MinPlayers" "35"
|
||||
"MinTime" "1800"
|
||||
"MaxTime" "2200"
|
||||
"MinPlayers" "40"
|
||||
"Cooldown" "45"
|
||||
}
|
||||
|
||||
"ze_lotr_minas_tirith_v3_3"
|
||||
{
|
||||
"MinPlayers" "35"
|
||||
"MinTime" "1800"
|
||||
"MaxTime" "2200"
|
||||
"MinPlayers" "40"
|
||||
"Cooldown" "45"
|
||||
}
|
||||
|
||||
"ze_mist_v1_3"
|
||||
"ze_megaman_a6"
|
||||
{
|
||||
"MinPlayers" "40"
|
||||
}
|
||||
|
||||
"ze_minecraft_adventure_v1_2c"
|
||||
{
|
||||
"MinPlayers" "20"
|
||||
}
|
||||
"ze_mountain_escape_v5_zy"
|
||||
{
|
||||
"MinPlayers" "20"
|
||||
"Cooldown" "45"
|
||||
}
|
||||
"ze_otakuroom_v5_6fs"
|
||||
{
|
||||
"MinPlayers" "20"
|
||||
}
|
||||
"ze_paper_escaper_v7_1"
|
||||
{
|
||||
"MinPlayers" "20"
|
||||
}
|
||||
"ze_Paranoid_Rezurrection_v11_9"
|
||||
{
|
||||
"MinPlayers" "20"
|
||||
"Cooldown" "45"
|
||||
}
|
||||
"ze_parkers_pit_b8"
|
||||
{
|
||||
"MinPlayers" "20"
|
||||
}
|
||||
"ze_Parking_v3_1"
|
||||
{
|
||||
"MinPlayers" "20"
|
||||
}
|
||||
"ze_Pidaras_v1_4fix3"
|
||||
{
|
||||
"MinPlayers" "20"
|
||||
}
|
||||
"ze_Pirates_Port_Royal_v3_6"
|
||||
{
|
||||
"MinPlayers" "20"
|
||||
}
|
||||
"ze_pirates_port_royal_v5_4s2"
|
||||
{
|
||||
"MinPlayers" "20"
|
||||
"Cooldown" "45"
|
||||
}
|
||||
"ze_pizzatime_v4s"
|
||||
{
|
||||
"MinPlayers" "35"
|
||||
"MinPlayers" "40"
|
||||
}
|
||||
|
||||
"ze_predator_ultimate_v1_3"
|
||||
"ze_pkmn_adventure_v8_6s_fix2"
|
||||
{
|
||||
"MinPlayers" "35"
|
||||
"MinPlayers" "40"
|
||||
}
|
||||
"ze_PoncherMonkey_Shooter_v3_5"
|
||||
{
|
||||
"MinPlayers" "40"
|
||||
}
|
||||
"ze_portal_story_v3_2"
|
||||
{
|
||||
"MinPlayers" "20"
|
||||
}
|
||||
|
||||
"ze_predator_ultimate_v3"
|
||||
{
|
||||
"MinPlayers" "20"
|
||||
"MinPlayers" "20"
|
||||
}
|
||||
"ze_rizomata_s1_2"
|
||||
"ze_project_alcaria_v1_5s"
|
||||
{
|
||||
"MinPlayers" "40"
|
||||
"MinPlayers" "20"
|
||||
}
|
||||
"ze_prototype_v2"
|
||||
{
|
||||
"MinPlayers" "20"
|
||||
}
|
||||
"ze_ravenholm_v035fix"
|
||||
{
|
||||
"MinPlayers" "20"
|
||||
}
|
||||
"ze_rizomata_s1_3"
|
||||
{
|
||||
"MinPlayers" "40"
|
||||
}
|
||||
"ze_rtcw_ominous_rumors_v1"
|
||||
{
|
||||
"MinPlayers" "20"
|
||||
}
|
||||
"ze_sandstorm_f1"
|
||||
{
|
||||
"MinPlayers" "20"
|
||||
}
|
||||
"ze_Serpentis_Temple_v1_1"
|
||||
{
|
||||
"MinPlayers" "40"
|
||||
"Cooldown" "45"
|
||||
}
|
||||
"ze_shroomforest_v4_5"
|
||||
{
|
||||
"MinPlayers" "20"
|
||||
"Cooldown" "45"
|
||||
}
|
||||
"ze_shroomforest2_v1"
|
||||
{
|
||||
"MinPlayers" "20"
|
||||
"Cooldown" "45"
|
||||
}
|
||||
"ze_shroomforest3_b6_2"
|
||||
{
|
||||
"MinPlayers" "40"
|
||||
"Cooldown" "45"
|
||||
}
|
||||
"ze_siberia_1990_v1_2c"
|
||||
{
|
||||
"MinPlayers" "20"
|
||||
}
|
||||
"ze_slender_escape_b4"
|
||||
{
|
||||
"MinPlayers" "20"
|
||||
}
|
||||
|
||||
"ze_stalker_ultimate_v2_3"
|
||||
{
|
||||
"MinPlayers" "35"
|
||||
"MinPlayers" "20"
|
||||
}
|
||||
|
||||
"ze_stalker_ultimate_v3"
|
||||
{
|
||||
"MinPlayers" "20"
|
||||
"MinPlayers" "20"
|
||||
}
|
||||
"ze_stalker_monolit_a5"
|
||||
{
|
||||
"MinPlayers" "50"
|
||||
}
|
||||
"ze_starwars_v2fix"
|
||||
{
|
||||
"MinPlayers" "20"
|
||||
}
|
||||
"ze_strange_escape_b3"
|
||||
{
|
||||
"MinPlayers" "20"
|
||||
}
|
||||
"ze_sunkentemple_v3_1s"
|
||||
{
|
||||
"MinPlayers" "20"
|
||||
}
|
||||
"ze_sunlight_v2_0"
|
||||
{
|
||||
"MinPlayers" "20"
|
||||
}
|
||||
"ze_super_mario_64_v2_b5"
|
||||
{
|
||||
"MinPlayers" "40"
|
||||
}
|
||||
"ze_survivors_b5"
|
||||
{
|
||||
"MinPlayers" "40"
|
||||
}
|
||||
|
||||
"ze_taboo_carnation_v2"
|
||||
{
|
||||
"MinPlayers" "40"
|
||||
"MinPlayers" "40"
|
||||
}
|
||||
|
||||
"ze_temple_raider_b4"
|
||||
{
|
||||
"MinPlayers" "40"
|
||||
"MinPlayers" "40"
|
||||
}
|
||||
|
||||
"ze_ten_keys_b2fix"
|
||||
"ze_Temple_v2_1"
|
||||
{
|
||||
"MinPlayers" "40"
|
||||
"MinPlayers" "40"
|
||||
}
|
||||
|
||||
"ze_tesv_a3"
|
||||
{
|
||||
"MinPlayers" "35"
|
||||
}
|
||||
|
||||
"ze_TESV_Skyrim_v3"
|
||||
{
|
||||
"MinPlayers" "35"
|
||||
}
|
||||
|
||||
"ze_tesv_skyrim_v4fix"
|
||||
{
|
||||
"MinPlayers" "20"
|
||||
"MinPlayers" "40"
|
||||
"Cooldown" "45"
|
||||
}
|
||||
|
||||
"ze_totally_new_wester"
|
||||
"ze_toaster_v1_2"
|
||||
{
|
||||
"MinPlayers" "20"
|
||||
"MinPlayers" "20"
|
||||
}
|
||||
"ze_UT2004_Convoy_v2_2_1"
|
||||
"ze_tyranny_v5_2"
|
||||
{
|
||||
"MinPlayers" "20"
|
||||
"MinPlayers" "40"
|
||||
}
|
||||
}
|
||||
"ze_undertale_g_v1_2s2"
|
||||
{
|
||||
"MinPlayers" "20"
|
||||
}
|
||||
"ze_ut2004_convoy_v2_2_1"
|
||||
{
|
||||
"MinPlayers" "40"
|
||||
}
|
||||
"ze_v0u0v_a4"
|
||||
{
|
||||
"MinPlayers" "40"
|
||||
}
|
||||
@@ -1,3 +1,3 @@
|
||||
"mapchooser_extended"
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
@@ -130,6 +130,15 @@ native int GetMapGroups(const char[] map, int[] groups, int size);
|
||||
// >=0 = Group _max -> Group full
|
||||
native int GetMapGroupRestriction(const char[] map, int client = 0);
|
||||
|
||||
native bool GetMapVIPRestriction(const char[] map, int client = 0);
|
||||
|
||||
/**
|
||||
* Amount of Extends left on the current map
|
||||
*
|
||||
* @return amounts of extends left
|
||||
*/
|
||||
native int GetExtendsLeft();
|
||||
|
||||
public SharedPlugin __pl_mapchooser_extended =
|
||||
{
|
||||
name = "mapchooser",
|
||||
|
||||
@@ -273,6 +273,9 @@ public void OnPluginStart()
|
||||
// Mapchooser Extended Commands
|
||||
RegAdminCmd("mce_reload_maplist", Command_ReloadMaps, ADMFLAG_CHANGEMAP, "mce_reload_maplist - Reload the Official Maplist file.");
|
||||
|
||||
RegConsoleCmd("sm_extends", Command_ExtendsLeft, "sm_extends - Shows how many extends are left on the current map.");
|
||||
RegConsoleCmd("sm_extendsleft", Command_ExtendsLeft, "sm_extendsleft - Shows how many extends are left on the current map.");
|
||||
|
||||
g_Cvar_Winlimit = FindConVar("mp_winlimit");
|
||||
g_Cvar_Maxrounds = FindConVar("mp_maxrounds");
|
||||
g_Cvar_Fraglimit = FindConVar("mp_fraglimit");
|
||||
@@ -411,6 +414,8 @@ public APLRes AskPluginLoad2(Handle myself, bool late, char[] error, int err_max
|
||||
CreateNative("GetMapPlayerRestriction", Native_GetMapPlayerRestriction);
|
||||
CreateNative("GetMapGroups", Native_GetMapGroups);
|
||||
CreateNative("GetMapGroupRestriction", Native_GetMapGroupRestriction);
|
||||
CreateNative("GetMapVIPRestriction", Native_GetMapVIPRestriction);
|
||||
CreateNative("GetExtendsLeft", Native_GetExtendsLeft);
|
||||
|
||||
return APLRes_Success;
|
||||
}
|
||||
@@ -613,6 +618,12 @@ public Action Command_ReloadMaps(int client, int args)
|
||||
InitializeOfficialMapList();
|
||||
}
|
||||
|
||||
public Action Command_ExtendsLeft(int client, int args)
|
||||
{
|
||||
CReplyToCommand(client, "[MCE] Available Extends: %d", GetConVarInt(g_Cvar_Extend) - g_Extends);
|
||||
return Plugin_Handled;
|
||||
}
|
||||
|
||||
public void OnMapTimeLeftChanged()
|
||||
{
|
||||
if(GetArraySize(g_MapList))
|
||||
@@ -1181,7 +1192,7 @@ void InitiateVote(MapChange when, Handle inputlist=INVALID_HANDLE)
|
||||
AddMapItem(map);
|
||||
}
|
||||
|
||||
CloseHandle(randomizeList);
|
||||
delete randomizeList;
|
||||
randomizeList = INVALID_HANDLE;
|
||||
}
|
||||
|
||||
@@ -1222,7 +1233,7 @@ void InitiateVote(MapChange when, Handle inputlist=INVALID_HANDLE)
|
||||
AddMenuItem(g_VoteMenu, VOTE_EXTEND, "Extend Map");
|
||||
}
|
||||
}
|
||||
CloseHandle(inputlist);
|
||||
delete inputlist;
|
||||
}
|
||||
|
||||
int voteDuration = GetConVarInt(g_Cvar_VoteDuration);
|
||||
@@ -1471,7 +1482,7 @@ public int Handler_MapVoteMenu(Handle menu, MenuAction action, int param1, int p
|
||||
if(g_NativeVotes)
|
||||
NativeVotes_Close(menu);
|
||||
else
|
||||
CloseHandle(menu);
|
||||
delete menu;
|
||||
}
|
||||
|
||||
case MenuAction_Display:
|
||||
@@ -1525,6 +1536,10 @@ public int Handler_MapVoteMenu(Handle menu, MenuAction action, int param1, int p
|
||||
{
|
||||
Format(buffer, sizeof(buffer), "%T", "Custom", param1, map);
|
||||
}
|
||||
else if(InternalGetMapVIPRestriction(map))
|
||||
{
|
||||
Format(buffer, sizeof(buffer), "%s (%T)", map, "VIP Nomination", param1);
|
||||
}
|
||||
}
|
||||
|
||||
if(buffer[0] != '\0')
|
||||
@@ -1686,11 +1701,14 @@ void CreateNextVote()
|
||||
for(int i = 0; i < limit; i++)
|
||||
{
|
||||
int b;
|
||||
for(int j = 0; j < 10; j++)
|
||||
for(int j = 0; j < 1000; j++)
|
||||
{
|
||||
b = GetRandomInt(0, GetArraySize(tempMaps) - 1);
|
||||
GetArrayString(tempMaps, b, map, PLATFORM_MAX_PATH);
|
||||
|
||||
if(InternalGetMapVIPRestriction(map))
|
||||
continue;
|
||||
|
||||
if(InternalGetMapTimeRestriction(map) != 0)
|
||||
continue;
|
||||
|
||||
@@ -1730,7 +1748,7 @@ void CreateNextVote()
|
||||
}
|
||||
|
||||
delete groupmap;
|
||||
CloseHandle(tempMaps);
|
||||
delete tempMaps;
|
||||
}
|
||||
|
||||
bool CanVoteStart()
|
||||
@@ -2296,6 +2314,37 @@ public int Native_GetMapGroupRestriction(Handle plugin, int numParams)
|
||||
return -1;
|
||||
}
|
||||
|
||||
public int Native_GetMapVIPRestriction(Handle plugin, int numParams)
|
||||
{
|
||||
int client = GetNativeCell(2);
|
||||
int len;
|
||||
GetNativeStringLength(1, len);
|
||||
|
||||
if(len <= 0)
|
||||
return false;
|
||||
|
||||
char[] map = new char[len+1];
|
||||
GetNativeString(1, map, len+1);
|
||||
|
||||
// Check if client should bypass vip restrictions
|
||||
if(client > 0 && client < MaxClients)
|
||||
{
|
||||
// Client has bypass flag, dont return vip restrictions
|
||||
if(CheckCommandAccess(client, "sm_nominate_ignore", ADMFLAG_CHEATS))
|
||||
return false;
|
||||
|
||||
// Client has vip flag, dont return vip restrictions
|
||||
if(CheckCommandAccess(client, "sm_nominate_vip", ADMFLAG_CUSTOM1))
|
||||
return false;
|
||||
}
|
||||
|
||||
return InternalGetMapVIPRestriction(map);
|
||||
}
|
||||
|
||||
public int Native_GetExtendsLeft(Handle plugin, int numParams)
|
||||
{
|
||||
return GetConVarInt(g_Cvar_Extend) - g_Extends;
|
||||
}
|
||||
|
||||
stock void AddMapItem(const char[] map)
|
||||
{
|
||||
@@ -2594,6 +2643,18 @@ stock int FindIntInArray(int[] array, int size, int value)
|
||||
return -1;
|
||||
}
|
||||
|
||||
stock bool InternalGetMapVIPRestriction(const char[] map)
|
||||
{
|
||||
int VIP = 0;
|
||||
|
||||
if(g_Config && g_Config.JumpToKey(map))
|
||||
{
|
||||
VIP = g_Config.GetNum("VIP", VIP);
|
||||
g_Config.Rewind();
|
||||
}
|
||||
|
||||
return view_as<bool>(VIP);
|
||||
}
|
||||
|
||||
stock void InternalRestoreMapCooldowns()
|
||||
{
|
||||
|
||||
@@ -75,6 +75,11 @@ Handle g_Cvar_MarkCustomMaps = INVALID_HANDLE;
|
||||
Handle g_Cvar_NominateDelay = INVALID_HANDLE;
|
||||
Handle g_Cvar_InitialDelay = INVALID_HANDLE;
|
||||
|
||||
// VIP Nomination Convars
|
||||
Handle g_Cvar_VIPTimeframe = INVALID_HANDLE;
|
||||
Handle g_Cvar_VIPTimeframeMinTime = INVALID_HANDLE;
|
||||
Handle g_Cvar_VIPTimeframeMaxTime = INVALID_HANDLE;
|
||||
|
||||
int g_Player_NominationDelay[MAXPLAYERS+1];
|
||||
int g_NominationDelay;
|
||||
|
||||
@@ -94,6 +99,10 @@ public void OnPluginStart()
|
||||
g_Cvar_InitialDelay = CreateConVar("sm_nominate_initialdelay", "60.0", "Time in seconds before first Nomination can be made", 0, true, 0.00);
|
||||
g_Cvar_NominateDelay = CreateConVar("sm_nominate_delay", "3.0", "Delay between nominations", 0, true, 0.00, true, 60.00);
|
||||
|
||||
g_Cvar_VIPTimeframe = CreateConVar("sm_nominate_vip_timeframe", "1", "Specifies if the should be a timeframe where only VIPs can nominate maps", 0, true, 0.00, true, 1.0);
|
||||
g_Cvar_VIPTimeframeMinTime = CreateConVar("sm_nominate_vip_timeframe_mintime", "1800", "Start of the timeframe where only VIPs can nominate maps (Format: HHMM)", 0, true, 0000.00, true, 2359.0);
|
||||
g_Cvar_VIPTimeframeMaxTime = CreateConVar("sm_nominate_vip_timeframe_maxtime", "2200", "End of the timeframe where only VIPs can nominate maps (Format: HHMM)", 0, true, 0000.00, true, 2359.0);
|
||||
|
||||
RegConsoleCmd("say", Command_Say);
|
||||
RegConsoleCmd("say_team", Command_Say);
|
||||
|
||||
@@ -501,6 +510,14 @@ public Action Command_Nominate(int client, int args)
|
||||
return Plugin_Handled;
|
||||
}
|
||||
|
||||
bool VIPRestriction = GetMapVIPRestriction(mapname, client);
|
||||
if(VIPRestriction)
|
||||
{
|
||||
CPrintToChat(client, "[NE] %t", "Map Nominate VIP Error");
|
||||
|
||||
return Plugin_Handled;
|
||||
}
|
||||
|
||||
int TimeRestriction = GetMapTimeRestriction(mapname);
|
||||
if(TimeRestriction)
|
||||
{
|
||||
@@ -611,6 +628,22 @@ public int Handler_NominateListMenu(Menu menu, MenuAction action, int param1, in
|
||||
{
|
||||
delete menu;
|
||||
}
|
||||
|
||||
case MenuAction_DisplayItem:
|
||||
{
|
||||
static char display[150];
|
||||
static char map[PLATFORM_MAX_PATH];
|
||||
GetMenuItem(menu, param2, map, sizeof(map));
|
||||
|
||||
bool VIPRestriction = GetMapVIPRestriction(map);
|
||||
if(VIPRestriction)
|
||||
{
|
||||
Format(display, sizeof(display), "%s (%T)", map, "VIP Nomination", param1);
|
||||
return RedrawMenuItem(display);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -716,6 +749,12 @@ public int Handler_MapSelectMenu(Menu menu, MenuAction action, int param1, int p
|
||||
|
||||
GetClientName(param1, name, MAX_NAME_LENGTH);
|
||||
|
||||
if(GetMapTimeRestriction(map) || GetMapPlayerRestriction(map) || GetMapGroupRestriction(map, param1) >= 0 || GetMapVIPRestriction(map, param1))
|
||||
{
|
||||
PrintToChat(param1, "[NE] You can't nominate this map right now.");
|
||||
return 0;
|
||||
}
|
||||
|
||||
NominateResult result = NominateMap(map, false, param1);
|
||||
|
||||
/* Don't need to check for InvalidMap because the menu did that already */
|
||||
@@ -757,7 +796,7 @@ public int Handler_MapSelectMenu(Menu menu, MenuAction action, int param1, int p
|
||||
if((status & MAPSTATUS_DISABLED) == MAPSTATUS_DISABLED)
|
||||
return ITEMDRAW_DISABLED;
|
||||
|
||||
if(GetMapTimeRestriction(map) || GetMapPlayerRestriction(map) || GetMapGroupRestriction(map, param1) >= 0)
|
||||
if(GetMapTimeRestriction(map) || GetMapPlayerRestriction(map) || GetMapGroupRestriction(map, param1) >= 0 || GetMapVIPRestriction(map, param1))
|
||||
return ITEMDRAW_DISABLED;
|
||||
|
||||
return ITEMDRAW_DEFAULT;
|
||||
@@ -803,6 +842,12 @@ public int Handler_MapSelectMenu(Menu menu, MenuAction action, int param1, int p
|
||||
else
|
||||
strcopy(buffer, sizeof(buffer), map);
|
||||
|
||||
bool VIPRestriction = GetMapVIPRestriction(map);
|
||||
if(VIPRestriction)
|
||||
{
|
||||
Format(buffer, sizeof(buffer), "%s (%T)", buffer, "VIP Restriction", param1);
|
||||
}
|
||||
|
||||
if((status & MAPSTATUS_DISABLED) == MAPSTATUS_DISABLED)
|
||||
{
|
||||
if((status & MAPSTATUS_EXCLUDE_CURRENT) == MAPSTATUS_EXCLUDE_CURRENT)
|
||||
@@ -829,7 +874,6 @@ public int Handler_MapSelectMenu(Menu menu, MenuAction action, int param1, int p
|
||||
if(TimeRestriction)
|
||||
{
|
||||
Format(display, sizeof(display), "%s (%T)", buffer, "Map Time Restriction", param1, "+", RoundToFloor(float(TimeRestriction / 60)), TimeRestriction % 60);
|
||||
|
||||
return RedrawMenuItem(display);
|
||||
}
|
||||
|
||||
@@ -851,6 +895,11 @@ public int Handler_MapSelectMenu(Menu menu, MenuAction action, int param1, int p
|
||||
return RedrawMenuItem(display);
|
||||
}
|
||||
|
||||
if(VIPRestriction)
|
||||
{
|
||||
return RedrawMenuItem(buffer);
|
||||
}
|
||||
|
||||
if(mark && !official)
|
||||
return RedrawMenuItem(buffer);
|
||||
|
||||
@@ -863,8 +912,21 @@ public int Handler_MapSelectMenu(Menu menu, MenuAction action, int param1, int p
|
||||
|
||||
stock bool IsNominateAllowed(int client)
|
||||
{
|
||||
if(BaseComm_IsClientGagged(client))
|
||||
if (BaseComm_IsClientGagged(client))
|
||||
{
|
||||
CReplyToCommand(client, "[NE] You are not allowed to nominate maps while you are gagged.");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!CheckCommandAccess(client, "sm_tag", ADMFLAG_CUSTOM1))
|
||||
{
|
||||
int VIPTimeRestriction = GetVIPTimeRestriction();
|
||||
if(VIPTimeRestriction)
|
||||
{
|
||||
CReplyToCommand(client, "[NE] During peak hours only VIPs are allowed to nominate maps. Wait for %d hours and %d minutes or buy VIP at Unloze.com to nominate maps again.", RoundToFloor(float(VIPTimeRestriction / 60)), VIPTimeRestriction % 60);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
CanNominateResult result = CanNominate();
|
||||
|
||||
@@ -1104,3 +1166,36 @@ public int Native_RemoveMapsFromNominationPool(Handle plugin, int numArgs)
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
stock int GetVIPTimeRestriction()
|
||||
{
|
||||
if (!GetConVarBool(g_Cvar_VIPTimeframe))
|
||||
return 0;
|
||||
|
||||
char sTime[8];
|
||||
FormatTime(sTime, sizeof(sTime), "%H%M");
|
||||
|
||||
int CurTime = StringToInt(sTime);
|
||||
int MinTime = GetConVarInt(g_Cvar_VIPTimeframeMinTime);
|
||||
int MaxTime = GetConVarInt(g_Cvar_VIPTimeframeMaxTime);
|
||||
|
||||
//Wrap around.
|
||||
CurTime = (CurTime <= MinTime) ? CurTime + 2400 : CurTime;
|
||||
MaxTime = (MaxTime <= MinTime) ? MaxTime + 2400 : MaxTime;
|
||||
|
||||
if ((MinTime <= CurTime <= MaxTime))
|
||||
{
|
||||
//Wrap around.
|
||||
MinTime = (MinTime <= CurTime) ? MinTime + 2400 : MinTime;
|
||||
MinTime = (MinTime <= MaxTime) ? MinTime + 2400 : MinTime;
|
||||
|
||||
// Convert our 'time' to minutes.
|
||||
CurTime = (RoundToFloor(float(CurTime / 100)) * 60) + (CurTime % 100);
|
||||
MinTime = (RoundToFloor(float(MinTime / 100)) * 60) + (MinTime % 100);
|
||||
MaxTime = (RoundToFloor(float(MaxTime / 100)) * 60) + (MaxTime % 100);
|
||||
|
||||
return MaxTime - CurTime;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -106,6 +106,16 @@
|
||||
"en" "*{1}"
|
||||
}
|
||||
|
||||
"VIP Nomination"
|
||||
{
|
||||
"en" "VIP Nomination"
|
||||
}
|
||||
|
||||
"Map Nominate VIP Error"
|
||||
{
|
||||
"en" "Only VIPs can nominate this map."
|
||||
}
|
||||
|
||||
"Map Nominate Time Error"
|
||||
{
|
||||
"#format" "{1:d},{2:d}"
|
||||
@@ -148,6 +158,11 @@
|
||||
"en" "Group max: {1}"
|
||||
}
|
||||
|
||||
"VIP Restriction"
|
||||
{
|
||||
"en" "VIP only"
|
||||
}
|
||||
|
||||
"Nomination Removed Time Error"
|
||||
{
|
||||
"#format" "{1:s}"
|
||||
|
||||
Reference in New Issue
Block a user