Raised This Month: $ Target: $400
 0% 

[INC] CS:S Clan Tags


Post New Thread Reply   
 
Thread Tools Display Modes
D_ONE
Member
Join Date: Oct 2010
Old 02-17-2011 , 04:24   Re: [INC] CS:S Clan Tags
Reply With Quote #11

Thread needs a deserving bump. Planning to use this on the server for the 20v20 community matches we play. Its always a bitch getting all 20 players to wear the community tag, so much so that Id given up. This'll make it easy. And our VIP/Assassination mod coder upgraded the mod with this code so it can better display who the VIP is (also a suggestion for kyle's public version). Nice one!
__________________
Fun and active UK based gaming community - www.viaclan.com

Last edited by D_ONE; 02-17-2011 at 04:28.
D_ONE is offline
GoD-Tony
Veteran Member
Join Date: Jul 2005
Old 03-15-2011 , 08:10   Re: [INC] CS:S Clan Tags
Reply With Quote #12

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 #13

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 #14

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
psychonic

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

welp
psychonic is offline
Snake60
Senior Member
Join Date: Jul 2008
Location: Russia, Pskov
Old 03-17-2011 , 09:08   Re: [INC] CS:S Clan Tags
Reply With Quote #16

+1
Very need it in my new version of WarriorMod plugin.
Thank you very much, psychonic
__________________
Snake60 is offline
Send a message via ICQ to Snake60 Send a message via MSN to Snake60 Send a message via Skype™ to Snake60
zeroibis
Veteran Member
Join Date: Jun 2007
Old 05-25-2011 , 01:52   Re: [INC] CS:S Clan Tags
Reply With Quote #17

To make sure that I understand this right it changes the clan tag as shown in the special clan section of the scoreboard?
__________________
zeroibis is offline
psychonic

BAFFLED
Join Date: May 2008
Old 05-25-2011 , 06:52   Re: [INC] CS:S Clan Tags
Reply With Quote #18

Quote:
Originally Posted by zeroibis View Post
To make sure that I understand this right it changes the clan tag as shown in the special clan section of the scoreboard?
That is correct.
psychonic is offline
zeroibis
Veteran Member
Join Date: Jun 2007
Old 05-25-2011 , 15:18   Re: [INC] CS:S Clan Tags
Reply With Quote #19

Oh, cool I will be testing out some stuff with this!
__________________
zeroibis is offline
Schmarotzer
Junior Member
Join Date: Oct 2010
Old 06-05-2011 , 12:19   Re: [INC] CS:S Clan Tags
Reply With Quote #20

psychonic, thanks! it's cool
Schmarotzer 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 13:23.


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