Jump to content
  • 0
CSFiles

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

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 .

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Advertisement
  • Supporters
  • Discord

×
×
  • Create New...