First off, that's not a string, it's a function. You're getting tag mismatch because the second parameter is the team, which is tagged with CsTeams. 2 is an untagged integer, so you either have to use CsTeams:2 or the correct value (CS_TEAM_CT?). The third param is also wrong, it's for setting the player's model and it's tagged with CsInternalModel.
Code:
CS_DONTCHANGE
CS_CT_URBAN
CS_T_TERROR
CS_T_LEET
CS_T_ARCTIC
CS_CT_GSG9
CS_CT_GIGN
CS_CT_SAS
CS_T_GUERILLA
CS_CT_VIP
PHP Code:
cs_set_user_team(id, CS_TEAM_CT, my_func(id))
// doesn't really need to be public for this
CsInternalModel:my_func(id)
{
return CS_T_TERROR
}