PointServerCommandFilter: fixed negative value bug
nominations_extended: fixed nominate_addmap menu ExtraCommands: fixed "no matching client was found" message AdvancedTargeting: fixed missing MarkNativeAsOptional in include
This commit is contained in:
parent
f5ca547c96
commit
e0741d6155
@ -21,5 +21,6 @@ public SharedPlugin:__pl_AdvancedTargeting =
|
|||||||
public __pl_myfile_SetNTVOptional()
|
public __pl_myfile_SetNTVOptional()
|
||||||
{
|
{
|
||||||
MarkNativeAsOptional("IsClientFriend");
|
MarkNativeAsOptional("IsClientFriend");
|
||||||
|
MarkNativeAsOptional("ReadClientFriends");
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -25,6 +25,7 @@ public Plugin:myinfo =
|
|||||||
|
|
||||||
public OnPluginStart()
|
public OnPluginStart()
|
||||||
{
|
{
|
||||||
|
LoadTranslations("common.phrases");
|
||||||
RegAdminCmd("sm_hp", Command_Health, ADMFLAG_GENERIC, "sm_hp <#userid|name> <value>");
|
RegAdminCmd("sm_hp", Command_Health, ADMFLAG_GENERIC, "sm_hp <#userid|name> <value>");
|
||||||
RegAdminCmd("sm_kevlar", Command_Kevlar, ADMFLAG_GENERIC, "sm_kevlar <#userid|name> <value>");
|
RegAdminCmd("sm_kevlar", Command_Kevlar, ADMFLAG_GENERIC, "sm_kevlar <#userid|name> <value>");
|
||||||
RegAdminCmd("sm_weapon", Command_Weapon, ADMFLAG_GENERIC, "sm_weapon <#userid|name> <name> [clip] [ammo]");
|
RegAdminCmd("sm_weapon", Command_Weapon, ADMFLAG_GENERIC, "sm_weapon <#userid|name> <name> [clip] [ammo]");
|
||||||
|
@ -37,7 +37,7 @@ public Plugin myinfo =
|
|||||||
name = "PointServerCommandFilter",
|
name = "PointServerCommandFilter",
|
||||||
author = "BotoX",
|
author = "BotoX",
|
||||||
description = "Filters point_servercommand->Command() using user-defined rules to restrict maps.",
|
description = "Filters point_servercommand->Command() using user-defined rules to restrict maps.",
|
||||||
version = "0.1",
|
version = "1.0",
|
||||||
url = ""
|
url = ""
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -55,7 +55,10 @@ public Action PointServerCommandForward(const char[] sOrigCommand)
|
|||||||
|
|
||||||
int Split = SplitString(sCommandRight, " ", sCommandLeft, sizeof(sCommandLeft));
|
int Split = SplitString(sCommandRight, " ", sCommandLeft, sizeof(sCommandLeft));
|
||||||
if(Split == -1)
|
if(Split == -1)
|
||||||
|
{
|
||||||
strcopy(sCommandLeft, sizeof(sCommandLeft), sCommandRight);
|
strcopy(sCommandLeft, sizeof(sCommandLeft), sCommandRight);
|
||||||
|
Split = 0;
|
||||||
|
}
|
||||||
TrimString(sCommandLeft);
|
TrimString(sCommandLeft);
|
||||||
strcopy(sCommandRight, sizeof(sCommandRight), sCommandRight[Split]);
|
strcopy(sCommandRight, sizeof(sCommandRight), sCommandRight[Split]);
|
||||||
|
|
||||||
@ -88,6 +91,7 @@ Action MatchRuleList(ArrayList RuleList, const char[] sOrigCommand, const char[]
|
|||||||
StringMap Rule = RuleList.Get(r);
|
StringMap Rule = RuleList.Get(r);
|
||||||
int Mode;
|
int Mode;
|
||||||
Rule.GetValue("mode", Mode);
|
Rule.GetValue("mode", Mode);
|
||||||
|
bool IsNumeric = IsCharNumeric(sCommandRight[0]) || (sCommandRight[0] == '-' && IsCharNumeric(sCommandRight[1]));
|
||||||
|
|
||||||
if(Mode & MODE_ALL)
|
if(Mode & MODE_ALL)
|
||||||
State |= STATE_ALLOW;
|
State |= STATE_ALLOW;
|
||||||
@ -105,7 +109,7 @@ Action MatchRuleList(ArrayList RuleList, const char[] sOrigCommand, const char[]
|
|||||||
Rule.GetValue("value", WantValue);
|
Rule.GetValue("value", WantValue);
|
||||||
IsValue = StringToInt(sCommandRight);
|
IsValue = StringToInt(sCommandRight);
|
||||||
|
|
||||||
if(IsCharNumeric(sCommandRight[0]) && WantValue == IsValue)
|
if(IsNumeric && WantValue == IsValue)
|
||||||
State |= STATE_ALLOW;
|
State |= STATE_ALLOW;
|
||||||
}
|
}
|
||||||
else if(Mode & MODE_FLOATVALUE)
|
else if(Mode & MODE_FLOATVALUE)
|
||||||
@ -115,7 +119,7 @@ Action MatchRuleList(ArrayList RuleList, const char[] sOrigCommand, const char[]
|
|||||||
Rule.GetValue("value", WantValue);
|
Rule.GetValue("value", WantValue);
|
||||||
IsValue = StringToFloat(sCommandRight);
|
IsValue = StringToFloat(sCommandRight);
|
||||||
|
|
||||||
if(IsCharNumeric(sCommandRight[0]) && FloatCompare(IsValue, WantValue) == 0)
|
if(IsNumeric && FloatCompare(IsValue, WantValue) == 0)
|
||||||
State |= STATE_ALLOW;
|
State |= STATE_ALLOW;
|
||||||
}
|
}
|
||||||
else if(Mode & MODE_REGEXVALUE)
|
else if(Mode & MODE_REGEXVALUE)
|
||||||
@ -129,7 +133,6 @@ Action MatchRuleList(ArrayList RuleList, const char[] sOrigCommand, const char[]
|
|||||||
float MinValue;
|
float MinValue;
|
||||||
float MaxValue;
|
float MaxValue;
|
||||||
float IsValue = StringToFloat(sCommandRight);
|
float IsValue = StringToFloat(sCommandRight);
|
||||||
bool IsNumeric = IsCharNumeric(sCommandRight[0]);
|
|
||||||
if(!IsNumeric && (Mode & MODE_MIN || Mode & MODE_MAX))
|
if(!IsNumeric && (Mode & MODE_MIN || Mode & MODE_MAX))
|
||||||
continue; // Ignore non-numerical
|
continue; // Ignore non-numerical
|
||||||
|
|
||||||
|
@ -679,13 +679,14 @@ public Handler_AdminMapSelectMenu(Handle:menu, MenuAction:action, param1, param2
|
|||||||
{
|
{
|
||||||
case MenuAction_Select:
|
case MenuAction_Select:
|
||||||
{
|
{
|
||||||
decl String:map[PLATFORM_MAX_PATH], String:name[MAX_NAME_LENGTH];
|
decl String:map[PLATFORM_MAX_PATH];
|
||||||
GetMenuItem(menu, param2, map, sizeof(map));
|
GetMenuItem(menu, param2, map, sizeof(map));
|
||||||
|
|
||||||
new NominateResult:result = NominateMap(map, false, 0);
|
new NominateResult:result = NominateMap(map, true, 0);
|
||||||
|
|
||||||
if (result == Nominate_AlreadyInVote)
|
if (result > Nominate_Replaced)
|
||||||
{
|
{
|
||||||
|
/* We assume already in vote is the casue because the maplist does a Map Validity check and we forced, so it can't be full */
|
||||||
PrintToChat(param1, "[NE] %t", "Map Already In Vote", map);
|
PrintToChat(param1, "[NE] %t", "Map Already In Vote", map);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -695,7 +696,7 @@ public Handler_AdminMapSelectMenu(Handle:menu, MenuAction:action, param1, param2
|
|||||||
PrintToChat(param1, "[NE] %t", "Map Inserted", map);
|
PrintToChat(param1, "[NE] %t", "Map Inserted", map);
|
||||||
LogAction(param1, -1, "\"%L\" inserted map \"%s\".", param1, map);
|
LogAction(param1, -1, "\"%L\" inserted map \"%s\".", param1, map);
|
||||||
|
|
||||||
PrintToChatAll("[NE] %N has inserted %s into nominations", name, map);
|
PrintToChatAll("[NE] %N has inserted %s into nominations", param1, map);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user