Click or drag to resize

BasePlayer Methods

The BasePlayer type exposes the following members.

Methods
  NameDescription
Public methodApplyAnimation(String, String, Single, Boolean, Boolean, Boolean, Boolean, Int32)
Apply an animation to this BasePlayer.
Public methodApplyAnimation(String, String, Single, Boolean, Boolean, Boolean, Boolean, Int32, Boolean)
Apply an animation to this BasePlayer.
Protected methodAssertNotDisposed
Checks whether this instance has been disposed. If it has, it throws an exception.
(Inherited from Disposable.)
Public methodBan
Ban this BasePlayer. 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 BasePlayer with a reason.
Public methodCancelEdit
Cancels object editing mode for this player.
Public methodCancelSelectTextDraw
Cancel text draw selection with the mouse for this BasePlayer.
Public methodClearAnimations
Clears all animations for this BasePlayer.
Public methodClearAnimations(Boolean)
Clears all animations for this BasePlayer.
Public methodCreateExplosion
Creates an explosion for a BasePlayer. Only the specific 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 methodStatic memberCreateExplosionForAll(Vector3, ExplosionType, Single)
Create an explosion at the specified coordinates.
Public methodStatic memberCreateExplosionForAll(Vector3, ExplosionType, Single, Int32)
Create an explosion at the specified coordinates.
Public methodStatic memberCreateExplosionForAll(Vector3, ExplosionType, Single, Int32, Int32)
Create an explosion at the specified coordinates.
Public methodDisableCheckpoint
Disable any initialized checkpoints for this BasePlayer.
Public methodDisableRaceCheckpoint
Disable any initialized race checkpoints for this BasePlayer.
Public methodDisableRemoteVehicleCollisions
Allows you to disable collisions between vehicles for a player.
Public methodDispose
Performs tasks associated with freeing, releasing, or resetting unmanaged resources.
(Inherited from Disposable.)
Protected methodDispose(Boolean)
Removes this instance from the pool.
(Inherited from IdentifiedPoolTInstance.)
Public methodDoEditAttachedObject
Enter edition mode for an attached object.
Public methodEnablePlayerCameraTarget
Toggles camera targeting functions for a player.
Public methodEnableStuntBonus
Toggle stunt bonuses for this BasePlayer.
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Protected methodFinalize
Finalizes an instance of the Disposable class.
(Inherited from Disposable.)
Public methodForceClassSelection
Forces this BasePlayer to go back to class selection.
Public methodGameText
Shows 'game text' (on-screen text) for a certain length of time for this BasePlayer.
Public methodStatic memberGameTextForAll
Shows 'game text' (on-screen text) for a certain length of time for all players.
Public methodGetAnimationName
Get the animation library/name this BasePlayer is playing.
Public methodGetDistanceFromPoint
Calculate the distance between this BasePlayer and a map coordinate.
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetKeys
Check which keys this BasePlayer is pressing.
Public methodGetLastShot
Retrieves the start and end (hit) position of the last bullet a player fired.
Public methodGetTime
Get this BasePlayer's current game time. Set by SetWorldTime(Int32), 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 BasePlayer's weapon slot.
Public methodGiveMoney
Give money to this BasePlayer.
Public methodGiveWeapon
Give this BasePlayer a Weapon with a specified amount of ammo.
Protected methodInitialize
An overloadable point for initialization logic which requires the Id to be set.
(Inherited from IdentifiedPoolTInstance.)
Public methodInterpolateCameraLookAt
Interpolate this BasePlayer's camera's 'look at' point between two coordinates with a set speed.
Public methodInterpolateCameraPosition
Move this BasePlayer's camera from one position to another, within the set time.
Public methodIsAttachedObjectSlotUsed
Check if this BasePlayer has an object attached in the specified index (slot).
Public methodIsInRangeOfPoint
Check if this BasePlayer is in range of a point.
Public methodIsInVehicle
Checks if this BasePlayer is in a specific BaseVehicle.
Public methodIsPlayerStreamedIn
Checks if a BasePlayer is streamed in this BasePlayer's client.
Public methodKick
Kicks this BasePlayer from the server. They will have to quit the game and re-connect if they wish to continue playing.
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodOnCancelClickTextDraw
Raises the CancelClickTextDraw event.
Public methodOnCleanup
Raises the Cleanup event.
Public methodOnClickMap
Raises the ClickMap event.
Public methodOnClickPlayer
Raises the ClickPlayer event.
Public methodOnClickPlayerTextDraw
Raises the ClickPlayerTextDraw event.
Public methodOnClickTextDraw
Raises the ClickTextDraw event.
Public methodOnCommandText
Raises the CommandText event.
Public methodOnConnected
Raises the Connected event.
Public methodOnDeath
Raises the Died event.
Public methodOnDialogResponse
Raises the DialogResponse event.
Public methodOnDisconnected
Raises the Disconnected event.
Public methodOnEditAttachedObject
Raises the EditAttachedObject event.
Public methodOnEditGlobalObject
Raises the EditGlobalObject event.
Public methodOnEditPlayerObject
Raises the EditPlayerObject event.
Public methodOnEnterCheckpoint
Raises the EnterCheckpoint event.
Public methodOnEnterExitModShop
Raises the EnterExitModShop event.
Public methodOnEnterRaceCheckpoint
Raises the EnterRaceCheckpoint event.
Public methodOnEnterVehicle
Raises the EnterVehicle event.
Public methodOnExitedMenu
Raises the ExitedMenu event.
Public methodOnExitVehicle
Raises the ExitVehicle event.
Public methodOnGiveDamage
Raises the GiveDamage event.
Public methodOnInteriorChanged
Raises the InteriorChanged event.
Public methodOnKeyStateChanged
Raises the KeyStateChanged event.
Public methodOnLeaveCheckpoint
Raises the LeaveCheckpoint event.
Public methodOnLeaveRaceCheckpoint
Raises the LeaveRaceCheckpoint event.
Public methodOnPickUpPickup
Raises the PickUpPickup event.
Public methodOnRequestClass
Raises the RequestClass event.
Public methodOnRequestSpawn
Raises the RequestSpawn event.
Public methodOnSelectedMenuRow
Raises the SelectedMenuRow event.
Public methodOnSelectGlobalObject
Raises the SelectGlobalObject event.
Public methodOnSelectPlayerObject
Raises the SelectPlayerObject event.
Public methodOnSpawned
Raises the Spawned event.
Public methodOnStateChanged
Raises the StateChanged event.
Public methodOnStreamIn
Raises the StreamIn event.
Public methodOnStreamOut
Raises the StreamOut event.
Public methodOnTakeDamage
Raises the TakeDamage event.
Public methodOnText
Raises the Text event.
Public methodOnUpdate
Raises the Update event.
Public methodOnWeaponShot
Raises the WeaponShot event.
Public methodPlayAudioStream(String)
Play an 'audio stream' for this BasePlayer. Normal audio files also work (e.g. MP3).
Public methodPlayAudioStream(String, Vector3, Single)
Play an 'audio stream' for this BasePlayer. Normal audio files also work (e.g. MP3).
Public methodPlayCrimeReport
This function plays a crime report for this BasePlayer - just like in single-player when CJ commits a crime.
Public methodPlaySound(Int32)
Plays the specified sound for this BasePlayer.
Public methodPlaySound(Int32, Vector3)
Plays the specified sound for this BasePlayer at a specific point.
Public methodPutCameraBehindPlayer
Restore the camera to a place behind the player, after using a function like CameraPosition.
Public methodPutInVehicle(BaseVehicle)
Puts this BasePlayer in a vehicle as driver.
Public methodPutInVehicle(BaseVehicle, Int32)
Puts this BasePlayer in a BaseVehicle.
Public methodRemoveAttachedObject
Remove an attached object from this BasePlayer.
Public methodRemoveFromVehicle
Removes/ejects this BasePlayer from his vehicle.
Public methodRemoveMapIcon
Removes a map icon that was set earlier for this player using SetMapIcon(Int32, Vector3, MapIcon, Color, MapIconType).
Public methodResetMoney
Reset this BasePlayer's money to $0.
Public methodResetWeapons
Removes all weapons from this BasePlayer.
Public methodSelectTextDraw
Display the cursor and allow this BasePlayer to select a text draw.
Public methodSendClientMessage(String)
This function sends a message to this BasePlayer 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 BasePlayer 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 BasePlayer with a chosen color in the chat. The whole line in the chat box will be in the set color unless colour embedding is used.
Public methodSendClientMessage(Color, String, Object)
This function sends a message to this BasePlayer with a chosen color in the chat. The whole line in the chatbox will be in the set color unless color embedding is used.
Public methodStatic memberSendClientMessageToAll(String)
Displays a message in white in chat to all players.
Public methodStatic memberSendClientMessageToAll(String, Object)
Displays a message in white in chat to all players.
Public methodStatic memberSendClientMessageToAll(Color, String)
Displays a message in chat to all players.
Public methodStatic memberSendClientMessageToAll(Color, String, Object)
Displays a message in chat to all players.
Public methodSendDeathMessage
Adds a death to the kill feed on the right-hand side of the screen of this BasePlayer.
Public methodStatic memberSendDeathMessageToAll
Adds a death to the kill feed on the right-hand side of the screen.
Public methodSendPlayerMessageToAll
Sends a message in the name of this BasePlayer to all other players on the server. The line will start with the this BasePlayer's name in their color, followed by the message in white.
Public methodSendPlayerMessageToPlayer
Sends a message in the name this BasePlayer to another player on the server. The message will appear in the chat box but can only be seen by receiver. The line will start with the this Player's name in his color, followed by the message in white.
Public methodSetAmmo
Set the ammo of this BasePlayer's weapon.
Public methodSetArmedWeapon
Sets the armed weapon of this BasePlayer.
Public methodSetAttachedObject
Attach an object to a specific bone on this BasePlayer.
Public methodSetCameraLookAt(Vector3)
Set the direction this BasePlayer's camera looks at. To be used in combination with CameraPosition.
Public methodSetCameraLookAt(Vector3, CameraCut)
Set the direction this BasePlayer's camera looks at. To be used in combination with CameraPosition.
Public methodSetChatBubble
Creates a chat bubble above this BasePlayer's name tag.
Public methodSetCheckpoint
Sets a checkpoint (red circle) for this BasePlayer. 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 BasePlayer's name tag and radar blip for another Player.
Public methodSetPositionFindZ
This sets this BasePlayer'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 BasePlayer enters it, the EnterRaceCheckpoint callback is called.
Public methodSetShopName
Loads or unloads an interior script for this BasePlayer. (for example the ammunation menu)
Public methodSetSkillLevel
Set the skill level of a certain weapon type for this BasePlayer.
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 BasePlayer to a specific value. This also changes the daytime. (night/day etc.)
Public methodSetWeather
Set this BasePlayer'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 BasePlayer - 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(BasePlayer)
Makes this BasePlayer spectate (watch) another player.
Public methodSpectatePlayer(BasePlayer, SpectateMode)
Makes this BasePlayer spectate (watch) another player.
Public methodSpectateVehicle(BaseVehicle)
Sets this BasePlayer to spectate another vehicle, i.e. see what its driver sees.
Public methodSpectateVehicle(BaseVehicle, SpectateMode)
Sets this BasePlayer to spectate another vehicle, i.e. see what its driver sees.
Public methodStartRecordingPlayerData
Starts recording this BasePlayer's movements to a file, which can then be reproduced by an NPC.
Public methodStopAudioStream
Stops the current audio stream for this BasePlayer.
Public methodStopRecordingPlayerData
Stops all the recordings that had been started with StartRecordingPlayerData(PlayerRecordingType, String) for this BasePlayer.
Public methodToggleClock
Show/Hide the in-game clock (top right corner) for this BasePlayer.
Public methodToggleControllable
Toggles whether this BasePlayer can control themselves, basically freezes them.
Public methodToggleSpectating
Toggle this BasePlayer's spectate mode.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
See Also