Player Class |
Namespace: SampSharp.Entities.SAMP
public sealed class Player : Component
The Player type exposes the following members.
Name | Description | |
---|---|---|
Angle |
Gets or sets the facing angle of this player.
| |
AnimationIndex |
Gets the index of the animation this player is playing.
| |
Armour |
Gets or sets the armor of this player.
| |
AspectCameraRatio |
Gets the aspect ratio of this player's camera.
| |
BytesReceived |
Get the amount of information (in bytes) that the server has sent to the player.
| |
BytesSent |
Get the amount of information (in bytes) that the server has received from the player.
| |
CameraFrontVector |
Gets the front Vector3 of this player's camera.
| |
CameraMode |
Gets the mode of this player's camera.
| |
CameraPosition |
Gets or sets the position of the camera of this player.
| |
CameraTargetActor |
Gets the GtaPlayer the camera of this player is pointing at.
| |
CameraTargetEntity |
Gets the entity (player, player object, object, vehicle or actor) the camera of this player is pointing at.
| |
CameraTargetGlobalObject |
Gets the GlobalObject the camera of this player is pointing at.
| |
CameraTargetPlayer |
Gets the GtaPlayer the camera of this player is pointing at.
| |
CameraTargetPlayerObject |
Gets the PlayerObject the camera of this player is pointing at.
| |
CameraTargetVehicle |
Gets the GtaVehicle the camera of this player is pointing at.
| |
CameraZoom |
Gets the game camera zoom level for this player.
| |
Color |
Gets or sets the Color of this player.
| |
ConnectedTime |
Gets the amount of time (in milliseconds) that a player has been connected to the server for.
| |
ConnectionStatus |
Get a player's connection status.
| |
DrunkLevel |
Gets or sets the drunkenness level of this player.
| |
EndPoint |
Gets the end point (IP and port) of this player.
| |
Entity |
Gets the entity to which this component has been attached.
(Inherited from Component.) | |
FightStyle |
Gets or sets the FightStyle of this player.
| |
Gpci |
Gets this player's GPCI string.
| |
Health |
Gets or sets the health of this player.
| |
InAnyVehicle |
Gets whether this player is currently in any vehicle.
| |
InCheckpoint |
Gets whether this player is in his checkpoint.
| |
InRaceCheckpoint |
Gets whether this player is in his race-checkpoint.
| |
Interior |
Gets or sets the interior of this player.
| |
Ip |
Gets the IP of this player.
| |
IsAdmin |
Gets whether this player is logged into RCON.
| |
IsAlive |
Gets a value indicating whether this player is alive.
| |
IsComponentAlive |
Gets a value indicating whether this component is alive (has not been destroyed).
(Inherited from Component.) | |
IsNpc |
Gets whether this player is an actual player or an NPC.
| |
IsSelectingTextDraw |
Gets a value indicating whether this player is selecting a textdraw.
| |
Menu |
Gets the Vehicle this player is currently in.
| |
MessagesReceived |
Gets the number of messages the server has received from the player.
| |
MessagesReceivedPerSecond |
Gets the number of messages the player has received in the last second.
| |
MessagesSent |
Gets the number of messages the server has sent to the player.
| |
Money |
Gets or sets the money of this player.
| |
Name |
Gets or sets the name of this player.
| |
NetworkStats | Obsolete.
Gets this player's network stats and saves them into a string.
| |
PacketLossPercent | Obsolete.
Gets the packet loss percentage of a player. Packet loss means data the player is sending to the server is being
lost (or vice-versa).
| |
Parent |
Gets the parent entity of the entity to which this component has been attached.
(Inherited from Component.) | |
Ping |
Gets the ping of this player.
| |
Position |
Gets or sets the position of this player.
| |
Rotation |
Gets or sets the rotation of this player.
| |
Score |
Gets or sets the score of this player.
| |
Skin |
Gets or sets the skin of this player.
| |
SpecialAction |
Gets or sets the SpecialAction of this player.
| |
State |
Gets the state of this player.
| |
SurfingEntity |
Gets the entity (object or vehicle) that this player is surfing.
| |
TargetActor |
Gets the Actor this player is aiming at.
| |
TargetPlayer |
Gets the Player this player is aiming at.
| |
Team |
Gets or sets the team this player is in.
| |
Variables |
Gets the PVar variable collection for this player.
| |
Vehicle |
Gets the Vehicle this player is currently in.
| |
VehicleSeat |
Gets the vehicle seat this player sits on.
| |
Velocity |
Gets or sets the velocity of this player.
| |
Version |
Gets this player's game version.
| |
VirtualWorld |
Gets or sets the virtual world of this player.
| |
WantedLevel |
Gets or sets the wanted level of this player.
| |
Weapon |
Gets the Weapon this player is currently holding.
| |
WeaponAmmo |
Gets the ammo of the Weapon this player is currently holding.
| |
WeaponState |
Gets the WeaponState of the Weapon this player is currently holding.
|
Name | Description | |
---|---|---|
AddComponentT |
Adds a component of the specified type T to the entity.
(Inherited from Component.) | |
AddComponentT(Object) |
Adds a component of the specified type T to the entity with the specified constructor args.
(Inherited from Component.) | |
ApplyAnimation(String, String, Single, Boolean, Boolean, Boolean, Boolean, Int32) |
Apply an animation to this player.
| |
ApplyAnimation(String, String, Single, Boolean, Boolean, Boolean, Boolean, Int32, Boolean) |
Apply an animation to this player.
| |
AttachCameraToObject |
Attaches a player's camera to an object.
| |
Ban |
Ban this player. The ban will be IP-based, and be saved in the samp.ban file in the server's root directory.
Ban(String) allows you to ban with a reason, while you can ban and unban IPs using the RCON banip and
unbanip commands.
| |
Ban(String) |
Ban this player with a reason.
| |
CancelEdit |
Cancels object editing mode for this player.
| |
CancelSelectTextDraw |
Cancel text draw selection with the mouse for this player.
| |
ClearAnimations |
Clears all animations for this player.
| |
ClearAnimations(Boolean) |
Clears all animations for this player.
| |
CreateExplosion |
Creates an explosion for this player.
Only this player will see explosion and feel its effects.
This is useful when you want to isolate explosions from other players or to make them only appear in specific
virtual worlds.
| |
Destroy |
Destroys this component.
(Inherited from Component.) | |
DestroyComponentsT |
Destroys the components of the specified type T attached to the entity.
(Inherited from Component.) | |
DestroyEntity |
Destroys the entity.
(Inherited from Component.) | |
DisableCheckpoint |
Disable any initialized checkpoints for this player.
| |
DisableRaceCheckpoint |
Disable any initialized race checkpoints for this player.
| |
DisableRemoteVehicleCollisions |
Allows you to disable collisions between vehicles for a player.
| |
DoEditAttachedObject |
Enter edition mode for an attached object.
| |
Edit |
Lets this player edit the specified object.
| |
EnablePlayerCameraTarget |
Toggles camera targeting functions for a player.
| |
EnableStuntBonus |
Toggle stunt bonuses for this player.
| |
Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.) | |
ForceClassSelection |
Forces this player to go back to class selection.
| |
GameText |
Shows 'game text' (on-screen text) for a certain length of time for this player.
| |
GetAnimationName |
Get the animation library/name this player is playing.
| |
GetComponentT |
Gets a component of the specified type T attached to the entity.
(Inherited from Component.) | |
GetComponentInChildrenT |
Gets a component of the specified type T attached to a child entity of the entity using a depth first search.
(Inherited from Component.) | |
GetComponentInParentT |
Gets a component of the specified type T attached to a parent entity of the entity.
(Inherited from Component.) | |
GetComponentsT |
Gets all components of the specified type T attached to the entity.
(Inherited from Component.) | |
GetComponentsInChildrenT |
Gets all components of the specified type T attached to a child entity of the entity.
(Inherited from Component.) | |
GetComponentsInParentT |
Gets all components of the specified type T attached to a parent entity of the entity.
(Inherited from Component.) | |
GetDistanceFromPoint |
Calculate the distance between this player and a map coordinate.
| |
GetHashCode | Serves as the default hash function. (Inherited from Object.) | |
GetKeys |
Check which keys this player is pressing.
| |
GetLastShot |
Retrieves the start and end (hit) position of the last bullet a player fired.
| |
GetTime |
Get this player's current game time. Set by SetWorldTime(Int32), or by
ToggleClock(Boolean).
| |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
GetWeaponData |
Get the Weapon and ammo in this player's weapon slot.
| |
GiveMoney |
Give money to this player.
| |
GiveWeapon |
Give this player a Weapon with a specified amount of ammo.
| |
InterpolateCameraLookAt |
Interpolate this player's camera's 'look at' point between two coordinates with a set speed.
| |
InterpolateCameraPosition |
Move this player's camera from one position to another, within the set time.
| |
IsAttachedObjectSlotUsed |
Check if this player has an object attached in the specified index (slot).
| |
IsInRangeOfPoint |
Check if this player is in range of a point.
| |
IsInVehicle |
Checks if this player is in a specific vehicle.
| |
IsPlayerStreamedIn |
Checks if the specified player is streamed in this player's client.
| |
Kick |
Kicks this player from the server. They will have to quit the game and re-connect if they wish
to
continue playing.
| |
PlayAudioStream(String) |
Play an 'audio stream' for this player. Normal audio files also work (e.g. MP3).
| |
PlayAudioStream(String, Vector3, Single) |
Play an 'audio stream' for this player. Normal audio files also work (e.g. MP3).
| |
PlayCrimeReport |
This function plays a crime report for this player - just like in single-player when CJ commits
a
crime.
| |
PlaySound(Int32) |
Plays the specified sound for this player.
| |
PlaySound(Int32, Vector3) |
Plays the specified sound for this player at a specific point.
| |
PutCameraBehindPlayer |
Restore the camera to a place behind the player, after using a function like CameraPosition.
| |
PutInVehicle(EntityId) |
Puts this player in a vehicle as driver.
| |
PutInVehicle(EntityId, Int32) |
Puts this player in a vehicle.
| |
RemoveAttachedObject |
Remove an attached object from this player.
| |
RemoveBuilding |
Removes a standard San Andreas model for this player within a specified range.
| |
RemoveFromVehicle |
Removes/ejects this player from his vehicle.
| |
RemoveMapIcon |
Removes a map icon that was set earlier for this player.
| |
ResetMoney |
Reset this player's money to $0.
| |
ResetWeapons |
Removes all weapons from this player.
| |
Select |
Lets this player select an object.
| |
SelectTextDraw |
Display the cursor and allow this player to select a text draw.
| |
SendClientMessage(String) |
This function sends a message to this player in white in the chat. The whole line in the chat box will be in the set
color unless color embedding is used.
| |
SendClientMessage(String, Object) |
This function sends a message to this player in white in the chat. The whole line in the chat box will be in the set
color unless color embedding is used.
| |
SendClientMessage(Color, String) |
This function sends a message to this player with a chosen color in the chat. The whole line in
the chat box will be
in the set color unless color embedding is used.
| |
SendClientMessage(Color, String, Object) |
This function sends a message to this player with a chosen color in the chat. The whole line in the chat box will be in
the set color unless color embedding is used.
| |
SendDeathMessage |
Adds a death to the kill feed on the right-hand side of the screen of this player.
| |
SendPlayerMessageToPlayer |
Sends a message in the name the specified sender to this player. The message will appear in the
chat box but can only be seen by this player. The line will start with the the sender's name in their color, followed
by the message in white.
| |
SetAmmo |
Set the ammo of this player's weapon.
| |
SetArmedWeapon |
Sets the armed weapon of this player.
| |
SetAttachedObject |
Attach an object to a specific bone on this player.
| |
SetCameraLookAt(Vector3) |
Set the direction this player's camera looks at. To be used in combination with
CameraPosition.
| |
SetCameraLookAt(Vector3, CameraCut) |
Set the direction this player's camera looks at. To be used in combination with
CameraPosition.
| |
SetChatBubble |
Creates a chat bubble above this player's name tag.
| |
SetCheckpoint |
Sets a checkpoint (red circle) for this player. Also shows a red blip on the radar.
| |
SetMapIcon |
Place an icon/marker on this player's map. Can be used to mark locations such as banks and hospitals to players.
| |
SetPlayerMarker |
Change the color of this player's name tag and radar blip for another Player.
| |
SetPositionFindZ |
This sets this player's position then adjusts the Player's z-coordinate to the nearest solid
ground under the
position.
| |
SetRaceCheckpoint |
Creates a race checkpoint. When this player enters it, EnterRaceCheckpoint event is called.
| |
SetShopName |
Loads or unloads an interior script for this player. (for example the Ammunation menu)
| |
SetSkillLevel |
Set the skill level of a certain weapon type for this player.
| |
SetSpawnInfo |
This function can be used to change the spawn information of a specific player. It allows you to automatically set
someone's spawn weapons, their team, skin and spawn position, normally used in case of mini games or
automatic-spawn systems.
| |
SetTime |
Sets the clock of this player to a specific value. This also changes the daytime. (night/day
etc.)
| |
SetWeather |
Set this player's weather. If ToggleClock(Boolean) has been used to enable the clock,
weather changes will
interpolate (gradually change), otherwise will change instantly.
| |
SetWorldBounds |
Set the world boundaries for this player - players can not go out of the boundaries.
| |
ShowNameTagForPlayer |
This functions allows you to toggle the drawing of player name tags, health bars and armor bars which display above
their head. For use of a similar function like this on a global level, ShowNameTags(Boolean)
function.
| |
Spawn |
(Re)Spawns a player.
| |
SpectatePlayer(EntityId) |
Makes this player spectate (watch) another player.
| |
SpectatePlayer(EntityId, SpectateMode) |
Makes this player spectate (watch) another player.
| |
SpectateVehicle(EntityId) |
Sets this player to spectate another vehicle, i.e. see what its driver sees.
| |
SpectateVehicle(EntityId, SpectateMode) |
Sets this player to spectate another vehicle, i.e. see what its driver sees.
| |
StartRecordingPlayerData |
Starts recording this player's movements to a file, which can then be reproduced by an NPC.
| |
StopAudioStream |
Stops the current audio stream for this player.
| |
StopRecordingPlayerData |
Stops all the recordings that had been started with StartRecordingPlayerData(PlayerRecordingType, String) for this player.
| |
ToggleClock |
Show/Hide the in-game clock (top right corner) for this player.
| |
ToggleControllable |
Toggles whether this player can control themselves, basically freezes them.
| |
ToggleSpectating |
Toggle this player's spectate mode.
| |
ToString | Returns a string that represents the current object. (Inherited from Object.) |