Quote:
Originally Posted by psychonic
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", sClanID, sizeof(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", sClanID, sizeof(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?