#define MaskEnt(%0) (1<<((%0) & 31))
//for player
public set_group_visiblecos(pId, bool:visible)
{
set_entvar(pId, var_groupinfo, visible == true ? MaskEnt(1) | MaskEnt(2) : ~MaskEnt(1) | MaskEnt(2));
}
public client_putinserver(pId)
{
set_pev(pId, pev_groupinfo, pev(pId, pev_groupinfo) | (MaskEnt(1) | MaskEnt(2)));
}
//for entity
{
//Set GroupInfo
set_entvar(ent, var_groupinfo, get_entvar(ent, var_groupinfo) & ~MaskEnt(1));
//Remove_GroupInfo
set_entvar(ent, var_groupinfo, get_entvar(ent, var_groupinfo) | MaskEnt(1));
}