Table of Contents

Class PlayerSpawnData

Namespace
SampSharp.Entities.SAMP
Assembly
SampSharp.OpenMp.Entities.dll

Represents the spawn configuration data for a player class.

public record PlayerSpawnData : IEquatable<PlayerSpawnData>
Inheritance
PlayerSpawnData
Implements
Inherited Members

Constructors

PlayerSpawnData()

Initializes a new instance of the PlayerSpawnData class with default values.

public PlayerSpawnData()

PlayerSpawnData(PlayerSpawnData)

protected PlayerSpawnData(PlayerSpawnData original)

Parameters

original PlayerSpawnData

PlayerSpawnData(int, int, Vector3, float, PlayerWeaponSlots)

Initializes a new instance of the PlayerSpawnData class with the specified spawn configuration.

public PlayerSpawnData(int team, int skin, Vector3 location, float angle, PlayerWeaponSlots weapons)

Parameters

team int

The team ID.

skin int

The skin model ID.

location Vector3

The spawn location coordinates.

angle float

The spawn angle in degrees.

weapons PlayerWeaponSlots

The weapon slots assigned at spawn.

Properties

Angle

Gets or sets the spawn angle in degrees.

public float Angle { get; set; }

Property Value

float

EqualityContract

protected virtual Type EqualityContract { get; }

Property Value

Type

Location

Gets or sets the spawn location coordinates.

public Vector3 Location { get; set; }

Property Value

Vector3

Skin

Gets or sets the skin model ID for the player spawn.

public int Skin { get; set; }

Property Value

int

Team

Gets or sets the team ID for the player spawn.

public int Team { get; set; }

Property Value

int

Weapons

Gets or sets the weapon slots assigned at spawn.

public PlayerWeaponSlots Weapons { get; set; }

Property Value

PlayerWeaponSlots

Methods

Equals(PlayerSpawnData?)

public virtual bool Equals(PlayerSpawnData? other)

Parameters

other PlayerSpawnData

Returns

bool

Equals(object?)

public override bool Equals(object? obj)

Parameters

obj object

Returns

bool

FromOmpData(ref PlayerClass)

Creates a PlayerSpawnData instance from open.mp player class data.

public static PlayerSpawnData FromOmpData(ref PlayerClass playerClass)

Parameters

playerClass PlayerClass

The open.mp player class data.

Returns

PlayerSpawnData

A PlayerSpawnData instance containing the spawn configuration.

GetHashCode()

public override int GetHashCode()

Returns

int

PrintMembers(StringBuilder)

protected virtual bool PrintMembers(StringBuilder builder)

Parameters

builder StringBuilder

Returns

bool

ToOmpData()

Converts this spawn data to open.mp player class data.

public PlayerClass ToOmpData()

Returns

PlayerClass

A PlayerClass instance containing the open.mp representation of the spawn data.

ToString()

public override string ToString()

Returns

string

Operators

operator ==(PlayerSpawnData?, PlayerSpawnData?)

public static bool operator ==(PlayerSpawnData? left, PlayerSpawnData? right)

Parameters

left PlayerSpawnData
right PlayerSpawnData

Returns

bool

operator !=(PlayerSpawnData?, PlayerSpawnData?)

public static bool operator !=(PlayerSpawnData? left, PlayerSpawnData? right)

Parameters

left PlayerSpawnData
right PlayerSpawnData

Returns

bool