Click or drag to resize

ServerService Class

Represents a service for controlling the SA:MP server.
Inheritance Hierarchy
SystemObject
  SampSharp.Entities.SAMPServerService

Namespace:  SampSharp.Entities.SAMP
Assembly:  SampSharp.Entities (in SampSharp.Entities.dll) Version: 0.0.0-localbuild+05637d43e9f34d872e453289d4e240c843e43b09
Syntax
C#
public class ServerService : IServerService

The ServerService type exposes the following members.

Constructors
  NameDescription
Public methodServerService
Initializes a new instance of the ServerService class
Top
Properties
  NameDescription
Public propertyActorPoolSize
Gets the highest actor identifier created on the server.
Public propertyMaxPlayers
Gets the maximum number of players that can join the server, as set by the server variable 'maxplayers' in server.cfg.
Public propertyNetworkStats
Gets the server's network statistics.
Public propertyPlayerPoolSize
Gets the player actor identifier created on the server.
Public propertyTickCount
Returns the up time of the actual server (not the SA-MP server) in milliseconds.
Public propertyTickRate
Gets the tick rate of the server.
Public propertyVariables
Gets the SVar variable collection.
Public propertyVehiclePoolSize
Gets the vehicle actor identifier created on the server.
Top
Methods
  NameDescription
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 methodBlockIpAddress
Blocks an IP address from further communication with the server for a set amount of time (with wildcards allowed). Players trying to connect to the server with a blocked IP address will receive the generic "You are banned from this server." message. Players that are online on the specified IP before the block will timeout after specific amount of seconds and, upon reconnect, will receive the same message. Effect takes place only when server is running (it is not persistent).
Public methodConnectNpc
Connect an NPC to the server.
Public methodDisableInteriorEnterExits
Disable all the interior entrances and exits in the game (the yellow arrows at doors).
Public methodEnableStuntBonus
Enables or disables stunt bonuses for all players. If enabled, players will receive monetary rewards when performing a stunt in a vehicle (e.g. a wheelie).
Public methodEnableVehicleFriendlyFire
Enable friendly fire for team vehicles. Players will be unable to damage teammates' vehicles.
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGameModeExit
Ends the current game mode.
Public methodGetConsoleVarAsBool
Get the boolean value of a console variable.
Public methodGetConsoleVarAsInt
Gets the integer value of a console variable.
Public methodGetConsoleVarAsString
Gets the string value of a console variable.
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.
Public methodManualVehicleEngineAndLights
Use this function before any player connects (OnGameModeInit) 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.)
Public methodSendRconCommand
Sends an RCON (Remote Console) 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. The default draw distance is 70.0.
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 OnGameModeInit callback.
Public methodSetWorldTime
Sets the world time (for all players) to a specific hour.
Public methodShowNameTags
Shows the name tags. This function can only be used in OnGameModeInit.
Public methodShowPlayerMarkers
Toggles player markers (blips on the radar). This function can only be used in OnGameModeInit..
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Public methodUnBlockIpAddress
Unblock an IP address that was previously blocked using BlockIpAddress(String, TimeSpan).
Public methodUsePlayerPedAnims
Uses standard player walking animation (animation of the CJ skin) instead of custom animations for every skin (e.g. skating for skater skins).
Top
See Also