Click or drag to resize

Player Methods

The Player type exposes the following members.

Methods
  NameDescription
Public methodAddComponentT
Adds a component of the specified type T to the entity.
(Inherited from Component.)
Public methodAddComponentT(Object)
Adds a component of the specified type T to the entity with the specified constructor args.
(Inherited from Component.)
Public methodApplyAnimation(String, String, Single, Boolean, Boolean, Boolean, Boolean, Int32)
Apply an animation to this player.
Public methodApplyAnimation(String, String, Single, Boolean, Boolean, Boolean, Boolean, Int32, Boolean)
Apply an animation to this player.
Public methodAttachCameraToObject
Attaches a player's camera to an object.
Public methodBan
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.
Public methodBan(String)
Ban this player with a reason.
Public methodCancelEdit
Cancels object editing mode for this player.
Public methodCancelSelectTextDraw
Cancel text draw selection with the mouse for this player.
Public methodClearAnimations
Clears all animations for this player.
Public methodClearAnimations(Boolean)
Clears all animations for this player.
Public methodCreateExplosion
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.
Public methodDestroy
Destroys this component.
(Inherited from Component.)
Public methodDestroyComponentsT
Destroys the components of the specified type T attached to the entity.
(Inherited from Component.)
Public methodDestroyEntity
Destroys the entity.
(Inherited from Component.)
Public methodDisableCheckpoint
Disable any initialized checkpoints for this player.
Public methodDisableRaceCheckpoint
Disable any initialized race checkpoints for this player.
Public methodDisableRemoteVehicleCollisions
Allows you to disable collisions between vehicles for a player.
Public methodDoEditAttachedObject
Enter edition mode for an attached object.
Public methodEdit
Lets this player edit the specified object.
Public methodEnablePlayerCameraTarget
Toggles camera targeting functions for a player.
Public methodEnableStuntBonus
Toggle stunt bonuses for this player.
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Public methodForceClassSelection
Forces this player to go back to class selection.
Public methodGameText
Shows 'game text' (on-screen text) for a certain length of time for this player.
Public methodGetAnimationName
Get the animation library/name this player is playing.
Public methodGetComponentT
Gets a component of the specified type T attached to the entity.
(Inherited from Component.)
Public methodGetComponentInChildrenT
Gets a component of the specified type T attached to a child entity of the entity using a depth first search.
(Inherited from Component.)
Public methodGetComponentInParentT
Gets a component of the specified type T attached to a parent entity of the entity.
(Inherited from Component.)
Public methodGetComponentsT
Gets all components of the specified type T attached to the entity.
(Inherited from Component.)
Public methodGetComponentsInChildrenT
Gets all components of the specified type T attached to a child entity of the entity.
(Inherited from Component.)
Public methodGetComponentsInParentT
Gets all components of the specified type T attached to a parent entity of the entity.
(Inherited from Component.)
Public methodGetDistanceFromPoint
Calculate the distance between this player and a map coordinate.
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetKeys
Check which keys this player is pressing.
Public methodGetLastShot
Retrieves the start and end (hit) position of the last bullet a player fired.
Public methodGetTime
Get this player's current game time. Set by SetWorldTime(Int32), or by ToggleClock(Boolean).
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodGetWeaponData
Get the Weapon and ammo in this player's weapon slot.
Public methodGiveMoney
Give money to this player.
Public methodGiveWeapon
Give this player a Weapon with a specified amount of ammo.
Public methodInterpolateCameraLookAt
Interpolate this player's camera's 'look at' point between two coordinates with a set speed.
Public methodInterpolateCameraPosition
Move this player's camera from one position to another, within the set time.
Public methodIsAttachedObjectSlotUsed
Check if this player has an object attached in the specified index (slot).
Public methodIsInRangeOfPoint
Check if this player is in range of a point.
Public methodIsInVehicle
Checks if this player is in a specific vehicle.
Public methodIsPlayerStreamedIn
Checks if the specified player is streamed in this player's client.
Public methodKick
Kicks this player from the server. They will have to quit the game and re-connect if they wish to continue playing.
Public methodPlayAudioStream(String)
Play an 'audio stream' for this player. Normal audio files also work (e.g. MP3).
Public methodPlayAudioStream(String, Vector3, Single)
Play an 'audio stream' for this player. Normal audio files also work (e.g. MP3).
Public methodPlayCrimeReport
This function plays a crime report for this player - just like in single-player when CJ commits a crime.
Public methodPlaySound(Int32)
Plays the specified sound for this player.
Public methodPlaySound(Int32, Vector3)
Plays the specified sound for this player at a specific point.
Public methodPutCameraBehindPlayer
Restore the camera to a place behind the player, after using a function like CameraPosition.
Public methodPutInVehicle(EntityId)
Puts this player in a vehicle as driver.
Public methodPutInVehicle(EntityId, Int32)
Puts this player in a vehicle.
Public methodRemoveAttachedObject
Remove an attached object from this player.
Public methodRemoveBuilding
Removes a standard San Andreas model for this player within a specified range.
Public methodRemoveFromVehicle
Removes/ejects this player from his vehicle.
Public methodRemoveMapIcon
Removes a map icon that was set earlier for this player.
Public methodResetMoney
Reset this player's money to $0.
Public methodResetWeapons
Removes all weapons from this player.
Public methodSelect
Lets this player select an object.
Public methodSelectTextDraw
Display the cursor and allow this player to select a text draw.
Public methodSendClientMessage(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.
Public methodSendClientMessage(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.
Public methodSendClientMessage(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.
Public methodSendClientMessage(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.
Public methodSendDeathMessage
Adds a death to the kill feed on the right-hand side of the screen of this player.
Public methodSendPlayerMessageToPlayer
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.
Public methodSetAmmo
Set the ammo of this player's weapon.
Public methodSetArmedWeapon
Sets the armed weapon of this player.
Public methodSetAttachedObject
Attach an object to a specific bone on this player.
Public methodSetCameraLookAt(Vector3)
Set the direction this player's camera looks at. To be used in combination with CameraPosition.
Public methodSetCameraLookAt(Vector3, CameraCut)
Set the direction this player's camera looks at. To be used in combination with CameraPosition.
Public methodSetChatBubble
Creates a chat bubble above this player's name tag.
Public methodSetCheckpoint
Sets a checkpoint (red circle) for this player. Also shows a red blip on the radar.
Public methodSetMapIcon
Place an icon/marker on this player's map. Can be used to mark locations such as banks and hospitals to players.
Public methodSetPlayerMarker
Change the color of this player's name tag and radar blip for another Player.
Public methodSetPositionFindZ
This sets this player's position then adjusts the Player's z-coordinate to the nearest solid ground under the position.
Public methodSetRaceCheckpoint
Creates a race checkpoint. When this player enters it, EnterRaceCheckpoint event is called.
Public methodSetShopName
Loads or unloads an interior script for this player. (for example the Ammunation menu)
Public methodSetSkillLevel
Set the skill level of a certain weapon type for this player.
Public methodSetSpawnInfo
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.
Public methodSetTime
Sets the clock of this player to a specific value. This also changes the daytime. (night/day etc.)
Public methodSetWeather
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.
Public methodSetWorldBounds
Set the world boundaries for this player - players can not go out of the boundaries.
Public methodShowNameTagForPlayer
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.
Public methodSpawn
(Re)Spawns a player.
Public methodSpectatePlayer(EntityId)
Makes this player spectate (watch) another player.
Public methodSpectatePlayer(EntityId, SpectateMode)
Makes this player spectate (watch) another player.
Public methodSpectateVehicle(EntityId)
Sets this player to spectate another vehicle, i.e. see what its driver sees.
Public methodSpectateVehicle(EntityId, SpectateMode)
Sets this player to spectate another vehicle, i.e. see what its driver sees.
Public methodStartRecordingPlayerData
Starts recording this player's movements to a file, which can then be reproduced by an NPC.
Public methodStopAudioStream
Stops the current audio stream for this player.
Public methodStopRecordingPlayerData
Stops all the recordings that had been started with StartRecordingPlayerData(PlayerRecordingType, String) for this player.
Public methodToggleClock
Show/Hide the in-game clock (top right corner) for this player.
Public methodToggleControllable
Toggles whether this player can control themselves, basically freezes them.
Public methodToggleSpectating
Toggle this player's spectate mode.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
See Also