31 {
33 return false;
34
35 if( item.GetQuantity() <= 0 )
36 return false;
37
38 Car car = Car.Cast( target.GetObject() );
39 if( !car )
40 return false;
41
42 if( car.GetFluidFraction(
CarFluid.OIL ) >= 0.98 )
43 return false;
44
45 array<string> selections = new array<string>;
46 target.GetObject().GetActionComponentNameList(target.GetComponentIndex(), selections);
47
49 if( carS )
50 {
51 for (int s = 0; s < selections.Count(); s++)
52 {
53 if ( selections[s] == carS.GetActionCompNameOil() )
54 {
55 float dist = vector.Distance( carS.GetRefillPointPosWS(), player.GetPosition() );
56
57 if ( dist < carS.GetActionDistanceOil() )
58 return true;
59 }
60 }
61 }
62
63 return false;
64 }
CarFluid
Type of vehicle's fluid. (native, do not change or extend)
bool IsTransport(ActionTarget target)