Jump to content
  • 0

Help: Refuel and Repair all Air Vehicles at server restart.


CSFiles

Question

I'm sure there was a script for this, but I can't find it any more.

I'd like to have all helicopters fully repaired and refuelled after server restart (due to the leaking issues).

Ideally just those vehicles with keys :)

Does anyone know how to do this, or where I might find a script that shows me where to start?

Thank you .

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

This would best be achived via the server_monitor.sqf.

if (_ownerID != "0") then {

means its a locked vehicle.

if (_object isKindOf "Air") then {

means its an air vehicle, like helis or airplanes.

then you would set

_object setFuel 1;

for it to be fully refueled at server startup.

            _object setDamage 0;
            _hitpoints = _object call vehicle_getHitpoints;
            {
                _hitpoint = _x;
                _selection = getText(configFile >> "cfgVehicles" >> (typeof _object) >> "HitPoints" >> _hitpoint >> "name");
                _object setHit[_selection,0];
                _strH = ("hit_" + (_selection));
                _object setVariable[_strH,0,true];
            } forEach _hitpoints;
            [_object,"repair"] call server_updateObject;

This makes it fully repaired on server startup.

 

Someone correct me if I made a mistake somewhere.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...