Of course, the name is up for contention.
The win32 offset is 125. This is how it works (left side is condition, right side is value of offset):
Code:
Terrorist, not switched teams: 255
Terrorist, switched to CT: 511
Terrorist, switched to SPEC: 256
CT, not switched teams: 255
CT, switched to Terrorist: 511
CT, switched to SPEC: 256
SPEC, not switched teams: 0
SPEC, switched to Terrorist: 256
SPEC, switched to CT: 256
I don't quite understand why the values change based on what team you were on and what team you are on now. Since I don't think the game actually uses that for anything relevant, this is how I'd do it (except, in Pawn):
Code:
public cs_get_user_can_changeteam(id)
{
return get_pdata_int(id,125) < 256;
}
public cs_set_user_can_changeteam(id,value)
{
return set_pdata_int(id,125,value ? 255 : 256);
}
I tested this and it works correctly, with no side-effects. It should be noted, though, the a user can change team no matter what if they are alive.
__________________