forked from UNLOZE/sm-plugins
Allow mapchooser to exclude maps based on Daytime.
This commit is contained in:
@@ -268,6 +268,17 @@ public Action Command_Addmap(int client, int args)
|
||||
}
|
||||
}
|
||||
|
||||
int TimeRestriction = GetMapTimeRestriction(mapname);
|
||||
if(TimeRestriction)
|
||||
{
|
||||
if(TimeRestriction < 0)
|
||||
CPrintToChat(client, "[NE] %t", "Map Nominate MinTime Error", TimeRestriction * -1);
|
||||
else
|
||||
CPrintToChat(client, "[NE] %t", "Map Nominate MaxTime Error", TimeRestriction);
|
||||
|
||||
return Plugin_Handled;
|
||||
}
|
||||
|
||||
int PlayerRestriction = GetMapPlayerRestriction(mapname);
|
||||
if(PlayerRestriction)
|
||||
{
|
||||
@@ -462,6 +473,17 @@ public Action Command_Nominate(int client, int args)
|
||||
return Plugin_Handled;
|
||||
}
|
||||
|
||||
int TimeRestriction = GetMapTimeRestriction(mapname);
|
||||
if(TimeRestriction)
|
||||
{
|
||||
if(TimeRestriction < 0)
|
||||
CPrintToChat(client, "[NE] %t", "Map Nominate MinTime Error", TimeRestriction * -1);
|
||||
else
|
||||
CPrintToChat(client, "[NE] %t", "Map Nominate MaxTime Error", TimeRestriction);
|
||||
|
||||
return Plugin_Handled;
|
||||
}
|
||||
|
||||
int PlayerRestriction = GetMapPlayerRestriction(mapname);
|
||||
if(PlayerRestriction)
|
||||
{
|
||||
@@ -685,7 +707,7 @@ public int Handler_MapSelectMenu(Menu menu, MenuAction action, int param1, int p
|
||||
if((status & MAPSTATUS_DISABLED) == MAPSTATUS_DISABLED)
|
||||
return ITEMDRAW_DISABLED;
|
||||
|
||||
if(GetMapPlayerRestriction(map))
|
||||
if(GetMapTimeRestriction(map) || GetMapPlayerRestriction(map))
|
||||
return ITEMDRAW_DISABLED;
|
||||
|
||||
return ITEMDRAW_DEFAULT;
|
||||
@@ -753,6 +775,17 @@ public int Handler_MapSelectMenu(Menu menu, MenuAction action, int param1, int p
|
||||
}
|
||||
}
|
||||
|
||||
int TimeRestriction = GetMapTimeRestriction(map);
|
||||
if(TimeRestriction)
|
||||
{
|
||||
if(TimeRestriction < 0)
|
||||
Format(display, sizeof(display), "%s (%T)", buffer, "Map Time Restriction", param1, "+", TimeRestriction * -1);
|
||||
else
|
||||
Format(display, sizeof(display), "%s (%T)", buffer, "Map Time Restriction", param1, "-", TimeRestriction);
|
||||
|
||||
return RedrawMenuItem(display);
|
||||
}
|
||||
|
||||
int PlayerRestriction = GetMapPlayerRestriction(map);
|
||||
if(PlayerRestriction)
|
||||
{
|
||||
@@ -850,7 +883,7 @@ public int Handler_AdminMapSelectMenu(Menu menu, MenuAction action, int param1,
|
||||
return ITEMDRAW_DISABLED;
|
||||
}
|
||||
|
||||
if(GetMapPlayerRestriction(map))
|
||||
if(GetMapTimeRestriction(map) || GetMapPlayerRestriction(map))
|
||||
return ITEMDRAW_DISABLED;
|
||||
}
|
||||
|
||||
@@ -894,6 +927,17 @@ public int Handler_AdminMapSelectMenu(Menu menu, MenuAction action, int param1,
|
||||
}
|
||||
}
|
||||
|
||||
int TimeRestriction = GetMapTimeRestriction(map);
|
||||
if(TimeRestriction)
|
||||
{
|
||||
if(TimeRestriction < 0)
|
||||
Format(display, sizeof(display), "%s (%T)", buffer, "Map Time Restriction", param1, "+", TimeRestriction * -1);
|
||||
else
|
||||
Format(display, sizeof(display), "%s (%T)", buffer, "Map Time Restriction", param1, "-", TimeRestriction);
|
||||
|
||||
return RedrawMenuItem(display);
|
||||
}
|
||||
|
||||
int PlayerRestriction = GetMapPlayerRestriction(map);
|
||||
if(PlayerRestriction)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user