Raised This Month: $52 Target: $400
 13% 

Plugin for [Tag] Detection


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
5000MangledCows
Senior Member
Join Date: Jul 2014
Location: 404 LOCATION NOT FOUND
Old 12-23-2014 , 17:10   Plugin for [Tag] Detection
Reply With Quote #1

I was looking for a plugin that allows people to get bonuses or some access to commands if wearing a certain tag on their name, not like the ADMNFLAG_SLAY tags, but when people join and are part of some clan or group with the abbreviation [*their group's acronym*] on their name. If this has already been done please tell me so.

Last edited by 5000MangledCows; 12-23-2014 at 17:11.
5000MangledCows is offline
The1Speck
SourceMod Donor
Join Date: Oct 2014
Location: USA
Old 12-23-2014 , 19:01   Re: Plugin for [Tag] Detection
Reply With Quote #2

Not sure if it has been done before, but it is completely possible through the CS_GetClientClanTag() function, if the game it's running on supports the <cstrike> library.
__________________

Add me on Steam for personal inquiries or direct assistance.
The1Speck is offline
5000MangledCows
Senior Member
Join Date: Jul 2014
Location: 404 LOCATION NOT FOUND
Old 12-24-2014 , 09:13   Re: Plugin for [Tag] Detection
Reply With Quote #3

I was thinking of using this for TF2, and I'm not a plugin writer, so I don't know if it is in the cstrike library.
5000MangledCows is offline
friagram
Veteran Member
Join Date: Sep 2012
Location: Silicon Valley
Old 12-24-2014 , 14:07   Re: Plugin for [Tag] Detection
Reply With Quote #4

Psychonic has a plugin that will give admin flags to people who are in certain steam groups, that might be something you could use.
__________________
Profile - Steam Group - Plugins - Blog - Donate
Add me on steam if you are seeking sp/map/model commissions.
friagram is offline
minimoney1
SourceMod Donor
Join Date: Dec 2010
Old 12-25-2014 , 02:58   Re: Plugin for [Tag] Detection
Reply With Quote #5

PHP Code:
#pragma semicolon 1

#include <sourcemod>
#include <cstrike>

#define TAG_SIZE 64

new Handle:enabled INVALID_HANDLE;
new 
Handle:castSens INVALID_HANDLE;
new 
Handle:flagBit INVALID_HANDLE;
new 
String:tags[32][TAG_SIZE];

public 
Plugin:myinfo 
{
    
name "ClanTag Detection",
    
author "Mini",
    
description "Sets admin flags based on clantag",
    
version "1.0",
    
url "http://sourcemod.net"
};

public 
OnPluginStart()
{
    
enabled CreateConVar("clantagdetect_enabled""1""Enabled");
    
HookConVarChange(CreateConVar("clantagdetect_tag""myTag,myTagVIP""The clan tags to search for seperated with a comma (\",\")"), TagListChange);
    
castSens CreateConVar("clantagdetect_case""1""Should the search be case sensitive?");
    
flagBit CreateConVar("clantagdetect_flag""ar""What admin flags to add?");

    
AutoExecConfig(true"clantag_detect");
}

public 
TagListChange(Handle:conVar, const String:oldValue[], const String:newValue[])
{
    
ExplodeString(newValue","tagssizeof(tags), sizeof(tags[]));
}

public 
OnClientPostAdminFilter(client)
{
    if (
GetConVarBool(enabled))
    {
        new 
String:tag[TAG_SIZE];
        
CS_GetClientClanTag(clienttagsizeof(tag));
        new 
bool:bCaseSens GetConVarBool(castSens);
        new 
String:flagString[TAG_SIZE];
        
GetConVarString(flagBitflagStringsizeof(flagString));
        new 
flags ReadFlagString(flagString);
        for (new 
1sizeof(tags); i++)
        {
            if (
strcmp(tagtags[i], bCaseSens) == 0)
            {
                
SetUserFlagBits(clientGetUserFlagBits(client) | flags);
                
PrintToChat(client"Welcome! You have been given extra privilages because of your clan tag!");
            }
        }
    }

I quickly made this. It only checks for tags in the clantag, but it should work. It did compile for me but I didn't test it, so there may be some bugs that I'm unaware of.
__________________
Need help? PM me or add me on Steam.
My Steam




Quote:
Originally Posted by Rp.KryptoNite View Post
For some reason his Plugin never worked for me ,
@credits were added
im not stealing any plugins dude its my THING

Last edited by minimoney1; 12-25-2014 at 02:59.
minimoney1 is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 12-25-2014 , 03:59   Re: Plugin for [Tag] Detection
Reply With Quote #6

cs_*clienttag require cstrike extension run in server, so not work for TF2
__________________
Do not Private Message @me
Bacardi is offline
5000MangledCows
Senior Member
Join Date: Jul 2014
Location: 404 LOCATION NOT FOUND
Old 12-28-2014 , 20:48   Re: Plugin for [Tag] Detection
Reply With Quote #7

Quote:
Originally Posted by friagram View Post
Psychonic has a plugin that will give admin flags to people who are in certain steam groups, that might be something you could use.
What is this plugin by him, because I could only find one for CSS that gives them the tag, but not the flags?
Found it, it works great, but it would be easier to also have one for clan tags in games like TF2 that don't have the extension.

Minimoney's snippet doesn't work, because as Bacardi explained, TF2 can't use the cstrike extension properly. I still need a version of this plugin.

Last edited by 5000MangledCows; 12-28-2014 at 21:23. Reason: Found the admin detection plugin.
5000MangledCows is offline
Mitchell
~lick~
Join Date: Mar 2010
Old 12-30-2014 , 10:17   Re: Plugin for [Tag] Detection
Reply With Quote #8

I've took mini's script and change GetClanTag to the player's name
__________________

Last edited by Mitchell; 12-30-2014 at 22:51.
Mitchell is offline
5000MangledCows
Senior Member
Join Date: Jul 2014
Location: 404 LOCATION NOT FOUND
Old 12-30-2014 , 21:09   Re: Plugin for [Tag] Detection
Reply With Quote #9

Quote:
Originally Posted by Mitchell View Post
I've took mini's script and change GetClanTag to the player's name
Great! I tested it out, only problem is that when you join it repeats the "Welcome, you have been given special privileges!" message about 10 times in chat.
5000MangledCows is offline
Potato Uno
Veteran Member
Join Date: Jan 2014
Location: Atlanta, Georgia
Old 12-30-2014 , 21:19   Re: Plugin for [Tag] Detection
Reply With Quote #10

You can try using a timer that will turn on a flag (a boolean) once the message is printed, and as long as that flag is on, the message isn't printed again. Then after N number of seconds (probably 0.2 or 0.5 depending how quick the spam is printed) just disable the flag again. I had a similar issue with that here.

(Only issue I see with that is when two people join with the same tag almost simultaneously - maybe someone else can come up with a better fix.)
Potato Uno is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 16:36.


Powered by vBulletin®
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Theme made by Freecode