Table of Contents

Struct IPlayerPickup

Namespace
SampSharp.OpenMp.Core.Api
Assembly
SampSharp.OpenMp.Core.dll

This type represents a pointer to an unmanaged open.mp IPlayerPickup interface.

[OpenMpApi(new Type[] { typeof(IBasePickup) })]
public readonly struct IPlayerPickup : IEquatable<IPlayerPickup>, IPlayerPickup.IManagedInterface, IBasePickup.IManagedInterface, IExtensible.IManagedInterface, IEntity.IManagedInterface, IIDProvider.IManagedInterface, IUnmanagedInterface
Implements
Inherited Members

Constructors

IPlayerPickup(nint)

Initializes a new instance of the IPlayerPickup struct.

public IPlayerPickup(nint handle)

Parameters

handle nint

A pointer to the unmanaged interface.

Properties

Handle

Gets the handle to the unmanaged interface instance.

public nint Handle { get; }

Property Value

nint

HasValue

Gets a value indicating whether the pointer has a value.

public bool HasValue { get; }

Property Value

bool

Methods

AddExtension<T>(T)

Adds the specified managed extension to this extensible.

public void AddExtension<T>(T extension) where T : Extension

Parameters

extension T

An instance of the extension to add. The extension will be disposed if the extension could not be added to this extensible.

Type Parameters

T

The type of the managed extension.

Remarks

A managed extension can only be added to one extensible.

Exceptions

ArgumentException

Throw when an instance of the extension type was already added to this extensible.

Equals(IPlayerPickup)

public bool Equals(IPlayerPickup other)

Parameters

other IPlayerPickup

Returns

bool

Equals(object?)

public override bool Equals(object? other)

Parameters

other object

Returns

bool

GetExtension(UID)

Gets the extension with the specified id.

public IExtension GetExtension(UID id)

Parameters

id UID

The identifier of the extension type.

Returns

IExtension

The extension or null if the extension could not be found.

GetExtension<T>()

Gets the specified managed extension from this extensible.

public T GetExtension<T>() where T : Extension

Returns

T

An instance of the extension with type T.

Type Parameters

T

The type of the managed extension.

Exceptions

ArgumentException

Thrown if the extension could not be found.

GetHashCode()

public override int GetHashCode()

Returns

int

GetID()

Gets the identifier of this unit.

public int GetID()

Returns

int

The identifier of the unit.

GetLegacyPlayer()

Gets the legacy player associated with this pickup, used for ID mapping in per-player pickups.

public IPlayer GetLegacyPlayer()

Returns

IPlayer

The associated legacy player, or null if not set.

GetModel()

Gets the model ID of the pickup.

public int GetModel()

Returns

int

The model ID of the pickup.

GetPickupType()

Gets the type of the pickup.

public byte GetPickupType()

Returns

byte

The type ID of the pickup.

GetPosition()

Gets the position of this entity.

public Vector3 GetPosition()

Returns

Vector3

The position of this entity.

GetRotation()

Gets the rotation of this entity.

public GTAQuat GetRotation()

Returns

GTAQuat

The rotation of this entity.

GetVirtualWorld()

Gets the virtual world of this entity.

public int GetVirtualWorld()

Returns

int

The virtual world of this entity.

IsPickupHiddenForPlayer(IPlayer)

Checks if the pickup is hidden for the specified player.

public bool IsPickupHiddenForPlayer(IPlayer player)

Parameters

player IPlayer

The player to check for.

Returns

bool

true if the pickup is hidden for the player; otherwise, false.

IsStreamedInForPlayer(IPlayer)

Checks if the pickup is streamed in for the specified player.

public bool IsStreamedInForPlayer(IPlayer player)

Parameters

player IPlayer

The player to check for.

Returns

bool

true if the pickup is streamed in for the player; otherwise, false.

QueryExtension<T>()

Gets the specified unmanaged extension from this extensible.

public T QueryExtension<T>() where T : unmanaged, IExtension.IManagedInterface

Returns

T

The unmanaged extension or null if the extension could not be found.

Type Parameters

T

The type of the unmanaged extension.

RemoveExtension(IExtension)

Removes the specified extension from this extensible.

public void RemoveExtension(IExtension extension)

Parameters

extension IExtension

The extension to remove.

Exceptions

ArgumentException

Thrown if the extension could not be found.

RemoveExtension(UID)

Removes the extension with the specified id from this extensible.

public void RemoveExtension(UID id)

Parameters

id UID

The identifier of the extension.

Exceptions

ArgumentException

Thrown if the extension could not be found.

RemoveExtension<T>(T)

Removes the specified managed extension from this extensible.

public void RemoveExtension<T>(T extension) where T : Extension

Parameters

extension T

The managed extension to remove.

Type Parameters

T

The type of the managed extension.

Exceptions

ArgumentException

Thrown if the extension could not be found.

SetLegacyPlayer(IPlayer)

Sets the legacy player for this pickup, used for ID mapping in per-player pickups.

public void SetLegacyPlayer(IPlayer player)

Parameters

player IPlayer

The player to associate with this pickup, or null.

SetModel(int, bool)

Sets the model ID of the pickup.

public void SetModel(int id, bool update)

Parameters

id int

The model ID to set.

update bool

