Add license plate sync

This commit is contained in:
Sardelka
2022-06-20 10:27:45 +08:00
parent 190f23240a
commit 212c004d31
6 changed files with 28 additions and 4 deletions

View File

@ -97,6 +97,7 @@ namespace RageCoop.Client
/// </summary>
internal Dictionary<VehicleSeat, SyncedPed> Passengers { get; set; }
internal byte RadioStation = 255;
internal string LicensePlate { get; set; }
#endregion
internal override void Update()
@ -116,10 +117,7 @@ namespace RageCoop.Client
return;
}
#endregion
#region -- SYNC CRITICAL --
if (SteeringAngle != MainVehicle.SteeringAngle)
{
MainVehicle.CustomSteeringAngle((float)(Math.PI / 180) * SteeringAngle);
@ -333,6 +331,10 @@ namespace RageCoop.Client
}
}
if (Function.Call<string>(Hash.GET_VEHICLE_NUMBER_PLATE_TEXT, MainVehicle)!=LicensePlate)
{
Function.Call(Hash.SET_VEHICLE_NUMBER_PLATE_TEXT,MainVehicle,LicensePlate);
}
#endregion
}
LastUpdated=Main.Ticked;