player_ext_shd.lua
AccessorFunc(plymeta, "role", "Role", FORCE_NUMBER)
-- Role access
function plymeta:GetTraitor() return self:GetRole() == ROLE_TRAITOR end
function plymeta:GetDetective() return self:GetRole() == ROLE_DETECTIVE end
plymeta.IsTraitor = plymeta.GetTraitor
plymeta.IsDetective = plymeta.GetDetective
That "AccessorFunc" generates SetRole and GetRole functions. The underlying field is ply.role, which is just a number.