View Single Post
minimoney1
SourceMod Donor
Join Date: Dec 2010
Old 12-25-2014 , 01: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 01:59.
minimoney1 is offline