Refueling Script - Preventing certain vehicles

dayz10000

Member
I've managed to get the following script working on my non-rmod chernarus dayz

kh_vehicle_refuel.sqf
Code:
private["_target","_caller","_id","_isNearFeed"];

_target = _this select0;
_caller = _this select1;
_id = _this select2;
if(isNil "ib_refueling_in_progress")then{ ib_refueling_in_progress =false;};
if(!ib_refueling_in_progress)then {
        _isNearFeed = count ((position _caller) nearObjects ["Land_A_FuelStation_Feed",10])>0;

        if(!_isNearFeed)then
        {
                titleText ["You must be near a fuel station pump.","PLAIN DOWN",3];
                titleFadeOut 3;
        }
        else
        {
                ib_refueling_in_progress =true;

                titleText ["Refueling","PLAIN",3];

                while{(vehicle _caller == _target)and(local _target)}do
                { 
                        private["_velocity","_fuel"];
                        
                        _velocity = velocity _target;
                        _fuel = fuel _target;

                        if((_velocity select0>1)or(_velocity select1>1)or(_velocity select2>1)) exitWith {};
                        if(_fuel >=1.0) exitWith {};

                        sleep 0.5;
                
                        _fuel = _fuel +0.005;

                        if(_fuel >=1.0)then{ _fuel =1.0;};

                        _target setFuel _fuel;
                };

                titleFadeOut 1;

                ib_refueling_in_progress =false;
        };};


I'm trying to prevent certain vehicles (air/heli) from utilizing it...

I thought that putting a line like:
Code:
      if((_target =="UH1H_DZ")or(_target =="AH6X_DZ")) exitWith {};


somewhere in there might help, but it seems to break it from working for any vehicle...any SQF gurus out there that can help?

Thanks!
 
you will want to use typeOf


if(((typeOf _target) =="UH1H_DZ")or((typeOf _target) =="AH6X_DZ")) exitWith {};
 
Back
Top