Click or drag to resize

Server Class

Contains methods affecting the SA-MP server.
Inheritance Hierarchy
SystemObject
  SampSharp.GameMode.SAMPServer

Namespace:  SampSharp.GameMode.SAMP
Assembly:  SampSharp.GameMode (in SampSharp.GameMode.dll) Version: 0.0.0-localbuild+05637d43e9f34d872e453289d4e240c843e43b09
Syntax
C#
public static class Server

The Server type exposes the following members.

Properties
  NameDescription
Public propertyStatic memberConfig Obsolete.
Deprecated. Use new ServerConfig(Path.Combine(gameMode.Client.ServerPath, "server.cfg")) instead.
Public propertyStatic memberMaxPlayers
Gets the maximum number of players that can join the server, as set by the server var 'maxplayers' in server.cfg.
Public propertyStatic memberNetworkStats
Gets the network stats as a string.
Public propertyStatic memberVariables
Gets the server variables.
Top
Methods
  NameDescription
Public methodStatic memberBlockIPAddress
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 a few seconds and, upon reconnect, will receive the same message.
Public methodStatic memberConnectNPC
Connect an NPC to the server.
Public methodStatic memberGetConsoleVariableT
Retrieve a console variable.
Public methodStatic memberGetServerTickRate
Gets the tick rate of the server.
Public methodStatic memberGetTickCount
Returns the uptime of the actual server in milliseconds.
Public methodStatic memberGetWeaponName
Gets the name of the specified weapon.
Public methodStatic memberPrint
Prints the specified message to the console.
Public methodStatic memberSendRconCommand
Sends an RCON command.
Public methodStatic memberSetWeather
Set the world weather for all players.
Public methodStatic memberSetWorldTime
Sets the world time to a specific hour.
Public methodStatic memberUnBlockIPAddress
Unblock an IP address that was previously blocked using BlockIPAddress(String, TimeSpan).
Top
See Also