Permalink
Browse files

Add TEAM checking

WIP #2
  • Loading branch information...
Hexer10 committed Jan 7, 2018
1 parent bed8da9 commit c9f2f1f3cc568adf6bf8ea58644993cc3631b5f7
Showing with 33 additions and 3 deletions.
  1. +7 −1 addons/sourcemod/configs/hextags.cfg
  2. +26 −2 addons/sourcemod/scripting/hextags.sp
@@ -30,7 +30,8 @@
// 2. ADMIN GROUP --> It is selected only the first client group. Is needed a '@' before the group name.
// 3. ADMIN FLAGS --> They are selected starting from the last (ztsrqponmlkjihgfedcba). If a client has both 'a' and 'b' flags, the tags of 'b' will be selected.
// 4. (TOTAL)ONLINE TIME --> This need mostactive(https://forums.alliedmods.net/showthread.php?p=1751973) to work. Required time in seconds to get the tags. The '#' before the time is needed.
// 5. Default --> All players have these tags. This can be removed.
// 5. TEAM --> Complete/Partial team name.
// 6. Default --> All players have these tags. This can be removed.
//
// Params (only works from chat tags/colors):
// 1. {time} --> This will be replaced with time, format: HH:MM
@@ -67,6 +68,11 @@
// "ChatColor" "{blue}" //The chat color
// "NameColor" "{grey}" //The name color
// }
// "Terrorist" //T team
// {
// "ScoreTag" "[Terrorist]" //The scoreboard-tag
// "ChatTag" "{red}[Terrorist]" //The chat-tag
// }
//
//
// Start editing down this line!
@@ -240,12 +240,12 @@ void LoadTags(int client)
}
}
bool bReturn;
//Start total play-time checking
if (bMostActive)
{
int iOldTime;
bool bReturn;
if (!kv.GotoFirstSubKey())
return;
do
@@ -274,6 +274,30 @@ void LoadTags(int client)
if (bReturn)
return;
}
//Start team checking
if (!kv.GotoFirstSubKey())
return;
do
{
char sTeam[16];
kv.GetSectionName(sTeam, sizeof(sTeam));
int iTeam = FindTeamByName(sTeam);
if (iTeam < 0)
continue;
if (iTeam == GetClientTeam(client))
{
GetTags(client);
bReturn = true;
}
}
while (kv.GotoNextKey());
if (bReturn)
return;
//Check for 'All' entry
if (kv.JumpToKey("Default"))
GetTags(client);

0 comments on commit c9f2f1f

Please sign in to comment.