onPlayerDisconnected: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "|game3= arma2oa |version3= 1.51 " to "|game3= arma2oa |version3= 1.50 ")
m (Text replacement - "\|game([0-9]) ?= (.+) \|version([0-9]) ?= (.+) " to "|game$1= $2 |version$3= $4 ")
Line 2: Line 2:


|game1= arma1
|game1= arma1
|version1= 1.00
|version1= 1.00


|game2= arma2
|game2= arma2
|version2= 1.00
|version2= 1.00


|game3= arma2oa
|game3= arma2oa
|version3= 1.50
|version3= 1.50


|game4= tkoh
|game4= tkoh
|version4= 1.00
|version4= 1.00


|game5= arma3
|game5= arma3
|version5= 0.50
|version5= 0.50



Revision as of 16:51, 3 May 2021

Hover & click on the images for description

Description

Description:
This command will execute attached code whenever a player is leaving an MP session. The code will receive a number of special variables:
Multiplayer:
In multiplayer onPlayerDisconnected is executed only on the server.
Arma 3
Use playerDisconnected or HandleDisconnect instead in Arma 3.
Groups:
MultiplayerEvent Handlers

Syntax

Syntax:
onPlayerDisconnected code
Parameters:
code: String or Code - Code executed. The code will receive a number of special variables:
  • _id: Number - Is the unique DirectPlay ID. Quite useless as the number is too big for in-built string representation and gets rounded. It is also the same id used for user placed markers.
  • _uid: String - Is getPlayerUID of the leaving player. In Arma 3 it is also the same as Steam ID.
  • _jip: Boolean - Is a flag that indicated whether or not the player joined after the mission has started (Joined In Progress). true - if the player was JIP, otherwise false. Template:Since
Return Value:
Nothing

Examples

Example 1:
onPlayerDisconnected {diag_log [_id, _uid, _name]};
Example 2:
onPlayerDisconnected { if (count allPlayers == 0) then { endMission "END1"; }; };

Additional Information

See also:
onPlayerConnected didJIP didJIPOwner HandleDisconnect playerDisconnected

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note