ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Server functions
  3. getNetworkStats

Function

getNetworkStats

ServerMiscellaneousIdentical to MTA:SA

Returns network statistics for the server or one player: bytes and packets sent and received. The packet loss and buffer fields are zeros for now.

Syntax

table getNetworkStats([player thePlayer])

Arguments

thePlayerplayer, optional
A player; the whole server without it.

Returns

A table with bytesReceived, bytesSent, packetsReceived, packetsSent and more, or false.

Example

local s = getNetworkStats(player)
outputServerLog(("%s: %d KB odebrane"):format(getPlayerName(player), s.bytesReceived / 1024))

See also