OnPlayerNetworkStatus: Difference between revisions
Jump to navigation
Jump to search
(Created page with "{{Server event}} {{New items|3.0142|1.4.1-7295| __NOTOC__ This event is triggered when a players network connection is interrupted. }} ==Parameters== <syntaxhighlight lang="lua"> int statu...") |
No edit summary |
||
(7 intermediate revisions by 6 users not shown) | |||
Line 1: | Line 1: | ||
{{Server event}} | {{Server event}} | ||
{{New | {{New feature/item|3.0142|1.4.1|7295| | ||
__NOTOC__ | __NOTOC__ | ||
This event is triggered when a players network connection is interrupted. | This event is triggered when a players network connection to the server is interrupted. See [[onClientPlayerNetworkStatus]] for detecting server to player interruptions. | ||
}} | }} | ||
==Parameters== | ==Parameters== | ||
Line 9: | Line 9: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
*'''status''': | *'''status''': an [[int]] which is 0 if the interruption has begun, or 1 if the interruption is ending. | ||
*'''ticks''': | *'''ticks''': an [[int]] representing the ticks since the interruption started. | ||
==Source== | ==Source== | ||
The [[event system#Event source|source]] of this event is the [[player | The [[event system#Event source|source]] of this event is the [[player]] that has the network interruption. | ||
==Example== | ==Example== | ||
Line 23: | Line 23: | ||
outputDebugString( "(packets from " .. getPlayerName(source) .. ") interruption began " .. ticks .. " ticks ago" ) | outputDebugString( "(packets from " .. getPlayerName(source) .. ") interruption began " .. ticks .. " ticks ago" ) | ||
elseif status == 1 then | elseif status == 1 then | ||
outputDebugString( "(packets from " .. getPlayerName(source) .. ") interruption began " .. ticks .. " ticks ago and has just ended | outputDebugString( "(packets from " .. getPlayerName(source) .. ") interruption began " .. ticks .. " ticks ago and has just ended" ) | ||
end | end | ||
end | end | ||
Line 29: | Line 29: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
{{See also/Server event|Player events}} | |||
Latest revision as of 03:01, 27 September 2018
This event is triggered when a players network connection to the server is interrupted. See onClientPlayerNetworkStatus for detecting server to player interruptions.
Parameters
int status, int ticks
- status: an int which is 0 if the interruption has begun, or 1 if the interruption is ending.
- ticks: an int representing the ticks since the interruption started.
Source
The source of this event is the player that has the network interruption.
Example
This example shows a debug message when interruption starts and stops.
addEventHandler( "onPlayerNetworkStatus", root, function( status, ticks ) if status == 0 then outputDebugString( "(packets from " .. getPlayerName(source) .. ") interruption began " .. ticks .. " ticks ago" ) elseif status == 1 then outputDebugString( "(packets from " .. getPlayerName(source) .. ") interruption began " .. ticks .. " ticks ago and has just ended" ) end end )
See Also
Player events
- onPlayerACInfo
- onPlayerBan
- onPlayerChangeNick
- onPlayerChat
- onPlayerClick
- onPlayerCommand
- onPlayerConnect
- onPlayerContact
- onPlayerDamage
- onPlayerJoin
- onPlayerLogin
- onPlayerLogout
- onPlayerMarkerHit
- onPlayerMarkerLeave
- onPlayerModInfo
- onPlayerMute
- onPlayerNetworkStatus
- onPlayerPickupHit
- onPlayerPickupLeave
- onPlayerPickupUse
- onPlayerPrivateMessage
- onPlayerQuit
- onPlayerScreenShot
- onPlayerSpawn
- onPlayerStealthKill
- onPlayerTarget
- onPlayerUnmute
- onPlayerVehicleEnter
- onPlayerVehicleExit
- onPlayerVoiceStart
- onPlayerVoiceStop
- onPlayerWasted
- onPlayerWeaponFire
- onPlayerWeaponSwitch
Event functions
- addEvent
- addEventHandler
- cancelEvent
- cancelLatentEvent
- getEventHandlers
- getLatentEventHandles
- getLatentEventStatus
- removeEventHandler
- triggerEvent
- wasEventCancelled