You can try this, but I have no idea if it will work, so don't judge me.
PHP Code:
#include <amxmodx>
#include <fakemeta>
#if cellbits == 32
#define OFFSET_TEAM 114
#else
#define OFFSET_TEAM 139
#endif
const m_iTeam = 114;
new g_Team[33]
public plugin_init()
{
RegisterHam(Ham_Spawn, "player", "PlayerSpawnPre", 1);
}
public PlayerSpawnPre(id)
{
if(condition)
{
return HAM_SUPERCEDE
g_Team[id] = get_user_team(id)
switch(g_Team[id])
{
case 1:
{
set_pdata_int(id, OFFSET_TEAM, TEAM_T);
}
case 2:
{
set_pdata_int(id, OFFSET_TEAM, TEAM_CT);
}
}
}
return HAM_IGNORED
}
#if AMXX_VERSION_NUM < 190
public client_disconnect(id)
#else
public client_disconnected(id)
#endif
{
g_Team[id] = 0;
}
Edit:
I got the idea from admin_freelook.sma here