ACE3/addons/pylons/functions/fnc_handleDisconnect.sqf
jonpas 742626ff1a
General - Relative script_component.hpp includes (#9378)
Co-authored-by: PabstMirror <pabstmirror@gmail.com>
2023-09-12 20:58:10 +02:00

28 lines
644 B
Plaintext

#include "..\script_component.hpp"
/*
* Author: 654wak654
* Cleans up pylons on client disconnect.
*
* Arguments:
* 0: Unit (not used) <OBJECT>
* 1: ID (not used) <NUMBER>
* 2: UID <STRING>
*
* Return Value:
* None
*
* Example:
* [_unit, _id, _uid] call ace_pylons_fnc_handleDisconnect
*
* Public: No
*/
params ["", "", "_uid"];
private _aircraft = GVAR(currentAircraftNamespace) getVariable [_uid, objNull];
if (!isNull _aircraft) then {
_aircraft setVariable [QGVAR(currentUser), objNull, true];
GVAR(currentAircraftNamespace) setVariable [_uid, nil, true]; // Remove var from namespace, no need to keep objNull
};