jshock 512 Posted October 14, 2015 unitName addAction [ "Refuel Vehicle", { vehicle (_this select 0) setFuel 1; _handle = [] spawn { hintSilent "Refueled."; sleep 3; hintSilent ""; }; }, nil, 6, true, true, "", " vehicle _this != _this && vehicle _this isKindOf 'LandVehicle' && fuel vehicle _this < 1 " ]; Works only for Land Vehicles, but that can be changed. 1 Share this post Link to post Share on other sites
fn_Quiksilver 1633 Posted October 15, 2015 I would also add in a check to see if the vehicle is local to the client trying to refuel it, or the 'setFuel' command will not work. Just a small addition to JShocks code which should work fine anyways. // JShocks code unitName addAction [ "Refuel Vehicle", { vehicle (_this select 0) setFuel 1; _handle = [] spawn { hintSilent "Refueled."; sleep 3; hintSilent ""; }; }, nil, 6, true, true, "", " vehicle _this != _this && vehicle _this isKindOf 'LandVehicle' && fuel vehicle _this < 1 && (local (vehicle _this)) " ]; ^ last line Share this post Link to post Share on other sites
jshock 512 Posted October 15, 2015 Good catch There is also this info, maybe out of date: https://community.bistudio.com/wiki/Locality_in_Multiplayer A vehicle is always local to the client of its driver So by this we can also just check to see if the player is the driver as well. 1 Share this post Link to post Share on other sites
dna_uk 30 Posted October 15, 2015 This script should handle refueling for non local vehicles. Obviously adjust and add whatever else you need where needed: this addAction [ "Refuel", { params ["_target"]; _target = vehicle _target; if (local _target) then { _target setFuel 1; } else { [_target, 1] remoteExecCall ["setFuel", _target]; }; }, nil, 6, true, true, "", " !isNull objectParent _this && vehicle _this isKindOf ""LandVehicle"" && fuel vehicle _this < 1 " ]; Share this post Link to post Share on other sites