33 {
35 return false;
36
37 if ( item.GetQuantity() <= 0 )
38 return false;
39
41 return false;
42
43 if (target.GetObject().IsDamageDestroyed())
44 return false;
45
46 Car car = Car.Cast(target.GetObject());
47 Boat boat = Boat.Cast(target.GetObject());
48 if (car)
49 {
50 if (car.GetFluidFraction(
CarFluid.FUEL ) >= 0.98)
51 return false;
52 }
53 else if (boat)
54 {
55 if ( boat.GetFluidFraction(
BoatFluid.FUEL ) >= 0.98 )
56 return false;
57 }
58 else
59 return false;
60
61 array<string> selections = new array<string>;
62 target.GetObject().GetActionComponentNameList(target.GetComponentIndex(), selections);
63
64 Transport vehicle = Transport.Cast(target.GetObject());
65
66 if ( vehicle )
67 {
68 for (int s = 0; s < selections.Count(); s++)
69 {
70 if ( selections[s] == vehicle.GetActionCompNameFuel() )
71 {
72 float dist = vector.DistanceSq( vehicle.GetRefillPointPosWS(), player.GetPosition() );
73
74 if ( dist < vehicle.GetActionDistanceFuel() * vehicle.GetActionDistanceFuel() )
75 return true;
76 }
77 }
78 }
79
80 return false;
81 }
BoatFluid
Type of vehicle's fluid. (native, do not change or extend)
CarFluid
Type of vehicle's fluid. (native, do not change or extend)
bool IsTransport(ActionTarget target)
const int LIQUID_GASOLINE