Skip to content

Commit

Permalink
Fix #62
Browse files Browse the repository at this point in the history
  • Loading branch information
Hexer10 committed Aug 5, 2020
1 parent 0902edd commit f7f4676
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion addons/sourcemod/scripting/hextags.sp
Original file line number Diff line number Diff line change
Expand Up @@ -884,9 +884,12 @@ bool CheckSelector(const char[] selector, int client)
AdminId admin = GetUserAdmin(client);
if (admin != INVALID_ADMIN_ID)
{

Debug_Print("Found as admin! %N", client);
/* CHECK ADMIN GROUP */
if (selector[0] == '@')
{
Debug_Print("Check group: %s",selector);
static char sGroup[32];

GroupId group = admin.GetGroup(0, sGroup, sizeof(sGroup));
Expand All @@ -902,8 +905,9 @@ bool CheckSelector(const char[] selector, int client)
/* CHECK ADMIN FLAGS (1)*/
if (strlen(selector) == 1)
{
Debug_Print("Check for flag (1char): ",selector);
AdminFlag flag;
if (FindFlagByChar(selector[0], flag))
if (FindFlagByChar(CharToLower(selector[0]), flag))
{
if (admin.HasFlag(flag))
{
Expand All @@ -915,6 +919,7 @@ bool CheckSelector(const char[] selector, int client)
/* CHECK ADMIN FLAGS (2)*/
if (selector[0] == '&')
{
Debug_Print("Check group: %s",selector);
for (int i = 1; i < strlen(selector); i++)
{
AdminFlag flag;
Expand All @@ -927,6 +932,7 @@ bool CheckSelector(const char[] selector, int client)
}
}
}
Debug_Print("Unmatched admin: %s", selector);
}

/* CHECK PLAYER TEAM */
Expand Down Expand Up @@ -1309,3 +1315,20 @@ public int Native_RemoveCustomSelector(Handle plugin, int numParams)
{
return pfCustomSelector.RemoveFunction(plugin, GetNativeFunction(1));
}


/* From smlib */
stock void String_ToLower(const char[] input, char[] output, int size)
{
size--;

int x=0;
while (input[x] != '\0' && x < size) {

output[x] = CharToLower(input[x]);

x++;
}

output[x] = '\0';
}

0 comments on commit f7f4676

Please sign in to comment.