(¬‿¬)
This commit is contained in:
parent
797d6b90f6
commit
d1555374be
@ -130,7 +130,7 @@ 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);
|
||||
native bool GetMapVIPRestriction(const char[] map, int client = 0);
|
||||
|
||||
public SharedPlugin __pl_mapchooser_extended =
|
||||
{
|
||||
|
@ -1526,7 +1526,7 @@ public int Handler_MapVoteMenu(Handle menu, MenuAction action, int param1, int p
|
||||
{
|
||||
Format(buffer, sizeof(buffer), "%T", "Custom", param1, map);
|
||||
}
|
||||
else if(GetMapVIPRestriction(map))
|
||||
else if(InternalGetMapVIPRestriction(map))
|
||||
{
|
||||
Format(buffer, sizeof(buffer), "%s (%T)", map, "VIP Nomination", param1);
|
||||
}
|
||||
@ -2306,6 +2306,7 @@ public int Native_GetMapGroupRestriction(Handle plugin, int numParams)
|
||||
|
||||
public int Native_GetMapVIPRestriction(Handle plugin, int numParams)
|
||||
{
|
||||
int client = GetNativeCell(2);
|
||||
int len;
|
||||
GetNativeStringLength(1, len);
|
||||
|
||||
@ -2315,6 +2316,18 @@ public int Native_GetMapVIPRestriction(Handle plugin, int numParams)
|
||||
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);
|
||||
}
|
||||
|
||||
|
@ -510,8 +510,8 @@ public Action Command_Nominate(int client, int args)
|
||||
return Plugin_Handled;
|
||||
}
|
||||
|
||||
bool VIPRestriction = GetMapVIPRestriction(mapname);
|
||||
if((VIPRestriction) && !(CheckCommandAccess(client, "sm_tag", ADMFLAG_CUSTOM1) || CheckCommandAccess(client, "sm_kick", ADMFLAG_KICK)))
|
||||
bool VIPRestriction = GetMapVIPRestriction(mapname, client);
|
||||
if(VIPRestriction)
|
||||
{
|
||||
CPrintToChat(client, "[NE] %t", "Map Nominate VIP Error");
|
||||
|
||||
@ -790,7 +790,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 || (GetMapVIPRestriction(map) && !(CheckCommandAccess(param1, "sm_tag", ADMFLAG_CUSTOM1) || CheckCommandAccess(param1, "sm_kick", ADMFLAG_KICK))))
|
||||
if(GetMapTimeRestriction(map) || GetMapPlayerRestriction(map) || GetMapGroupRestriction(map, param1) >= 0 || GetMapVIPRestriction(map, param1))
|
||||
return ITEMDRAW_DISABLED;
|
||||
|
||||
return ITEMDRAW_DEFAULT;
|
||||
|
Loading…
Reference in New Issue
Block a user