Tire bursts and rpm synchronization added (Currently only for DEBUG!)
This commit is contained in:
@ -71,11 +71,14 @@ namespace CoopClient
|
||||
}
|
||||
public float VehicleSteeringAngle { get; set; }
|
||||
public bool VehIsEngineRunning { get; set; }
|
||||
public float VehRPM { get; set; }
|
||||
public bool VehAreLightsOn { get; set; }
|
||||
public bool VehAreHighBeamsOn { get; set; }
|
||||
public bool VehIsSireneActive { get; set; }
|
||||
private VehicleDoors[] LastVehDoors;
|
||||
public VehicleDoors[] VehDoors { get; set; }
|
||||
private byte LastVehTires;
|
||||
public byte VehTires { get; set; }
|
||||
#endregion
|
||||
|
||||
public void DisplayLocally(string username)
|
||||
@ -350,6 +353,8 @@ namespace CoopClient
|
||||
MainVehicle.IsEngineRunning = VehIsEngineRunning;
|
||||
}
|
||||
|
||||
MainVehicle.CurrentRPM = VehRPM;
|
||||
|
||||
if (VehAreLightsOn != MainVehicle.AreLightsOn)
|
||||
{
|
||||
MainVehicle.AreLightsOn = VehAreLightsOn;
|
||||
@ -416,6 +421,19 @@ namespace CoopClient
|
||||
|
||||
LastVehDoors = VehDoors;
|
||||
}
|
||||
|
||||
if (VehTires != default && LastVehTires != VehTires)
|
||||
{
|
||||
for (int i = 0; i < MainVehicle.Wheels.Count - 1; i++)
|
||||
{
|
||||
if ((VehTires & 1 << i) != 0)
|
||||
{
|
||||
Function.Call(Hash.SET_VEHICLE_TYRE_BURST, MainVehicle, i, true, 1000.0);
|
||||
}
|
||||
}
|
||||
|
||||
LastVehTires = VehTires;
|
||||
}
|
||||
}
|
||||
|
||||
if (VehicleSteeringAngle != MainVehicle.SteeringAngle)
|
||||
|
@ -281,12 +281,20 @@ namespace CoopClient
|
||||
|
||||
int secondaryColor;
|
||||
int primaryColor;
|
||||
|
||||
unsafe
|
||||
{
|
||||
Function.Call<int>(Hash.GET_VEHICLE_COLOURS, veh, &primaryColor, &secondaryColor);
|
||||
}
|
||||
|
||||
byte tyreFlag = 0;
|
||||
for (int i = 0; i < veh.Wheels.Count - 1; i++)
|
||||
{
|
||||
if (Function.Call<bool>(Hash.IS_VEHICLE_TYRE_BURST, veh, i, false))
|
||||
{
|
||||
tyreFlag |= (byte)(1 << i);
|
||||
}
|
||||
}
|
||||
|
||||
DebugSyncPed.VehicleModelHash = veh.Model.Hash;
|
||||
DebugSyncPed.VehicleSeatIndex = (int)player.SeatIndex;
|
||||
DebugSyncPed.VehiclePosition = veh.Position;
|
||||
@ -298,6 +306,7 @@ namespace CoopClient
|
||||
DebugSyncPed.VehicleColors = new int[] { primaryColor, secondaryColor };
|
||||
DebugSyncPed.VehicleMods = Util.GetVehicleMods(veh);
|
||||
DebugSyncPed.VehDoors = Util.GetVehicleDoors(veh.Doors);
|
||||
DebugSyncPed.VehTires = tyreFlag;
|
||||
DebugSyncPed.LastSyncWasFull = (flags.Value & (byte)VehicleDataFlags.LastSyncWasFull) > 0;
|
||||
DebugSyncPed.IsInVehicle = (flags.Value & (byte)VehicleDataFlags.IsInVehicle) > 0;
|
||||
DebugSyncPed.VehIsEngineRunning = (flags.Value & (byte)VehicleDataFlags.IsEngineRunning) > 0;
|
||||
|
Reference in New Issue
Block a user