View Single Post
shavit
AlliedModders Donor
Join Date: Dec 2011
Location: Israel
Old 04-22-2018 , 00:52   Re: [CSGO] Get client original clan tag
Reply With Quote #6

very very very pseudo code

Code:
#include <sourcemod>
#include <cstrike>

char gS_OriginalClan[MAXPLAYERS+1][32];
bool gB_SMChange = false;

public void OnPluginStart()
{
	< hook clan tag changes here > (OnClanChanged);
	< alternatively, query cl_clanid in OnClientSettingsChanged and compare to the previous value >
}

public void OnClientPutInServer(int client)
{
	CS_GetClientClanTag(client, gS_OriginalClan[client], 32);
	SetClanTag(client, ":D");
}

public void OnClanChanged(< prototype >)
{
	if(!gB_SMChange)
	{
		int client = < get client index from userid >;
		< copy clan tag to gS_OriginalClan[client] >
		
		< optional: run any action you want to run in-case you want to do something when people manually change their clan tag >
	}

	gB_SMChange = false;
}

void SetClanTag(int client, const char[] tag)
{
	gB_SMChange = true;
	CS_GetClientClanTag(client, tag);
}
fill in the missing parts, then it should change the players' clan tags to ":D" while storing the original one in gS_OriginalClan[client]
__________________
retired

Last edited by shavit; 04-22-2018 at 00:53.
shavit is offline