View Single Post
DarkDeviL
SourceMod Moderator
Join Date: Apr 2012
Old 02-27-2019 , 10:52   Re: I need help with my plugin
Reply With Quote #4

For your purpose, it sounds like you want the clan tag to be 1234, so you always have the option to easily find the id, and do e.g. "sm_kick #1234 bye", etc.

OnClientPostAdminCheck isn't being re-called if people are changing their clan tags in the middle of the game, so I'd say this place may not be the best place for this purpose, at least not alone.

You can try adding something to block the clantag change, e.g.:

PHP Code:
public Action OnClientCommandKeyValues(int clientKeyValues kv)
{
    
char kvKey[256];

    if (!
kv.GetSectionName(kvKeysizeof(kvKey))
        return 
Plugin_Continue;

    if (
StrEqual(kvKey"ClanTagChanged")) {
        return 
Plugin_Handled;
    }

    return 
Plugin_Continue;

and then add your custom clantag just like you do in OnClientPostAdminCheck as well.

Or simply change it back above within the if returning Plugin_Handled, and eventually add further things such as admin exceptions, etc. if necessary.
__________________
Mostly known as "DarkDeviL".

Dropbox FastDL: Public folder will no longer work after March 15, 2017!
For more info, see the [SRCDS Thread], or the [HLDS Thread].
DarkDeviL is offline