ACE3/addons/switchunits/functions/fnc_switchBack.sqf

41 lines
903 B
Plaintext
Raw Normal View History

/*
2015-02-02 22:28:27 +00:00
* Author: bux578
* Switches back to the original player unit
*
* Arguments:
* 0: Original player unit <OBJECT>
* 1: Respawned unit <OBJECT>
*
* Return Value:
* None
*
* Example:
2015-04-17 20:45:00 +00:00
* [_originalPlayerUnit, _currentUnit] call FUNC(switchBack)
2015-02-02 22:28:27 +00:00
*
* Public: Yes
*/
2015-01-12 14:47:22 +00:00
#include "script_component.hpp"
2015-04-17 21:51:27 +00:00
PARAMS_1(_originalPlayerUnit);
2015-04-17 20:45:00 +00:00
[_originalPlayerUnit] joinSilent GVAR(OriginalGroup);
2015-02-02 22:28:27 +00:00
DFUNC(pfhSwitchBack) = {
2015-04-17 20:45:00 +00:00
PARAMS_2(_args,_pfID);
EXPLODE_2_PVT(_args,_originalPlayerUnit,_currentUnit);
2015-02-02 22:28:27 +00:00
if (local _originalPlayerUnit) exitWith {
selectPlayer _originalPlayerUnit;
deleteVehicle _currentUnit;
2015-07-26 07:20:38 +00:00
private "_layer";
_layer = "BIS_fnc_respawnCounter" call bis_fnc_rscLayer;
_layer cuttext ["","plain"];
2015-02-02 22:28:27 +00:00
[(_this select 1)] call cba_fnc_removePerFrameHandler;
};
};
2015-02-02 22:28:27 +00:00
[FUNC(pfhSwitchBack), 0.2, _this] call CBA_fnc_addPerFrameHandler;