ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Client events
  3. onClientPlayerNetworkStatus

Event

onClientPlayerNetworkStatus

ClientWorldIdentical to MTA:SA

The connection to the server stalled or came back. When no data arrives for 2.5 s, the game shows "NETWORK TROUBLE" in the middle of the screen, your character stops and status = 0 arrives; when data comes back, status = 1 arrives.

Handler

addEventHandler("onClientPlayerNetworkStatus", root, function(status, ticks) ... end)

Parameters

statusint
0 = the interruption started, 1 = it ended.
ticksint
How many milliseconds the interruption lasts (or lasted).

Source

source is root.

Example

addEventHandler("onClientPlayerNetworkStatus", root, function(status, ticks)
    if status == 0 then
        outputDebugString("Problem z połączeniem")
    else
        outputDebugString("Połączenie wróciło po " .. ticks .. " ms")
    end
end)