Whether to update the pickup visually for all players; defaults to true.

SetPickupHiddenForPlayer(IPlayer, bool)

Sets whether the pickup is hidden for the specified player.

public void SetPickupHiddenForPlayer(IPlayer player, bool hidden)

Parameters

player IPlayer

The player to hide or show the pickup for.

hidden bool

true to hide the pickup; false to show it.

SetPosition(Vector3)

Sets the position of this entity.

public void SetPosition(Vector3 position)

Parameters

position Vector3

The position to set.

SetPositionNoUpdate(Vector3)

Sets the position of the pickup without updating the visual representation.

public void SetPositionNoUpdate(Vector3 position)

Parameters

position Vector3

The new position for the pickup.

SetRotation(GTAQuat)

Sets the rotation of this entity.

public void SetRotation(GTAQuat rotation)

Parameters

rotation GTAQuat

The rotation to set.

SetType(byte, bool)

Sets the type of the pickup.

public void SetType(byte type, bool update)

Parameters

type byte

The type ID of the pickup.

update bool

Whether to update the pickup visually for all players; defaults to true.

SetVirtualWorld(int)

Sets the virtual world of this entity.

public void SetVirtualWorld(int vw)

Parameters

vw int

The virtual world to set.

StreamInForPlayer(IPlayer)

Streams the pickup in for the specified player.

public void StreamInForPlayer(IPlayer player)

Parameters

player IPlayer

The player to stream the pickup in for.

StreamOutForPlayer(IPlayer)

Streams the pickup out for the specified player.

public void StreamOutForPlayer(IPlayer player)

Parameters

player IPlayer

The player to stream the pickup out for.

TryGetExtension<T>()

Tries to get the specified managed extension from this extensible.

public T? TryGetExtension<T>() where T : Extension

Returns

T

An instance of the extension with type T or null if no extension with the specified type could be found.

Type Parameters

T

The type of the managed extension.

TryQueryExtension<T>(out T)

Tries to get the specified unmanaged extension from this extensible.

public bool TryQueryExtension<T>(out T extension) where T : unmanaged, IExtension.IManagedInterface

Parameters

extension T

The extension if found, otherwise null.

Returns

bool

true if the extension was found; false otherwise.

Type Parameters

T

The type of the unmanaged extension.

Operators

operator ==(IPlayerPickup, object?)

Determines whether the specified values are equal.

public static bool operator ==(IPlayerPickup lhs, object? rhs)

Parameters

lhs IPlayerPickup

The value on the left side of the operator.

rhs object

The value on the right side of the operator.

Returns

bool

true if the values are equal; otherwise, false.

explicit operator IPlayerPickup(IBasePickup)

Casts the IBasePickup to a IPlayerPickup.

public static explicit operator IPlayerPickup(IBasePickup value)

Parameters

value IBasePickup

The IBasePickup to cast.

Returns

IPlayerPickup

The converted IPlayerPickup.

explicit operator IPlayerPickup(IEntity)

Casts the IEntity to a IPlayerPickup.

public static explicit operator IPlayerPickup(IEntity value)

Parameters

value IEntity

The IEntity to cast.

Returns

IPlayerPickup

The converted IPlayerPickup.

explicit operator IPlayerPickup(IExtensible)

Casts the IExtensible to a IPlayerPickup.

public static explicit operator IPlayerPickup(IExtensible value)

Parameters

value IExtensible

The IExtensible to cast.

Returns

IPlayerPickup

The converted IPlayerPickup.

explicit operator IPlayerPickup(IIDProvider)

Casts the IIDProvider to a IPlayerPickup.

public static explicit operator IPlayerPickup(IIDProvider value)

Parameters

value IIDProvider

The IIDProvider to cast.

Returns

IPlayerPickup

The converted IPlayerPickup.

explicit operator IBasePickup(IPlayerPickup)

Casts the IPlayerPickup to a IBasePickup.

public static explicit operator IBasePickup(IPlayerPickup value)

Parameters

value IPlayerPickup

The IPlayerPickup to cast.

Returns

IBasePickup

The converted IBasePickup.

explicit operator IEntity(IPlayerPickup)

Casts the IPlayerPickup to a IEntity.

public static explicit operator IEntity(IPlayerPickup value)

Parameters

value IPlayerPickup

The IPlayerPickup to cast.

Returns

IEntity

The converted IEntity.

explicit operator IExtensible(IPlayerPickup)

Casts the IPlayerPickup to a IExtensible.

public static explicit operator IExtensible(IPlayerPickup value)

Parameters

value IPlayerPickup

The IPlayerPickup to cast.

Returns

IExtensible

The converted IExtensible.

explicit operator IIDProvider(IPlayerPickup)

Casts the IPlayerPickup to a IIDProvider.

public static explicit operator IIDProvider(IPlayerPickup value)

Parameters

value IPlayerPickup

The IPlayerPickup to cast.

Returns

IIDProvider

The converted IIDProvider.

operator !=(IPlayerPickup, object?)

Determines whether the specified values are not equal.

public static bool operator !=(IPlayerPickup lhs, object? rhs)

Parameters

lhs IPlayerPickup

The value on the left side of the operator.

rhs object

The value on the right side of the operator.

Returns

bool

true if the values are not equal; otherwise, false.