Raised This Month: $ Target: $400
 0% 

[INC] CS:S Clan Tags


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
GoD-Tony
Veteran Member
Join Date: Jul 2005
Old 03-15-2011 , 08:10   Re: [INC] CS:S Clan Tags
Reply With Quote #1

Quote:
Originally Posted by psychonic View Post
You can look up a client's cl_clanid on join, and then look in OnClientSettingsChanged to see if it has changed to know if the clan tag has actually changed.
I was playing around with clan tags the other day (ended up making this for fun), and I noticed that it's not possible to force a clan tag using this method.

Take this code for example:
PHP Code:
new g_iClanIDs[MAXPLAYERS+1];

public 
OnClientPutInServer(client)
{
    
// Store their current clanid.
    
decl String:sClanID[32];
    
GetClientInfo(client"cl_clanid"sClanIDsizeof(sClanID));
    
g_iClanIDs[client] = StringToInt(sClanID);
    
    
// Change their clan tag.
    
SetClientClanTag(client"SM");
}

public 
OnClientSettingsChanged(client)
{
    if (
IsClientInGame(client))
    {
        
// Check if they changed their clanid.
        
decl String:sClanID[32];
        
GetClientInfo(client"cl_clanid"sClanIDsizeof(sClanID));
        
        if (
g_iClanIDs[client] != StringToInt(sClanID))
        {
            
// Save their new clanid for checking again later.
            
g_iClanIDs[client] = StringToInt(sClanID);
            
            
// Change their clan tag back.
            
SetClientClanTag(client"SM");
        }
    }

If a client changes their clanid to the same id, then it will pass all checks and they will be using their own tag. Using the above code, a client could type cl_clanid 0 twice into console to remove their tag.

What would be the solution to this?
GoD-Tony is offline
psychonic

BAFFLED
Join Date: May 2008
Old 03-15-2011 , 08:18   Re: [INC] CS:S Clan Tags
Reply With Quote #2

Quote:
Originally Posted by GoD-Tony View Post
I was playing around with clan tags the other day (ended up making this for fun), and I noticed that it's not possible to force a clan tag using this method.

Take this code for example:
PHP Code:
new g_iClanIDs[MAXPLAYERS+1];

public 
OnClientPutInServer(client)
{
    
// Store their current clanid.
    
decl String:sClanID[32];
    
GetClientInfo(client"cl_clanid"sClanIDsizeof(sClanID));
    
g_iClanIDs[client] = StringToInt(sClanID);
    
    
// Change their clan tag.
    
SetClientClanTag(client"SM");
}

public 
OnClientSettingsChanged(client)
{
    if (
IsClientInGame(client))
    {
        
// Check if they changed their clanid.
        
decl String:sClanID[32];
        
GetClientInfo(client"cl_clanid"sClanIDsizeof(sClanID));
        
        if (
g_iClanIDs[client] != StringToInt(sClanID))
        {
            
// Save their new clanid for checking again later.
            
g_iClanIDs[client] = StringToInt(sClanID);
            
            
// Change their clan tag back.
            
SetClientClanTag(client"SM");
        }
    }

If a client changes their clanid to the same id, then it will pass all checks and they will be using their own tag. Using the above code, a client could type cl_clanid 0 twice into console to remove their tag.

What would be the solution to this?
In addition to checking for clanid changes, you could check for tag changes as well (or in place of clanid change check).
psychonic is offline
GoD-Tony
Veteran Member
Join Date: Jul 2005
Old 03-15-2011 , 08:28   Re: [INC] CS:S Clan Tags
Reply With Quote #3

Quote:
Originally Posted by psychonic View Post
In addition to checking for clanid changes, you could check for tag changes as well (or in place of clanid change check).
I just tried that now and it didn't work either. It seems like when cl_clanid is set to the same value, OnClientSettingsChanged isn't forwarded and their tag will still change.

Last edited by GoD-Tony; 03-15-2011 at 08:35.
GoD-Tony is offline
Reply



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 18:10.


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