SetClass

Raise

This Event is raised when a Player's Role Type is set.

Exceptions: SCP049 revives a Player, Player activated overwatch and Role Type changes to Spectator

Usage

You can use this Event to change the Spawn behavior of a Role

When you change the RoleType won't the other Attributes change as well so the Player will still get the items/ spawn position of the first selected role.

SetClassEvent

public class SetClassEvent : PlayerInteractEvent
{
    public SetClassEvent(SynapsePlayer player, RoleType role, CharacterClassManager.SpawnReason reason) : base(player,
        true)
    {
        Role = role;
        SpawnReason = reason;
    }
    
    public RoleType Role { get; set; }
    
    public CharacterClassManager.SpawnReason SpawnReason { get; }

    public List<uint> Items { get; set; } = new();

    public List<SynapseItem> EscapeItems { get; set; } = new();
    
    public Vector3 Position { get; set; } = Vector3.zero;

    public PlayerMovementSync.PlayerRotation Rotation { get; set; }

    public Dictionary<AmmoType, ushort> Ammo { get; set; } = new();
}

Last updated