PHP Code:
int UTIL_GetTeam(edict_t *pEntity)
{
union
{
short s;
char c[2];
} t;
char *p = g_engfuncs.pfnInfoKeyValue(g_engfuncs.pfnGetInfoKeyBuffer(pEntity), "model");
t.c[0] = p[0];
t.c[1] = p[1];
if (t.s == (('e' << 8) + 't') || // TError
t.s == (('e' << 8) + 'l') || // LEet
t.s == (('r' << 8) + 'a') || // ARctic
t.s == (('u' << 8) + 'g') || // GUerilla
t.s == (('i' << 8) + 'm')) // MIlitia
return TEAM_TERRORIST;
return TEAM_CT; // URban, GSg9, SAs, GIgn, VIp, SPetsnaz
}