This is my code
Code:
edict_t *pPlayer = INDEXENT(id);
int model = 2;
*((int *)pPlayer->pvPrivateData + OFFSET_TEAM) = team;
if (model != 0)
*((int *)pPlayer->pvPrivateData + OFFSET_INTERNALMODEL) = model;
MDLL_ClientUserInfoChanged(pPlayer, GETINFOKEYBUFFER(pPlayer));
char teaminfo[32];
switch (team) {
case TEAM_UNASSIGNED:
sprintf(teaminfo, "UNASSIGNED");
break;
case TEAM_T:
sprintf(teaminfo, "TERRORIST");
break;
case TEAM_CT:
sprintf(teaminfo, "CT");
break;
case TEAM_SPECTATOR:
sprintf(teaminfo, "SPECTATOR");
break;
default:
int team_nr = (int)team;
sprintf(teaminfo, "TEAM_%i", team_nr);
}
MESSAGE_BEGIN(MSG_ALL, GET_USER_MSG_ID(PLID, "TeamInfo", NULL));
WRITE_BYTE(id);
WRITE_STRING(teaminfo);
MESSAGE_END();
Does not change team to player
Inside the game, the player is opened the teams selection menu