Click or drag to resize

BaseMode Class

Base class for a SA-MP game mode.
Inheritance Hierarchy

Namespace:  SampSharp.GameMode
Assembly:  SampSharp.GameMode (in SampSharp.GameMode.dll) Version: 0.0.0-localbuild+05637d43e9f34d872e453289d4e240c843e43b09
Syntax
C#
public abstract class BaseMode : Disposable, 
	IGameModeProvider, IDisposable

The BaseMode type exposes the following members.

Constructors
  NameDescription
Protected methodBaseMode
Initializes a new instance of the BaseMode class.
Top
Properties
  NameDescription
Public propertyClient
Gets the game mode client.
Protected propertyControllers
Gets the collection of controllers loaded.
Public propertyStatic memberGravity
Gets or sets the gravity.
Public propertyStatic memberInstance
Gets the instance.
Public propertyIsDisposed
Gets whether this resource has been disposed.
(Inherited from Disposable.)
Public propertyServices
Gets the GameModeServiceContainer holding all the service providers attached to the game mode.
Top
Methods
  NameDescription
Public methodAddPlayerClass(Int32, Vector3, Single)
Adds a class to class selection. Classes are used so players may spawn with a skin of their choice.
Public methodAddPlayerClass(Int32, Int32, Vector3, Single)
Adds a class to class selection. Classes are used so players may spawn with a skin of their choice.
Public methodAddPlayerClass(Int32, Vector3, Single, Weapon, Int32)
Adds a class to class selection. Classes are used so players may spawn with a skin of their choice.
Public methodAddPlayerClass(Int32, Int32, Vector3, Single, Weapon, Int32)
Adds a class to class selection. Classes are used so players may spawn with a skin of their choice.
Public methodAddPlayerClass(Int32, Vector3, Single, Weapon, Int32, Weapon, Int32)
Adds a class to class selection. Classes are used so players may spawn with a skin of their choice.
Public methodAddPlayerClass(Int32, Int32, Vector3, Single, Weapon, Int32, Weapon, Int32)
Adds a class to class selection. Classes are used so players may spawn with a skin of their choice.
Public methodAddPlayerClass(Int32, Vector3, Single, Weapon, Int32, Weapon, Int32, Weapon, Int32)
Adds a class to class selection. Classes are used so players may spawn with a skin of their choice.
Public methodAddPlayerClass(Int32, Int32, Vector3, Single, Weapon, Int32, Weapon, Int32, Weapon, Int32)
Adds a class to class selection. Classes are used so players may spawn with a skin of their choice.
Public methodAllowInteriorWeapons
Toggle whether the usage of weapons in interiors is allowed or not.
Protected methodAssertNotDisposed
Checks whether this instance has been disposed. If it has, it throws an exception.
(Inherited from Disposable.)
Public methodAutoloadControllersForAssembly
Autoloads the controllers in the specified assembly.
Public methodDisableInteriorEnterExits
Disable all the interior entrances and exits in the game (the yellow arrows at doors).
Public methodDisableNameTagLOS
Disables the name tag line of sight test.
Public methodDispose
Performs tasks associated with freeing, releasing, or resetting unmanaged resources.
(Inherited from Disposable.)
Protected methodDispose(Boolean)
Performs tasks associated with freeing, releasing, or resetting unmanaged resources.
(Overrides DisposableDispose(Boolean).)
Public methodEnableStuntBonusForAll
Enables or disables stunt bonuses for all players.
Public methodEnableTirePopping
With this function you can enable or disable tire popping.
Public methodEnableVehicleFriendlyFire
Enable friendly fire for team vehicles.
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Public methodExit
Ends and restarts the game mode.
Protected methodFinalize
Finalizes an instance of the Disposable class.
(Inherited from Disposable.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodLimitGlobalChatRadius
Set a radius limitation for the chat. Only players at a certain distance from the player will see their message in the chat. Also changes the distance at which a player can see other players on the map at the same distance.
Public methodLimitPlayerMarkerRadius
Set the player marker radius.
Protected methodLoadControllers
Loads all controllers into the given ControllerCollection.
Public methodManualVehicleEngineAndLights
Use this function before any player connects (OnInitialized(EventArgs)) to tell all clients that the script will control vehicle engines and lights. This prevents the game automatically turning the engine on/off when players enter/exit vehicles and headlights automatically coming on when it is dark.
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Protected methodOnActorStreamIn
Raises the ActorStreamIn event.
Protected methodOnActorStreamOut
Raises the ActorStreamOut event.
Protected methodOnDialogResponse
Raises the DialogResponse event.
Protected methodOnExited
Raises the Exited event.
Protected methodOnIncomingConnection
Raises the IncomingConnection event.
Protected methodOnInitialized
Raises the Initialized event.
Protected methodOnObjectMoved
Raises the ObjectMoved event.
Protected methodOnPlayerCancelClickTextDraw
Raises the PlayerCancelClickTextDraw event.
Protected methodOnPlayerCleanup
Raises the PlayerCleanup event.
Protected methodOnPlayerClickMap
Raises the PlayerClickMap event.
Protected methodOnPlayerClickPlayer
Raises the PlayerClickPlayer event.
Protected methodOnPlayerClickPlayerTextDraw
Raises the PlayerClickPlayerTextDraw event.
Protected methodOnPlayerClickTextDraw
Raises the PlayerClickTextDraw event.
Protected methodOnPlayerCommandText
Raises the PlayerCommandText event.
Protected methodOnPlayerConnected
Raises the PlayerConnected event.
Protected methodOnPlayerDied
Raises the PlayerDied event.
Protected methodOnPlayerDisconnected
Raises the PlayerDisconnected event.
Protected methodOnPlayerEditAttachedObject
Raises the PlayerEditAttachedObject event.
Protected methodOnPlayerEditGlobalObject
Raises the PlayerEditGlobalObject event.
Protected methodOnPlayerEditPlayerObject
Raises the PlayerEditPlayerObject event.
Protected methodOnPlayerEnterCheckpoint
Raises the PlayerEnterCheckpoint event.
Protected methodOnPlayerEnterExitModShop
Raises the PlayerEnterExitModShop event.
Protected methodOnPlayerEnterRaceCheckpoint
Raises the PlayerEnterRaceCheckpoint event.
Protected methodOnPlayerEnterVehicle
Raises the PlayerEnterVehicle event.
Protected methodOnPlayerExitedMenu
Raises the PlayerExitedMenu event.
Protected methodOnPlayerExitVehicle
Raises the PlayerExitVehicle event.
Protected methodOnPlayerGiveDamage
Raises the PlayerGiveDamage event.
Protected methodOnPlayerGiveDamageActor
Raises the PlayerGiveDamageActor event.
Protected methodOnPlayerInteriorChanged
Raises the PlayerInteriorChanged event.
Protected methodOnPlayerKeyStateChanged
Raises the PlayerKeyStateChanged event.
Protected methodOnPlayerLeaveCheckpoint
Raises the PlayerLeaveCheckpoint event.
Protected methodOnPlayerLeaveRaceCheckpoint
Raises the PlayerLeaveRaceCheckpoint event.
Protected methodOnPlayerObjectMoved
Raises the PlayerObjectMoved event.
Protected methodOnPlayerPickUpPickup
Raises the PlayerPickUpPickup event.
Protected methodOnPlayerRequestClass
Raises the PlayerRequestClass event.
Protected methodOnPlayerRequestSpawn
Raises the PlayerRequestSpawn event.
Protected methodOnPlayerSelectedMenuRow
Raises the PlayerSelectedMenuRow event.
Protected methodOnPlayerSelectGlobalObject
Raises the PlayerSelectGlobalObject event.
Protected methodOnPlayerSelectPlayerObject
Raises the PlayerSelectPlayerObject event.
Protected methodOnPlayerSpawned
Raises the PlayerSpawned event.
Protected methodOnPlayerStateChanged
Raises the PlayerStateChanged event.
Protected methodOnPlayerStreamIn
Raises the PlayerStreamIn event.
Protected methodOnPlayerStreamOut
Raises the PlayerStreamOut event.
Protected methodOnPlayerTakeDamage
Raises the PlayerTakeDamage event.
Protected methodOnPlayerText
Raises the PlayerText event.
Protected methodOnPlayerUpdate
Raises the PlayerUpdate event.
Protected methodOnPlayerWeaponShot
Raises the PlayerWeaponShot event.
Protected methodOnRconCommand
Raises the RconCommand event.
Protected methodOnRconLoginAttempt
Raises the RconLoginAttempt event.
Protected methodOnTick
Raises the Tick event.
Protected methodOnTrailerUpdate
Raises the TrailerUpdate event.
Protected methodOnUnoccupiedVehicleUpdated
Raises the UnoccupiedVehicleUpdated event.
Protected methodOnVehicleDamageStatusUpdated
Raises the VehicleDamageStatusUpdated event.
Protected methodOnVehicleDied
Raises the VehicleDied event.
Protected methodOnVehicleMod
Raises the VehicleMod event.
Protected methodOnVehiclePaintjobApplied
Raises the VehiclePaintjobApplied event.
Protected methodOnVehicleResprayed
Raises the VehicleResprayed event.
Protected methodOnVehicleSirenStateChange
Raises the VehicleSirenStateChange event.
Protected methodOnVehicleSpawned
Raises the VehicleSpawned event.
Protected methodOnVehicleStreamIn
Raises the VehicleStreamIn event.
Protected methodOnVehicleStreamOut
Raises the VehicleStreamOut event.
Public methodRegisterExtensionT
Registers the specified extension.
Public methodSendRconCommand
Sends an RCON command.
Public methodSetGameModeText
Set the name of the game mode, which appears in the server browser.
Public methodSetNameTagDrawDistance
Set the maximum distance to display the names of players.
Public methodSetTeamCount
This function is used to change the amount of teams used in the game mode. It has no obvious way of being used, but can help to indicate the number of teams used for better (more effective) internal handling. This function should only be used in the OnInitialized(EventArgs) callback.
Public methodShowNameTags
Toggle the drawing of player name tags, health bars and armor bars above players.
Public methodShowPlayerMarkers
A function that can be used in OnInitialized(EventArgs) to enable or disable the players markers, which would normally be shown on the radar. If you want to change the marker settings at some other point in the gamemode, have a look at SetPlayerMarker(BasePlayer, Color) which does exactly that.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Public methodUsePlayerPedAnimations
Uses standard player walking animation (animation of CJ) instead of custom animations for every skin (e.g. skating for skater skins).
Top
Events
  NameDescription
Public eventActorStreamIn
Occurs when the OnActorStreamIn(Actor, PlayerEventArgs) callback is being called. This callback is called when an actor is streamed in by a player's client.
Public eventActorStreamOut
Occurs when the OnActorStreamOut(Actor, PlayerEventArgs) callback is being called. This callback is called when an actor is streamed out by a player's client.
Public eventDialogResponse
Occurs when the OnDialogResponse(BasePlayer, DialogResponseEventArgs) callback is being called. This callback is called when a player responds to a dialog shown using Dialog by either clicking a button, pressing ENTER/ESC or double-clicking a list item (if using a list style dialog).
Public eventDisposed
Occurs when this isntance has been disposed.
(Inherited from Disposable.)
Public eventExited
Occurs when the OnExited(EventArgs) callback is being called. This callback is called when a gamemode ends.
Public eventIncomingConnection
Occurs when the OnIncomingConnection(ConnectionEventArgs) callback is being called. This callback is called when an IP address attempts a connection to the server.
Public eventInitialized
Occurs when the OnInitialized(EventArgs) callback is being called. This callback is triggered when the gamemode starts.
Public eventObjectMoved
Occurs when the OnObjectMoved(GlobalObject, EventArgs) callback is being called. This callback is called when an object is moved using Move(Vector3, Single) or Move(Vector3, Single, Vector3) (when it stops moving).
Public eventPlayerCancelClickTextDraw
Occurs when the OnPlayerCancelClickTextDraw(BasePlayer, PlayerEventArgs) callback is being called. This callback is called when a player cancels the textdraw select mode(ESC).
Public eventPlayerCleanup
Occurs when the OnPlayerCleanup(BasePlayer, DisconnectEventArgs) callback is being called. This callback is called after a player has disconnected.
Public eventPlayerClickMap
Occurs when the OnPlayerClickMap(BasePlayer, PositionEventArgs) callback is being called. This callback is called when a player places a target/waypoint on the pause menu map (by right-clicking).
Public eventPlayerClickPlayer
Occurs when the OnPlayerClickPlayer(BasePlayer, ClickPlayerEventArgs) callback is being called. Called when a player double-clicks on a player on the scoreboard.
Public eventPlayerClickPlayerTextDraw
Occurs when the OnPlayerClickPlayerTextDraw(BasePlayer, ClickPlayerTextDrawEventArgs) callback is being called. This callback is called when a player clicks on a player-textdraw. It is not called when player cancels the select mode (ESC).
Public eventPlayerClickTextDraw
Occurs when the OnPlayerClickTextDraw(BasePlayer, ClickTextDrawEventArgs) callback is being called. This callback is called when a player clicks on a textdraw. It is not called when player cancels the select mode (ESC).
Public eventPlayerCommandText
Occurs when the OnPlayerCommandText(BasePlayer, CommandTextEventArgs) callback is being called. This callback is called when a player enters a command into the client chat window, e.g. /help.
Public eventPlayerConnected
Occurs when the OnPlayerConnected(BasePlayer, EventArgs) callback is being called. This callback is called when a player connects to the server.
Public eventPlayerDied
Occurs when the OnPlayerDied(BasePlayer, DeathEventArgs) callback is being called. This callback is triggered when the gamemode starts.
Public eventPlayerDisconnected
Occurs when the OnPlayerDisconnected(BasePlayer, DisconnectEventArgs) callback is being called. This callback is called when a player disconnects from the server.
Public eventPlayerEditAttachedObject
Occurs when the OnPlayerEditAttachedObject(BasePlayer, EditAttachedObjectEventArgs) callback is being called. This callback is called when a player ends attached object edition mode.
Public eventPlayerEditGlobalObject
Occurs when the OnPlayerEditGlobalObject(BasePlayer, EditGlobalObjectEventArgs) callback is being called. This callback is called when a player ends global object edition mode.
Public eventPlayerEditPlayerObject
Occurs when the OnPlayerEditPlayerObject(BasePlayer, EditPlayerObjectEventArgs) callback is being called. This callback is called when a player ends player object edition mode.
Public eventPlayerEnterCheckpoint
Occurs when the OnPlayerEnterCheckpoint(BasePlayer, EventArgs) callback is being called. This callback is called when a player enters the checkpoint set for that player.
Public eventPlayerEnterExitModShop
Occurs when the OnPlayerEnterExitModShop(BasePlayer, EnterModShopEventArgs) callback is being called. This callback is called when a player enters or exits a mod shop.
Public eventPlayerEnterRaceCheckpoint
Occurs when the OnPlayerEnterRaceCheckpoint(BasePlayer, EventArgs) callback is being called. This callback is called when a player enters a race checkpoint.
Public eventPlayerEnterVehicle
Occurs when the OnPlayerEnterVehicle(BasePlayer, EnterVehicleEventArgs) callback is being called. This callback is called when a player starts to enter a vehicle, meaning the player is not in vehicle yet at the time this callback is called.
Public eventPlayerExitedMenu
Occurs when the OnPlayerExitedMenu(BasePlayer, EventArgs) callback is being called. Called when a player exits a menu.
Public eventPlayerExitVehicle
Occurs when the OnPlayerExitVehicle(BasePlayer, PlayerVehicleEventArgs) callback is being called. This callback is called when a player exits a vehicle.
Public eventPlayerGiveDamage
Occurs when the OnPlayerGiveDamage(BasePlayer, DamageEventArgs) callback is being called. This callback is called when a player gives damage to another player.
Public eventPlayerGiveDamageActor
Occurs when the OnPlayerGiveDamageActor(Actor, DamageEventArgs) callback is being called. This callback is called when a player gives damage to an actor.
Public eventPlayerInteriorChanged
Occurs when the OnPlayerInteriorChanged(BasePlayer, InteriorChangedEventArgs) callback is being called. Called when a player changes interior.
Public eventPlayerKeyStateChanged
Occurs when the OnPlayerKeyStateChanged(BasePlayer, KeyStateChangedEventArgs) callback is being called. This callback is called when the state of any supported key is changed (pressed/released). Directional keys do not trigger this callback.
Public eventPlayerLeaveCheckpoint
Occurs when the OnPlayerLeaveCheckpoint(BasePlayer, EventArgs) callback is being called. This callback is called when a player leaves the checkpoint set for that player.
Public eventPlayerLeaveRaceCheckpoint
Occurs when the OnPlayerLeaveRaceCheckpoint(BasePlayer, EventArgs) callback is being called. This callback is called when a player leaves the race checkpoint.
Public eventPlayerObjectMoved
Occurs when the OnPlayerObjectMoved(PlayerObject, EventArgs) callback is being called. This callback is called when an object is moved using Move(Vector3, Single) or Move(Vector3, Single, Vector3) (when it stops moving).
Public eventPlayerPickUpPickup
Occurs when the OnPlayerPickUpPickup(BasePlayer, PickUpPickupEventArgs) callback is being called. Called when a player picks up a pickup created with Pickup.
Public eventPlayerRequestClass
Occurs when the OnPlayerRequestClass(BasePlayer, RequestClassEventArgs) callback is being called. Called when a player changes class at class selection (and when class selection first appears).
Public eventPlayerRequestSpawn
Occurs when the OnPlayerRequestSpawn(BasePlayer, RequestSpawnEventArgs) callback is being called. Called when a player attempts to spawn via class selection.
Public eventPlayerSelectedMenuRow
Occurs when the OnPlayerSelectedMenuRow(BasePlayer, MenuRowEventArgs) callback is being called. This callback is called when a player selects an item from a menu.
Public eventPlayerSelectGlobalObject
Occurs when the OnPlayerSelectGlobalObject(BasePlayer, SelectGlobalObjectEventArgs) callback is being called. This callback is called when a player selects an object after Select(BasePlayer) has been used.
Public eventPlayerSelectPlayerObject
Occurs when the OnPlayerSelectPlayerObject(BasePlayer, SelectPlayerObjectEventArgs) callback is being called. This callback is called when a player selects an object after Select(BasePlayer) has been used.
Public eventPlayerSpawned
Occurs when the OnPlayerSpawned(BasePlayer, SpawnEventArgs) callback is being called. This callback is called when a player spawns.
Public eventPlayerStateChanged
Occurs when the OnPlayerStateChanged(BasePlayer, StateEventArgs) callback is being called. This callback is called when a player exits a vehicle.
Public eventPlayerStreamIn
Occurs when the OnPlayerStreamIn(BasePlayer, PlayerEventArgs) callback is being called. This callback is called when a player is streamed by some other player's client.
Public eventPlayerStreamOut
Occurs when the OnPlayerStreamOut(BasePlayer, PlayerEventArgs) callback is being called. This callback is called when a player is streamed out from some other player's client.
Public eventPlayerTakeDamage
Occurs when the OnPlayerTakeDamage(BasePlayer, DamageEventArgs) callback is being called. This callback is called when a player takes damage.
Public eventPlayerText
Occurs when the OnPlayerText(BasePlayer, TextEventArgs) callback is being called. Called when a player sends a chat message.
Public eventPlayerUpdate
Occurs when the OnPlayerUpdate(BasePlayer, PlayerUpdateEventArgs) callback is being called. This callback is called everytime a client/player updates the server with their status.
Public eventPlayerWeaponShot
Occurs when the OnPlayerWeaponShot(BasePlayer, WeaponShotEventArgs) callback is being called. This callback is called when a player fires a shot from a weapon.
Public eventRconCommand
Occurs when the OnRconCommand(RconEventArgs) callback is being called. This callback is called when a command is sent through the server console, remote RCON, or via the in-game /rcon command.
Public eventRconLoginAttempt
Occurs when the OnRconLoginAttempt(RconLoginAttemptEventArgs) callback is being called. This callback is called when someone tries to login to RCON, succesful or not.
Public eventTick
Occurs when the OnTick(EventArgs) callback is being called. This callback is called every tick(50 times per second).
Public eventTrailerUpdate
Occurs when the OnTrailerUpdate(BaseVehicle, TrailerEventArgs) callback is being called. This callback is called when a player sent a trailer update.
Public eventUnoccupiedVehicleUpdated
Occurs when the OnUnoccupiedVehicleUpdated(BaseVehicle, UnoccupiedVehicleEventArgs) callback is being called. This callback is called everytime an unoccupied vehicle updates the server with their status.
Public eventVehicleDamageStatusUpdated
Occurs when the OnVehicleDamageStatusUpdated(BaseVehicle, PlayerEventArgs) callback is being called. This callback is called when a vehicle element such as doors, tires, panels, or lights get damaged.
Public eventVehicleDied
Occurs when the OnVehicleDied(BaseVehicle, PlayerEventArgs) callback is being called. This callback is called when a vehicle is destroyed - either by exploding or becoming submerged in water.
Public eventVehicleMod
Occurs when the OnVehicleMod(BaseVehicle, VehicleModEventArgs) callback is being called. This callback is called when a vehicle is modded.
Public eventVehiclePaintjobApplied
Occurs when the OnVehiclePaintjobApplied(BaseVehicle, VehiclePaintjobEventArgs) callback is being called. Called when a player changes the paintjob of their vehicle (in a modshop).
Public eventVehicleResprayed
Occurs when the OnVehicleResprayed(BaseVehicle, VehicleResprayedEventArgs) callback is being called. The callback name is deceptive, this callback is called when a player exits a mod shop, regardless of whether the vehicle's colors were changed, and is NEVER called for pay 'n' spray garages.
Public eventVehicleSirenStateChange
Occurs when the OnVehicleSirenStateChange(BaseVehicle, SirenStateEventArgs) callback is being called. This callback is called when a vehicle's siren is toggled.
Public eventVehicleSpawned
Occurs when the OnVehicleSpawned(BaseVehicle, EventArgs) callback is being called. This callback is called when a vehicle respawns.
Public eventVehicleStreamIn
Occurs when the OnVehicleStreamIn(BaseVehicle, PlayerEventArgs) callback is being called. Called when a vehicle is streamed to a player's client.
Public eventVehicleStreamOut
Occurs when the OnVehicleStreamOut(BaseVehicle, PlayerEventArgs) callback is being called. This callback is called when a vehicle is streamed out from some player's client.
Top
See Also