Auto Refuel, Deploy-able Bikes

Discussion in 'General Discussion and News' started by Wxlls, Sep 7, 2013.

  1. Wxlls

    Wxlls New Member

    Joined:
    Sep 5, 2013
    Messages:
    28
    Likes Received:
    0
    Hi, I need a tutorial for auto refuel, deploy-able bikes and halo jumps for the 0.2.4 overwatch mod. i am using tcadmin panel. any help would be greatly appreciated
     
  2. Caboose69

    Caboose69 Member

    Joined:
    Aug 21, 2013
    Messages:
    79
    Likes Received:
    4
    you can pick apart my pbo if u want
     
  3. Wxlls

    Wxlls New Member

    Joined:
    Sep 5, 2013
    Messages:
    28
    Likes Received:
    0
    pick apart?
     
  4. Caboose69

    Caboose69 Member

    Joined:
    Aug 21, 2013
    Messages:
    79
    Likes Received:
    4
    i have them in my pbo if you wanted to see how they go in
     
  5. Wxlls

    Wxlls New Member

    Joined:
    Sep 5, 2013
    Messages:
    28
    Likes Received:
    0
    Yes please
     
  6. Caboose69

    Caboose69 Member

    Joined:
    Aug 21, 2013
    Messages:
    79
    Likes Received:
    4
    whats your skype ill send to you
     
  7. Wxlls

    Wxlls New Member

    Joined:
    Sep 5, 2013
    Messages:
    28
    Likes Received:
    0
    Jameswalll
     
  8. Wxlls

    Wxlls New Member

    Joined:
    Sep 5, 2013
    Messages:
    28
    Likes Received:
    0
    My Skype is 'Jameswalll'
     
  9. Caboose69

    Caboose69 Member

    Joined:
    Aug 21, 2013
    Messages:
    79
    Likes Received:
    4
    add jakleb

    theres loads of you
     
  10. RichyM92

    RichyM92 Well-Known Member

    Joined:
    Feb 19, 2013
    Messages:
    116
    Likes Received:
    8
    Auto refuel -

    inside your mission folder edit your init.sqf

    After

    Code:
    if (!isDedicated) then {
    add

    Code:
    [] execVM "Scripts\kh_actions.sqf";
    so it looks like this..
    Code:
    if (!isDedicated) then {[] execVM "Scripts\kh_actions.sqf";
    Next create a folder inside your mission root called "Scripts" and place the file "kh_actions.sqf" and "kh_vehicle_refuel.sqf"

    and your done.

    kh_actions.sqf
    Code:
    private ["_vehicle", "_vehicle_refuel_id"];
    //Awesomely Edited by Seven, Then modified by Muddr
    _vehicle = objNull;
    diag_log "Running ""kh_actions"".";
     
    _distance = 15; // Distance from object to display Refuel Message
    _amount= 0.02; // Amount of fuel to add per loop. Default was 0.005
     
    while {true} do
    {
        if (!isNull player) then {
            private ["_currentVehicle", "_isNearFeed", "_countFuel"];
                    _currentVehicle = vehicle player;
                    _countFuel = (count ((position _currentVehicle) nearObjects ["Land_Fuel_tank_big", _distance]));
                    _countFuel = _countFuel + (count ((position _currentVehicle) nearObjects ["Land_A_FuelStation_Feed", _distance]));
                    _countFuel = _countFuel + (count ((position _currentVehicle) nearObjects ["Land_Ind_TankSmall", _distance]));
                    _countFuel = _countFuel + (count ((position _currentVehicle) nearObjects ["Land_Ind_TankSmall2", _distance]));
                    _countFuel = _countFuel + (count ((position _currentVehicle) nearObjects ["Land_Ind_TankSmall2_EP1", _distance]));
                    _countFuel = _countFuel + (count ((position _currentVehicle) nearObjects ["Land_fuel_tank_stairs", _distance]));
                    _isNearFeed = _countFuel > 0;
     
            if (_vehicle != _currentVehicle) then {
                if (!isNull _vehicle) then {
                    _vehicle removeAction _vehicle_refuel_id;
                    _vehicle = objNull;
                };
     
                if (_currentVehicle != player && _isNearFeed && !(_currentVehicle isKindof "Bicycle")) then {  //change "Bicycle" to "Land" to allow only air vehicles to aut-refuel
                    _vehicle = _currentVehicle;
     
                    _vehicle_refuel_id = _vehicle addAction ["Refuel", "Scripts\kh_vehicle_refuel.sqf", [_amount], -1, false, true, "", "vehicle _this == _target && local _target"];
                };
            };
     
            if (!_isNearFeed) then {
                _vehicle removeAction _vehicle_refuel_id;
                _vehicle = objNull;
            };
        };
        sleep 2;
    }
    
    kh_vehicle_refuel.sqf

    Code:
    private ["_target", "_caller", "_id"];
     
    _target = _this select 0;
    _caller = _this select 1;
    _id = _this select 2;
    _args = _this select 3;
    _amount = _args select 0;
     
    if (isNil "ib_refueling_in_progress") then { ib_refueling_in_progress = false; };
     
    if (!ib_refueling_in_progress) then {
     
            ib_refueling_in_progress = true;
     
            titleText ["Refueling", "PLAIN DOWN", 3];
     
            while {(vehicle _caller == _target) and (local _target)} do {
                    private ["_velocity", "_cfcust"];
     
                    _velocity = velocity _target;
                    _cfcust = fuel _target;
     
                    if ((_velocity select 0 > 1) or (_velocity select 1 > 1) or (_velocity select 2 > 1)) exitWith {
                            titleText ["Refueling Stopped", "PLAIN DOWN", 3];
                    };
                    if (_cfcust >= 1.0) exitWith {
                            titleText ["Done Refueling", "PLAIN DOWN", 3];
                    };
     
                    sleep 0.5;
     
                    _cfcust = _cfcust + _amount;
     
                    if (_cfcust >= 1.0) then { _cfcust = 1.0; };
     
                    _target setFuel _cfcust;
            };
     
            titleFadeOut 1;
     
            ib_refueling_in_progress = false;
    };
    
     
    gamejoejoe and Wxlls like this.
  11. Caboose69

    Caboose69 Member

    Joined:
    Aug 21, 2013
    Messages:
    79
    Likes Received:
    4
    does it matter if hes on xstreamgaming
     
  12. RichyM92

    RichyM92 Well-Known Member

    Joined:
    Feb 19, 2013
    Messages:
    116
    Likes Received:
    8
    Thats the way I have it and I'm with Xstreamgaming, Works perfect for me
     
  13. Dobby

    Dobby Member

    Joined:
    Mar 20, 2013
    Messages:
    61
    Likes Received:
    0
    this tutorial is for overwatch mod right?.-
     
  14. RichyM92

    RichyM92 Well-Known Member

    Joined:
    Feb 19, 2013
    Messages:
    116
    Likes Received:
    8
    Yes I'm running overwatch with refuel this way and it works perfect.
     
  15. Wxlls

    Wxlls New Member

    Joined:
    Sep 5, 2013
    Messages:
    28
    Likes Received:
    0
    Thanks Richym92, I will try now just fixed my server
     
  16. Dobby

    Dobby Member

    Joined:
    Mar 20, 2013
    Messages:
    61
    Likes Received:
    0
    thanks i will try it : )
     
  17. Wxlls

    Wxlls New Member

    Joined:
    Sep 5, 2013
    Messages:
    28
    Likes Received:
    0
    It worked thanks, RichyM92 since you're using xstreamgaming.net. Do you know how to get deploy-able bikes and halo jumps or any other mods that you know about that work with overwatch and TCadmin?
     
  18. RichyM92

    RichyM92 Well-Known Member

    Joined:
    Feb 19, 2013
    Messages:
    116
    Likes Received:
    8
    I'm still working on deployable bicycles, every addon i found on here appears to be broken :/ and I haven't tried halo yet but I will let you know once i find it. If the post helped you don't forget to leave a like :)
     
  19. Wxlls

    Wxlls New Member

    Joined:
    Sep 5, 2013
    Messages:
    28
    Likes Received:
    0
    Can you get an Admin GUID menu on Xstream??
     
  20. RichyM92

    RichyM92 Well-Known Member

    Joined:
    Feb 19, 2013
    Messages:
    116
    Likes Received:
    8
    depends what admin menu you want?
     

Share This Page