2015-06-07 20:00:43 +00:00
|
|
|
/*
|
|
|
|
* Author: Jonpas
|
|
|
|
* Sits down the player.
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* 0: Seat <OBJECT>
|
|
|
|
* 1: Player <OBJECT>
|
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Example:
|
|
|
|
* [seat, player] call ace_sitting_fnc_sit;
|
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
#include "script_component.hpp"
|
|
|
|
|
|
|
|
PARAMS_2(_seat,_player);
|
|
|
|
|
|
|
|
// Set global variable for standing up
|
|
|
|
GVAR(seat) = _seat;
|
|
|
|
|
|
|
|
// Overwrite weird position, because Arma decides to set it differently based on current animation/stance...
|
|
|
|
_player switchMove "amovpknlmstpsraswrfldnon";
|
|
|
|
|
|
|
|
// Read config
|
2015-06-09 13:52:41 +00:00
|
|
|
private ["_sitDirection", "_sitPosition"];
|
2015-06-07 20:00:43 +00:00
|
|
|
_sitDirection = getNumber (configFile >> "CfgVehicles" >> typeOf _seat >> QGVAR(sitDirection));
|
|
|
|
_sitPosition = getArray (configFile >> "CfgVehicles" >> typeOf _seat >> QGVAR(sitPosition));
|
|
|
|
|
|
|
|
// Set direction and position
|
|
|
|
_player setDir ((getDir _seat) + _sitDirection);
|
|
|
|
_player setPos (_seat modelToWorld _sitPosition);
|
|
|
|
|
|
|
|
// Get random animation and perform it
|
2015-06-08 15:52:33 +00:00
|
|
|
[_player, call FUNC(getRandomAnimation), 2] call EFUNC(common,doAnimation);
|
2015-06-07 20:00:43 +00:00
|
|
|
|
|
|
|
// Set variables
|
2015-06-08 21:39:14 +00:00
|
|
|
_player setVariable [QGVAR(isSitting), true];
|
2015-06-07 20:00:43 +00:00
|
|
|
_seat setVariable [QGVAR(seatOccupied), true, true]; // To prevent multiple people sitting on one seat
|