Table of Contents

Struct IPlayer

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

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

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

Constructors

IPlayer(nint)

Initializes a new instance of the IPlayer struct.

public IPlayer(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.

AllowTeleport(bool)

Allows or disallows the player to teleport by clicking the map.

public void AllowTeleport(bool allow)

Parameters

allow bool

true to allow teleporting; otherwise, false.

AllowWeapons(bool)

Allows or disallows the player to use weapons.

public void AllowWeapons(bool allow)

Parameters

allow bool

true to allow weapons; otherwise, false.

ApplyAnimation(AnimationData, PlayerAnimationSyncType)

Applies an animation to the player.

public void ApplyAnimation(AnimationData animation, PlayerAnimationSyncType syncType)

Parameters

animation AnimationData

The animation data to apply.

syncType PlayerAnimationSyncType

The synchronization type for the animation.

AreWeaponsAllowed()

Checks if the player is allowed to use weapons.

public bool AreWeaponsAllowed()

Returns

bool

true if the player is allowed to use weapons; otherwise, false.

AttachCameraToObject(IObject)

Attaches the player's camera to an object.

public void AttachCameraToObject(IObject obj)

Parameters

obj IObject

The object to attach the camera to.

AttachCameraToObject(IPlayerObject)

Attaches the player's camera to a player object.

[OpenMpApiOverload("_player")]
public void AttachCameraToObject(IPlayerObject obj)

Parameters

obj IPlayerObject

The player object to attach the camera to.

Ban(string)

Bans the player from the server.

public void Ban(string reason)

Parameters

reason string

The reason for banning the player.

BroadcastPacketToStreamed(SpanLite<byte>, int, bool)

Broadcasts a packet to the player's streamed peers.

public void BroadcastPacketToStreamed(SpanLite<byte> data, int channel, bool skipFrom = true)

Parameters

data SpanLite<byte>

The data to broadcast.

channel int

The channel to broadcast the packet on.

skipFrom bool

Whether to skip broadcasting to the player.

BroadcastRPCToStreamed(int, SpanLite<byte>, int, bool)

Broadcasts an RPC to the player's streamed peers.

public void BroadcastRPCToStreamed(int id, SpanLite<byte> data, int channel, bool skipFrom = false)

Parameters

id int

The RPC ID.

data SpanLite<byte>

The data to broadcast.

channel int

The channel to broadcast the RPC on.

skipFrom bool

Whether to skip broadcasting to the player.

BroadcastSyncPacket(SpanLite<byte>, int)

Broadcasts a sync packet to the player's streamed peers.

public void BroadcastSyncPacket(SpanLite<byte> data, int channel)

Parameters

data SpanLite<byte>

The data to broadcast.

channel int

The channel to broadcast the sync packet on.

ClearAnimations(PlayerAnimationSyncType)

Clears all animations for the player.

public void ClearAnimations(PlayerAnimationSyncType syncType)

Parameters

syncType PlayerAnimationSyncType

The synchronization type for clearing animations.

ClearTasks(PlayerAnimationSyncType)

Clears all tasks for the player.

public void ClearTasks(PlayerAnimationSyncType syncType)

Parameters

syncType PlayerAnimationSyncType

The synchronization type for clearing tasks.

CreateExplosion(Vector3, int, float)

Creates an explosion at a specific position for the player.

public void CreateExplosion(Vector3 vec, int type, float radius)

Parameters

vec Vector3

The position of the explosion.

type int

The type of explosion.

radius float

The radius of the explosion.

Equals(IPlayer)

public bool Equals(IPlayer other)

Parameters

other IPlayer

Returns

bool

Equals(object?)

public override bool Equals(object? other)

Parameters

other object

Returns

bool

ForceClassSelection()

Forces the player to reselect their class.

public void ForceClassSelection()

GetAction()

Gets the player's special action.

public PlayerSpecialAction GetAction()

Returns

PlayerSpecialAction

The player's current special action.

GetAimData()

Gets the player's aim data.

public ref PlayerAimData GetAimData()

Returns

PlayerAimData

A reference to the player's aim data.

GetAnimationData()

Gets the player's current animation data.

public PlayerAnimationData GetAnimationData()

Returns

PlayerAnimationData

The player's current animation data.

GetArmedWeapon()

Gets the player's currently armed weapon.

public int GetArmedWeapon()

Returns

int

The weapon ID of the currently armed weapon.

GetArmedWeaponAmmo()

Gets the ammunition count for the player's currently armed weapon.

public int GetArmedWeaponAmmo()

Returns

int

The ammunition count for the armed weapon.

GetArmour()

Gets the player's armor value.

public float GetArmour()

Returns

float

The player's current armor value.

GetBulletData()

Gets the player's bullet data.

public ref PlayerBulletData GetBulletData()

Returns

PlayerBulletData

A reference to the player's bullet data.

GetCameraLookAt()

Gets the direction the player's camera looks at.

public Vector3 GetCameraLookAt()

Returns

Vector3

The position the camera is looking at.

GetCameraPosition()

Gets the player's camera position.

public Vector3 GetCameraPosition()

Returns

Vector3

The player's camera position.

GetCameraTargetActor()

Gets the actor the camera is targeting.

public IActor GetCameraTargetActor()

Returns

IActor

The actor the camera is targeting, or null if no actor is targeted.

GetCameraTargetObject()

Gets the object the camera is targeting.

public IObject GetCameraTargetObject()

Returns

IObject

The object the camera is targeting, or null if no object is targeted.

GetCameraTargetPlayer()

Gets the player the camera is targeting.

public IPlayer GetCameraTargetPlayer()

Returns

IPlayer

The player the camera is targeting, or null if no player is targeted.

GetCameraTargetVehicle()

Gets the vehicle the camera is targeting.

public IVehicle GetCameraTargetVehicle()

Returns

IVehicle

The vehicle the camera is targeting, or null if no vehicle is targeted.

GetClientVersion()

Gets the player's client version.

public ClientVersion GetClientVersion()

Returns

ClientVersion

The player's client version.

GetClientVersionName()

Gets the player's client version name.

public string GetClientVersionName()

Returns

string

The player's client version name.

GetColour()

Gets the player's color.

public ref Colour GetColour()

Returns

Colour

A reference to the player's color.

GetControllable()

Gets whether the player is controllable.

public bool GetControllable()

Returns

bool

true if the player is controllable; otherwise, false.

GetDefaultObjectsRemoved()

Gets the number of default objects removed for the player.

public int GetDefaultObjectsRemoved()

Returns

int

The number of default objects removed.

GetDrunkLevel()

Gets the player's drunk level.

public int GetDrunkLevel()

Returns

int

The player's drunk level.

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.

GetFightingStyle()

Gets the player's fighting style.

public PlayerFightingStyle GetFightingStyle()

Returns

PlayerFightingStyle

The player's current fighting style.

Remarks

GetGameText(int, out string?, out TimeSpan, out TimeSpan)

Gets the currently displayed game text for the player, if any.

public bool GetGameText(int style, out string? message, out TimeSpan time, out TimeSpan remaining)

Parameters

style int

The style of the game text to retrieve.

message string

The message of the game text.

time TimeSpan

The duration for which the text is displayed.

remaining TimeSpan

The remaining time for the text to be displayed.

Returns

bool

true if game text is currently displayed; otherwise, false.

GetGravity()

Gets the player's gravity.

public float GetGravity()

Returns

float

The player's current gravity value.

GetHashCode()

public override int GetHashCode()

Returns

int

GetHealth()

Gets the player's health.

public float GetHealth()

Returns

float

The player's current health.

GetID()

Gets the identifier of this unit.

public int GetID()

Returns

int

The identifier of the unit.

GetInterior()

Gets the player's interior.

public uint GetInterior()

Returns

uint

The player's current interior ID.

GetKeyData()

Gets the player's key data.

public ref PlayerKeyData GetKeyData()

Returns

PlayerKeyData

A reference to the player's key data.

GetKickStatus()

Checks if the player is about to be kicked.

public bool GetKickStatus()

Returns

bool

true if the player is about to be kicked; otherwise, false.

GetMoney()

Gets the player's current money.

public int GetMoney()

Returns

int

The amount of money the player has.

GetName()

Gets the player's name.

public string GetName()

Returns

string

The player's name.

GetNetworkData()

Gets the player's network data.

public BlittableStructRef<PeerNetworkData> GetNetworkData()

Returns

BlittableStructRef<PeerNetworkData>

A reference to the player's network data.

GetOtherColour(IPlayer, out Colour)

Gets the color of another player as seen by this player.

public bool GetOtherColour(IPlayer other, out Colour colour)

Parameters

other IPlayer

The other player.

colour Colour

When this method returns, contains the color of the other player.

Returns

bool

true if the color was successfully retrieved; otherwise, false.

GetPing()

Gets the player's ping.

public uint GetPing()

Returns

uint

The player's ping in milliseconds.

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.

GetScore()

Gets the player's score.

public int GetScore()

Returns

int

The player's current score.

GetSerial()

Gets the player's serial (GPCI).

public string GetSerial()

Returns

string

The player's serial.

GetShopName()

Gets the player's shop name.

public string GetShopName()

Returns

string

The name of the shop.

GetSkillLevels()

Gets the player's skill levels for all weapon types.

public ref SkillsArray GetSkillLevels()

Returns

SkillsArray

A reference to the player's skill levels.

Remarks

GetSkin()

Gets the player's skin.

public int GetSkin()

Returns

int

The skin ID of the player.

GetSpectateData()

Gets the player's spectate data.

public ref PlayerSpectateData GetSpectateData()

Returns

PlayerSpectateData

A reference to the player's spectate data.

GetState()

Gets the current state of the player.

public PlayerState GetState()

Returns

PlayerState

The player's current state.

GetSurfingData()

Gets the player's surfing data.

public PlayerSurfingData GetSurfingData()

Returns

PlayerSurfingData

The player's current surfing data.

GetTargetActor()

Gets the actor the player is targeting.

public IActor GetTargetActor()

Returns

IActor

The actor being targeted, or null if no actor is targeted.

GetTargetPlayer()

Gets the player the player is targeting.

public IPlayer GetTargetPlayer()

Returns

IPlayer

The player being targeted, or null if no player is targeted.

GetTeam()

Gets the player's team.

public int GetTeam()

Returns

int

The team ID of the player.

GetTime()

Gets the in-game time for the player.

public (int hour, int minutes) GetTime()

Returns

(int offset, int length)

A tuple containing the hour and minute.

GetVelocity()

Gets the player's velocity.

public Vector3 GetVelocity()

Returns

Vector3

The player's current velocity.

GetVirtualWorld()

Gets the virtual world of this entity.

public int GetVirtualWorld()

Returns

int

The virtual world of this entity.

GetWantedLevel()

Gets the player's wanted level.

public uint GetWantedLevel()

Returns

uint

The player's wanted level.

GetWeaponSlot(int)

Gets the weapon data for a specific weapon slot.

public WeaponSlotData GetWeaponSlot(int slot)

Parameters

slot int

The weapon slot index.

Returns

WeaponSlotData

The weapon slot data.

GetWeapons()

Gets all weapons and their associated data for the player.

public BlittableStructRef<WeaponSlots> GetWeapons()

Returns

BlittableStructRef<WeaponSlots>

A reference to the player's weapon slots.

GetWeather()

Gets the player's current weather.

public int GetWeather()

Returns

int

The weather ID of the player.

GetWorldBounds()

Gets the player's world bounds.

public Vector4 GetWorldBounds()

Returns

Vector4

The coordinates defining the player's world bounds.

GiveMoney(int)

Gives the player additional money.

public void GiveMoney(int money)

Parameters

money int

The amount of money to give.

GiveWeapon(WeaponSlotData)

Gives a weapon to the player.

public void GiveWeapon(WeaponSlotData weapon)

Parameters

weapon WeaponSlotData

The weapon to give.

HasCameraTargeting()

Checks if camera targeting is enabled for the player.

public bool HasCameraTargeting()

Returns

bool

true if camera targeting is enabled; otherwise, false.

HasClock()

Checks if the in-game clock is enabled for the player.

public bool HasClock()

Returns

bool

true if the clock is enabled; otherwise, false.

HasGameText(int)

Checks if game text is currently displayed for the player.

public bool HasGameText(int style)

Parameters

style int

The style of the game text to check.

Returns

bool

true if game text is displayed; otherwise, false.

HasWidescreen()

Checks if widescreen mode is enabled for the player.

public bool HasWidescreen()

Returns

bool

true if widescreen mode is enabled; otherwise, false.

HideGameText(int)

Hides game text for the player.

public void HideGameText(int style)

Parameters

style int

The style of the game text to hide.

InterpolateCameraLookAt(Vector3, Vector3, int, PlayerCameraCutType)

Interpolates the player's camera look-at position.

public void InterpolateCameraLookAt(Vector3 from, Vector3 to, int time, PlayerCameraCutType cutType)

Parameters

from Vector3

The starting position.

to Vector3

The ending position.

time int

The duration of the interpolation in milliseconds.

cutType PlayerCameraCutType

The type of camera cut.

InterpolateCameraPosition(Vector3, Vector3, int, PlayerCameraCutType)

Interpolates the player's camera position.

public void InterpolateCameraPosition(Vector3 from, Vector3 to, int time, PlayerCameraCutType cutType)

Parameters

from Vector3

The starting position.

to Vector3

The ending position.

time int

The duration of the interpolation in milliseconds.

cutType PlayerCameraCutType

The type of camera cut.

IsBot()

Checks if the player is a bot (NPC).

public bool IsBot()

Returns

bool

true if the player is a bot; otherwise, false.

IsGhostModeEnabled()

Checks if ghost mode is enabled for the player.

public bool IsGhostModeEnabled()

Returns

bool

true if ghost mode is enabled; otherwise, false.

IsStreamedInForPlayer(IPlayer)

Checks if another player is streamed in for this player.

public bool IsStreamedInForPlayer(IPlayer other)

Parameters

other IPlayer

The player to check.

Returns

bool

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

IsTeleportAllowed()

Checks if the player is allowed to teleport by clicking the map.

public bool IsTeleportAllowed()

Returns

bool

true if teleporting is allowed; otherwise, false.

IsUsingOfficialClient()

Checks if the player is using an official client.

public bool IsUsingOfficialClient()

Returns

bool

true if the player is using an official client; otherwise, false.

Kick()

Kicks the player from the server.

public void Kick()

LastPlayedAudio()

Gets the URL of the last played audio stream.

public string LastPlayedAudio()

Returns

string

The URL of the last played audio stream.

LastPlayedSound()

Gets the ID of the last sound played for the player.

public int LastPlayedSound()

Returns

int

The ID of the last played sound.

PlayAudio(string, bool, Vector3, float)

Plays an audio stream for the player.

public void PlayAudio(string url, bool usePos = false, Vector3 pos = default, float distance = 0)

Parameters

url string

The URL of the audio stream.

usePos bool

true to play the audio at a specific position; otherwise, false.

pos Vector3

The position where the audio should be played.

distance float

The maximum distance at which the audio can be heard.

PlaySound(int, Vector3)

Plays a sound for the player at a specific position.

public void PlaySound(int sound, Vector3 pos)

Parameters

sound int

The sound ID to play.

pos Vector3

The position where the sound should be played.

PlayerCrimeReport(IPlayer, int)

Plays a crime report for the player with the specified suspect and crime.

public bool PlayerCrimeReport(IPlayer suspect, int crime)

Parameters

suspect IPlayer

The player who committed the crime.

crime int

The crime ID.

Returns

bool

true if the suspect is in a state for which a crime report could be played; 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.

RemoveDefaultObjects(uint, Vector3, float)

Removes default objects near a specific position for the player.

public void RemoveDefaultObjects(uint model, Vector3 pos, float radius)

Parameters

model uint

The model ID of the objects to remove.

pos Vector3

The position near which to remove objects.

radius float

The radius within which to remove objects.

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.

RemoveFromVehicle(bool)

Removes the player from their vehicle.

public void RemoveFromVehicle(bool force)

Parameters

force bool

true to forcefully remove the player; otherwise, false.

RemoveWeapon(byte)

Removes a weapon from the player.

public void RemoveWeapon(byte weapon)

Parameters

weapon byte

The weapon to remove.

ResetMoney()

Resets the player's money to zero.

public void ResetMoney()

ResetWeapons()

Resets all weapons for the player.

public void ResetWeapons()

SendChatMessage(IPlayer, string)

Sends a chat message to the player.

public void SendChatMessage(IPlayer sender, string message)

Parameters

sender IPlayer

The player sending the message.

message string

The message to send.

SendClientCheck(int, int, int, int)

Sends a client check request to the player.

public void SendClientCheck(int actionType, int address, int offset, int count)

Parameters

actionType int

The type of action to check.

address int

The memory address to check.

offset int

The offset to check.

count int

The number of bytes to check.

SendClientMessage(ref Colour, string)

Sends a client message to the player.

public void SendClientMessage(ref Colour colour, string message)

Parameters

colour Colour

The color of the message.

message string

The message to send.

SendCommand(string)

Sends a command to the player.

public void SendCommand(string message)

Parameters

message string

The command message to send.

SendDeathMessage(IPlayer, IPlayer, int)

Sends a death message to the player.

public void SendDeathMessage(IPlayer player, IPlayer killer, int weapon)

Parameters

player IPlayer

The player who died.

killer IPlayer

The player who killed the other player.

weapon int

The weapon ID used to kill the player.

SendEmptyDeathMessage()

Sends an empty death message to the player.

public void SendEmptyDeathMessage()

SendGameText(string, TimeSpan, int)

Sends game text to the player.

public void SendGameText(string message, TimeSpan time, int style)

Parameters

message string

The game text to display.

time TimeSpan

The duration for which the text will be displayed.

style int

The style of the game text.

SendPacket(SpanLite<byte>, int, bool)

Sends a packet to the player.

public bool SendPacket(SpanLite<byte> data, int channel, bool dispatchEvents = true)

Parameters

data SpanLite<byte>

The data to send.

channel int

The channel to send the packet on.

dispatchEvents bool

Whether to dispatch events for the packet.

Returns

bool

true if the packet was sent successfully; otherwise, false.

SendRPC(int, SpanLite<byte>, int, bool)

Sends an RPC to the player.

public bool SendRPC(int id, SpanLite<byte> data, int channel, bool dispatchEvents = true)

Parameters

id int

The RPC ID.

data SpanLite<byte>

The data to send.

channel int

The channel to send the RPC on.

dispatchEvents bool

Whether to dispatch events for the RPC.

Returns

bool

true if the RPC was sent successfully; otherwise, false.

SetAction(PlayerSpecialAction)

Sets the player's special action.

public void SetAction(PlayerSpecialAction action)

Parameters

action PlayerSpecialAction

The special action to set.

SetArmedWeapon(int)

Sets the player's currently armed weapon.

public void SetArmedWeapon(int weapon)

Parameters

weapon int

The weapon ID to set as armed.

SetArmour(float)

Sets the player's armor value.

public void SetArmour(float armour)

Parameters

armour float

The armor value to set.

SetCameraBehind()

Sets the camera to a position behind the player.

public void SetCameraBehind()

SetCameraLookAt(Vector3, int)

Sets the direction the player's camera looks at.

public void SetCameraLookAt(Vector3 pos, int cutType)

Parameters

pos Vector3

The position to look at.

cutType int

The type of camera cut.

SetCameraPosition(Vector3)

Sets the player's camera position.

public void SetCameraPosition(Vector3 pos)

Parameters

pos Vector3

The position to set the camera to.

SetChatBubble(string, ref Colour, float, TimeSpan)

Sets a chat bubble for the player.

public void SetChatBubble(string text, ref Colour colour, float drawDist, TimeSpan expire)

Parameters

text string

The text to display in the chat bubble.

colour Colour

The color of the chat bubble.

drawDist float

The draw distance for the chat bubble.

expire TimeSpan

The duration for which the chat bubble will be displayed.

SetColour(Colour)

Sets the player's color.

public void SetColour(Colour colour)

Parameters

colour Colour

The color to set.

SetControllable(bool)

Sets whether the player is controllable.

public void SetControllable(bool controllable)

Parameters

controllable bool

true to make the player controllable; otherwise, false.

SetDrunkLevel(int)

Sets the player's drunk level.

public void SetDrunkLevel(int level)

Parameters

level int

The drunk level to set.

SetFightingStyle(PlayerFightingStyle)

Sets the player's fighting style.

public void SetFightingStyle(PlayerFightingStyle style)

Parameters

style PlayerFightingStyle

The fighting style to set.

Remarks

SetGravity(float)

Sets the player's gravity.

public void SetGravity(float gravity)

Parameters

gravity float

The gravity value to set.

SetHealth(float)

Sets the player's health.

public void SetHealth(float health)

Parameters

health float

The health value to set.

SetInterior(uint)

Sets the player's interior.

public void SetInterior(uint interior)

Parameters

interior uint

The interior ID to set.

SetMapIcon(int, Vector3, int, Colour, MapIconStyle)

Sets a map icon for the player.

public void SetMapIcon(int id, Vector3 pos, int type, Colour colour, MapIconStyle style)

Parameters

id int

The ID of the map icon.

pos Vector3

The position of the map icon.

type int

The type of the map icon.

colour Colour

The color of the map icon.

style MapIconStyle

The style of the map icon.

SetMoney(int)

Sets the player's money.

public void SetMoney(int money)

Parameters

money int

The amount of money to set.

SetName(string)

Sets the player's name.

public EPlayerNameStatus SetName(string name)

Parameters

name string

The new name for the player.

Returns

EPlayerNameStatus

The status of the name change.

SetOtherColour(IPlayer, Colour)

Sets the color of another player as seen by this player.

public void SetOtherColour(IPlayer other, Colour colour)

Parameters

other IPlayer

The other player.

colour Colour

The color to set for the other player.

SetPosition(Vector3)

Sets the position of this entity.

public void SetPosition(Vector3 position)

Parameters

position Vector3

The position to set.

SetPositionFindZ(Vector3)

Sets the player's position and finds the proper Z coordinate for the map.

public void SetPositionFindZ(Vector3 pos)

Parameters

pos Vector3

The position to set.

SetRemoteVehicleCollisions(bool)

Sets whether the player should collide with remote vehicles.

public void SetRemoteVehicleCollisions(bool collide)

Parameters

collide bool

true to enable collisions; otherwise, false.

SetRotation(GTAQuat)

Sets the rotation of this entity.

public void SetRotation(GTAQuat rotation)

Parameters

rotation GTAQuat

The rotation to set.

SetScore(int)

Sets the player's score.

public void SetScore(int score)

Parameters

score int

The score value to set.

SetShopName(string)

Sets the player's shop name.

public void SetShopName(string name)

Parameters

name string

The name of the shop.

SetSkillLevel(PlayerWeaponSkill, int)

Sets the player's skill level for a specific weapon.

public void SetSkillLevel(PlayerWeaponSkill skill, int level)

Parameters

skill PlayerWeaponSkill

The weapon skill to set.

level int

The skill level to set.

Remarks

SetSkin(int, bool)

Sets the player's skin.

public void SetSkin(int skin, bool send = true)

Parameters

skin int

The skin ID to set.

send bool

true to send the update to other players; otherwise, false.

SetSpectating(bool)

Sets whether the player is spectating.

public void SetSpectating(bool spectating)

Parameters

spectating bool

true to make the player spectate; otherwise, false.

SetTeam(int)

Sets the player's team.

public void SetTeam(int team)

Parameters

team int

The team ID to set.

SetTime(TimeSpan, TimeSpan)

Sets the in-game time for the player.

public void SetTime(TimeSpan hr, TimeSpan min)

Parameters

hr TimeSpan

The hour to set (0-23), truncated to whole hours on the native side.

min TimeSpan

The minute to set (0-59), truncated to whole minutes on the native side.

SetTransform(GTAQuat)

Sets the player's transformation matrix.

public void SetTransform(GTAQuat tm)

Parameters

tm GTAQuat

The transformation matrix to set.

SetVelocity(Vector3)

Sets the player's velocity.

public void SetVelocity(Vector3 velocity)

Parameters

velocity Vector3

The velocity to set.

SetVirtualWorld(int)

Sets the virtual world of this entity.

public void SetVirtualWorld(int vw)

Parameters

vw int

The virtual world to set.

SetWantedLevel(uint)

Sets the player's wanted level.

public void SetWantedLevel(uint level)

Parameters

level uint

The wanted level to set.

SetWeaponAmmo(WeaponSlotData)

Sets the ammunition for a specific weapon slot.

public void SetWeaponAmmo(WeaponSlotData data)

Parameters

data WeaponSlotData

The weapon slot data containing the weapon and ammunition information.

SetWeather(int)

Sets the player's weather.

public void SetWeather(int weatherId)

Parameters

weatherId int

The weather ID to set.

SetWorldBounds(Vector4)

Sets the player's world bounds.

public void SetWorldBounds(Vector4 coords)

Parameters

coords Vector4

The coordinates defining the world bounds.

SetWorldTime(TimeSpan)

Sets the in-game world time for the player.

public void SetWorldTime(TimeSpan time)

Parameters

time TimeSpan

The world time to set, truncated to whole hours on the native side.

Spawn()

Spawns the player.

public void Spawn()

SpectatePlayer(IPlayer, PlayerSpectateMode)

Makes the player spectate another player.

public void SpectatePlayer(IPlayer target, PlayerSpectateMode mode)

Parameters

target IPlayer

The player to spectate.

mode PlayerSpectateMode

The spectate mode.

SpectateVehicle(IVehicle, PlayerSpectateMode)

Makes the player spectate a vehicle.

public void SpectateVehicle(IVehicle target, PlayerSpectateMode mode)

Parameters

target IVehicle

The vehicle to spectate.

mode PlayerSpectateMode

The spectate mode.

StopAudio()

Stops the currently playing audio for the player.

public void StopAudio()

StreamInForPlayer(IPlayer)

Streams this player in for another player.

public void StreamInForPlayer(IPlayer other)

Parameters

other IPlayer

The player for whom this player will be streamed in.

StreamOutForPlayer(IPlayer)

Streams another player out for this player.

public void StreamOutForPlayer(IPlayer other)

Parameters

other IPlayer

The player to stream out.

StreamedForPlayers()

Gets the set of players for whom this player is currently streamed in.

public FlatPtrHashSet<IPlayer> StreamedForPlayers()

Returns

FlatPtrHashSet<IPlayer>

A set of players for whom this player is streamed in.

ToggleGhostMode(bool)

Toggles ghost mode for the player.

public void ToggleGhostMode(bool toggle)

Parameters

toggle bool

true to enable ghost mode; otherwise, false.

ToggleOtherNameTag(IPlayer, bool)

Toggles the visibility of another player's name tag for this player.

public void ToggleOtherNameTag(IPlayer other, bool toggle)

Parameters

other IPlayer

The other player.

toggle bool

true to show the name tag; false to hide it.

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.

UnsetMapIcon(int)

Removes a map icon for the player.

public void UnsetMapIcon(int id)

Parameters

id int

The ID of the map icon to remove.

UseCameraTargeting(bool)

Enables or disables camera targeting for the player.

public void UseCameraTargeting(bool enable)

Parameters

enable bool

true to enable camera targeting; otherwise, false.

UseClock(bool)

Enables or disables the in-game clock for the player.

public void UseClock(bool enable)

Parameters

enable bool

true to enable the clock; otherwise, false.

UseStuntBonuses(bool)

Enables or disables stunt bonuses for the player.

public void UseStuntBonuses(bool enable)

Parameters

enable bool

true to enable stunt bonuses; otherwise, false.

UseWidescreen(bool)

Enables or disables widescreen mode for the player.

public void UseWidescreen(bool enable)

Parameters

enable bool

true to enable widescreen mode; otherwise, false.

Operators

operator ==(IPlayer, object?)

Determines whether the specified values are equal.

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

Parameters

lhs IPlayer

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 IPlayer(IEntity)

Casts the IEntity to a IPlayer.

public static explicit operator IPlayer(IEntity value)

Parameters

value IEntity

The IEntity to cast.

Returns

IPlayer

The converted IPlayer.

explicit operator IPlayer(IExtensible)

Casts the IExtensible to a IPlayer.

public static explicit operator IPlayer(IExtensible value)

Parameters

value IExtensible

The IExtensible to cast.

Returns

IPlayer

The converted IPlayer.

explicit operator IPlayer(IIDProvider)

Casts the IIDProvider to a IPlayer.

public static explicit operator IPlayer(IIDProvider value)

Parameters

value IIDProvider

The IIDProvider to cast.

Returns

IPlayer

The converted IPlayer.

explicit operator IEntity(IPlayer)

Casts the IPlayer to a IEntity.

public static explicit operator IEntity(IPlayer value)

Parameters

value IPlayer

The IPlayer to cast.

Returns

IEntity

The converted IEntity.

explicit operator IExtensible(IPlayer)

Casts the IPlayer to a IExtensible.

public static explicit operator IExtensible(IPlayer value)

Parameters

value IPlayer

The IPlayer to cast.

Returns

IExtensible

The converted IExtensible.

explicit operator IIDProvider(IPlayer)

Casts the IPlayer to a IIDProvider.

public static explicit operator IIDProvider(IPlayer value)

Parameters

value IPlayer

The IPlayer to cast.

Returns

IIDProvider

The converted IIDProvider.

operator !=(IPlayer, object?)

Determines whether the specified values are not equal.

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

Parameters

lhs IPlayer

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.