93 override bool IsAreaAtDoorFree(
int currentSeat,
float maxAllowedObjHeight = 0.5,
float horizontalExtents = 0.5,
float playerHeight = 1.7 )
99 extents[0] = horizontalExtents;
100 extents[1] = playerHeight;
101 extents[2] = horizontalExtents;
105 extents[2] = extents[2] * 6;
109 return IsAreaAtDoorFree( currentSeat, maxAllowedObjHeight, extents, transform );
112 override Shape DebugFreeAreaAtDoor(
int currentSeat,
float maxAllowedObjHeight = 0.5,
float horizontalExtents = 0.5,
float playerHeight = 1.7 )
114 int color =
ARGB(20, 0, 255, 0);
120 extents[0] = horizontalExtents;
121 extents[1] = playerHeight;
122 extents[2] = horizontalExtents;
126 extents[2] = extents[2] * 6;
130 if (!
IsAreaAtDoorFree( currentSeat, maxAllowedObjHeight, extents, transform ))
132 color =
ARGB(20, 255, 0, 0);
136 shape.SetMatrix(transform);
142 return EInventoryIconVisibility.HIDE_VICINITY;
171 proto native
void SetThrust(
float in,
float gentle = 0,
float turbo = 0 );
181 proto native
void SetBrake(
float in,
float panic = 0,
bool gentle =
false );
425 proto
void SetThrust(
float in,
float gentle = 0,
float turbo = 0 );
enum CarGearboxType ELEVENTH
CarAutomaticGearboxMode
Enumerated automatic gearbox modes. (native, do not change or extend)
enum CarGearboxType THIRTEENTH
enum CarGearboxType EIGTH
enum CarGearboxType SECOND
enum CarGearboxType FOURTH
enum CarGearboxType NINTH
enum CarGearboxType SIXTEENTH
enum CarGearboxType FIFTH
enum CarGearboxType FIFTEENTH
CarSoundCtrl
Car's sound controller list. (native, do not change or extend)
@ SPEED
speed of the car in km/h
@ DOORS
indicates if doors are open
@ ENGINE
indicates if engine is ON
@ PLAYER
indicates if driver is controlled by player
enum CarGearboxType SEVENTH
enum CarGearboxType SIXTH
CarFluid
Type of vehicle's fluid. (native, do not change or extend)
@ USER4
reserved for user / modding support
@ USER1
reserved for user / modding support
@ USER2
reserved for user / modding support
@ USER3
reserved for user / modding support
enum CarGearboxType THIRD
enum CarGearboxType REVERSE
Enumerated vehicle's gears. (native, do not change or extend)
CarGearboxType
Enumerated gearbox types. (native, do not change or extend)
@ AUTOMATIC
automatic transmission with torque converter between engine and gearbox
@ MANUAL
classic manual transmission with friction plates between engine and gearbox
enum CarGearboxType FIRST
enum CarGearboxType TENTH
enum CarGearboxType TWELFTH
enum CarGearboxType FOURTEENTH
enum CarGearboxType NEUTRAL
DEPRECATED class left for backwards compatibility, methods are available on car itself now.
proto int GetGear()
Returns index of the current gear.
proto float GetBrake()
Returns the current brake value in range <0, 1>.
proto void SetThrust(float in, float gentle=0, float turbo=0)
proto float GetThrustGentle()
Returns the current thrust gentle modifier value in range <0, 1>.
proto void SetSteering(float in, bool analog=false)
proto void SetBrake(float in, float panic=0)
proto float GetThrust()
Returns the current thrust value in range <0, 1>.
proto void ShiftTo(CarGear gear)
proto float GetSteering()
Returns the current steering value in range <-1, 1>.
private void ~CarController()
proto float GetThrustTurbo()
Returns the current thrust turbo modifier value in range <0, 1>.
private void CarController()
static Shape DrawBox(vector pos1, vector pos2, int color=0x1fff7f7f)
Base native class for all motorized wheeled vehicles.
proto native float GetHandbrake()
Returns the current handbrake value in range <0, 1>.
proto native CarController GetController()
DEPRECATED, left for backwards compatibility, the methods of this class are now directly accessible o...
proto native bool WheelIsLocked(int wheelIdx)
proto native float GetFluidFraction(CarFluid fluid)
proto native vector GetEnginePos()
Get actual position of engine (model space)
proto native void ForceDirection(vector dir)
proto native float EngineGetRPMRedline()
Returns engine's maximal working rpm without damaging the engine.
proto native float GetSteering()
Returns the current steering value in range <-1, 1>.
override bool IsAreaAtDoorFree(int currentSeat, float maxAllowedObjHeight=0.5, float horizontalExtents=0.5, float playerHeight=1.7)
proto native void SetBrake(float in, float panic=0, bool gentle=false)
proto native void Leak(CarFluid fluid, float amount)
Removes from the specified fluid the specified amount.
proto native void SetClutchState(bool in)
proto native CarGearboxType GearboxGetType()
Returns gearbox type. See CarGearboxType enum for more info.
proto native void SetThrust(float in, float gentle=0, float turbo=0)
proto native void EngineStop()
Stops the engine.
proto native CarAutomaticGearboxMode GearboxGetMode()
Returns gearbox mode. This is useful when car has automatic gearbox.
proto native float GetSpeedometer()
Returns the current speed of the vehicle in km/h.
proto native float GetClutch()
Returns the current clutch value in range <0, 1>.
void OnGearChanged(int newGear, int oldGear)
proto native void SetHandbrake(float in)
proto native float GetThrustGentle()
Returns the current thrust gentle modifier value in range <0, 1>.
override Shape DebugFreeAreaAtDoor(int currentSeat, float maxAllowedObjHeight=0.5, float horizontalExtents=0.5, float playerHeight=1.7)
proto native float GetThrust()
Returns the current thrust value in range <0, 1>.
proto native void SetEnginePos(vector pos)
Override the position of engine (model space)
proto native bool EngineIsOn()
Returns true when engine is running, false otherwise.
proto native float EngineGetRPMIdle()
Returns engine's idle rpm before engine stalls.
proto native void SetBrakesActivateWithoutDriver(bool activate=true)
proto native void ShiftDown()
proto native void ShiftUp()
proto native void LeakAll(CarFluid fluid)
Removes all the specified fluid from vehicle.
bool OnBeforeEngineStart()
proto native void EngineStart()
Starts the engine.
proto native float EngineGetRPM()
Returns engine's rpm value.
void OnEngineStart()
Is called every time the engine starts.
proto native bool WheelIsAnyLocked()
Returns true if any of the wheels are locked in terms of its movement.
override int GetHideIconMask()
proto native float GetFluidCapacity(CarFluid fluid)
proto native float EngineGetRPMMin()
Returns engine's min operating rpm.
proto native float GetThrustTurbo()
Returns the current thrust turbo modifier value in range <0, 1>.
proto native void ShiftTo(CarGear gear)
void OnFluidChanged(CarFluid fluid, float newValue, float oldValue)
void OnEngineStop()
Is called every time the engine stops.
proto native int GetGear()
Returns index of the current gear.
void OnContact(string zoneName, vector localPos, IEntity other, Contact data)
proto native void SetSteering(float in, bool analog=false)
float GetSpeedometerAbsolute()
Returns the current speed of the vehicle in km/h. Value is absolute.
proto native int GetGearsCount()
Returns total number of gears.
proto native void Fill(CarFluid fluid, float amount)
Adds to the specified fluid the specified amount.
float OnSound(CarSoundCtrl ctrl, float oldValue)
proto native float GetBrake()
Returns the current brake value in range <0, 1>.
proto native void ForcePosition(vector pos)
proto native float EngineGetRPMMax()
Returns engine's max rpm before engine blows up.
static proto float AbsFloat(float f)
Returns absolute value.
int ARGB(int a, int r, int g, int b)