mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
e2ac18a05d
* advanced_ballistics * advanced_fatigue * advanced_throwing * ai * aircraft * arsenal * atragmx * attach * backpacks * ballistics * captives * cargo * chemlights * common * concertina_wire * cookoff * dagr * disarming * disposable * dogtags * dragging * explosives * fastroping * fcs * finger * frag * gestures * gforces * goggles * grenades * gunbag * hearing * hitreactions * huntir * interact_menu * interaction * inventory * kestrel4500 * laser * laserpointer * logistics_uavbattery * logistics_wirecutter * magazinerepack * map * map_gestures * maptools * markers * medical * medical_ai * medical_blood * medical_menu * microdagr * minedetector * missileguidance * missionmodules * mk6mortar * modules * movement * nametags * nightvision * nlaw * optics * optionsmenu * overheating * overpressure * parachute * pylons * quickmount * rangecard * rearm * recoil * refuel * reload * reloadlaunchers * repair * respawn * safemode * sandbag * scopes * slideshow * spectator * spottingscope * switchunits * tacticalladder * tagging * trenches * tripod * ui * vector * vehiclelock * vehicles * viewdistance * weaponselect * weather * winddeflection * yardage450 * zeus * arsenal defines.hpp * optionals * DEBUG_MODE_FULL 1 * DEBUG_MODE_FULL 2 * Manual fixes * Add SQF Validator check for #include after block comment * explosives fnc_openTimerUI * fix uniqueItems
90 lines
2.6 KiB
Plaintext
90 lines
2.6 KiB
Plaintext
#include "script_component.hpp"
|
|
/*
|
|
* Author: GitHawk
|
|
* Makes an object into a jerry can.
|
|
*
|
|
* Arguments:
|
|
* 0: Target <OBJECT>
|
|
* 1: Fuel amount (in liters) <NUMBER>
|
|
*
|
|
* Return Value:
|
|
* None
|
|
*
|
|
* Example:
|
|
* [can] call ace_refuel_fnc_makeJerryCan
|
|
*
|
|
* Public: Yes
|
|
*/
|
|
|
|
params [["_target", objNull, [objNull]], ["_fuelAmount", 20, [0]]];
|
|
|
|
if (isNull _target ||
|
|
{_target isKindOf "AllVehicles"} ||
|
|
{_target getVariable [QGVAR(jerryCan), false]}) exitWith {};
|
|
|
|
if (isServer) then {
|
|
[_target, _fuelAmount] call FUNC(setFuel); // has global effects
|
|
};
|
|
_target setVariable [QGVAR(jerryCan), true];
|
|
_target setVariable [QGVAR(source), _target];
|
|
|
|
// Main Action
|
|
private _action = [QGVAR(Refuel),
|
|
localize LSTRING(Refuel),
|
|
QPATHTOF(ui\icon_refuel_interact.paa),
|
|
{},
|
|
{true},
|
|
{},
|
|
[],
|
|
[0, 0, 0],
|
|
REFUEL_ACTION_DISTANCE] call EFUNC(interact_menu,createAction);
|
|
[_target, 0, ["ACE_MainActions"], _action] call EFUNC(interact_menu,addActionToObject);
|
|
|
|
// Add pickup
|
|
_action = [QGVAR(PickUpNozzle),
|
|
localize LSTRING(TakeNozzle),
|
|
QPATHTOF(ui\icon_refuel_interact.paa),
|
|
{[_player, _target] call FUNC(takeNozzle)},
|
|
{[_player, _target] call FUNC(canTakeNozzle)},
|
|
{},
|
|
[],
|
|
[0, 0, 0],
|
|
REFUEL_ACTION_DISTANCE] call EFUNC(interact_menu,createAction);
|
|
[_target, 0, ["ACE_MainActions", QGVAR(Refuel)], _action] call EFUNC(interact_menu,addActionToObject);
|
|
|
|
// Add turnOn
|
|
_action = [QGVAR(TurnOn),
|
|
localize LSTRING(TurnOn),
|
|
QPATHTOF(ui\icon_refuel_interact.paa),
|
|
{[_player, _target] call FUNC(turnOn)},
|
|
{[_player, _target] call FUNC(canTurnOn)},
|
|
{},
|
|
[],
|
|
[0, 0, 0],
|
|
REFUEL_ACTION_DISTANCE] call EFUNC(interact_menu,createAction);
|
|
[_target, 0, ["ACE_MainActions", QGVAR(Refuel)], _action] call EFUNC(interact_menu,addActionToObject);
|
|
|
|
// Add turnOff
|
|
_action = [QGVAR(TurnOff),
|
|
localize LSTRING(TurnOff),
|
|
QPATHTOF(ui\icon_refuel_interact.paa),
|
|
{[_player, _target] call FUNC(turnOff)},
|
|
{[_player, _target] call FUNC(canTurnOff)},
|
|
{},
|
|
[],
|
|
[0, 0, 0],
|
|
REFUEL_ACTION_DISTANCE] call EFUNC(interact_menu,createAction);
|
|
[_target, 0, ["ACE_MainActions", QGVAR(Refuel)], _action] call EFUNC(interact_menu,addActionToObject);
|
|
|
|
// Add disconnect
|
|
_action = [QGVAR(Disconnect),
|
|
localize LSTRING(Disconnect),
|
|
QPATHTOF(ui\icon_refuel_interact.paa),
|
|
{[_player, _target] call FUNC(disconnect)},
|
|
{[_player, _target] call FUNC(canDisconnect)},
|
|
{},
|
|
[],
|
|
[0, 0, 0],
|
|
REFUEL_ACTION_DISTANCE] call EFUNC(interact_menu,createAction);
|
|
[_target, 0, ["ACE_MainActions", QGVAR(Refuel)], _action] call EFUNC(interact_menu,addActionToObject);
|