Closed TuK4z closed 5 months ago
u need to set the vehicle entity as parameter
That is strange, because in JS you can add model name and it's working.
Also with model working other natives like GetVehicleModelMaxTraction and GetVehicleModelAcceleration So if i send to UI info, i do't have created vehicle that's why with model name it was better.
GetVehicleModelMaxTraction and GetVehicleModelAcceleration accept hashes
but GetVehicleMaxBraking not
Also JS only accept vehicle or vehicleId
Ok maybe i was mistaken, i wont use it for now. In JS my code was:
for (let i = 0; i < data.length; i++) {
const modHash = alt.hash(data[i].Model);
data[i].Speed = (native.getVehicleModelEstimatedMaxSpeed(modHash) * 3.6).toFixed(0);
data[i].Acceleration = native.getVehicleModelAcceleration(modHash).toFixed(2);
data[i].Braking = native.getVehicleModelMaxBraking(modHash).toFixed(2);
data[i].Traction = native.getVehicleModelMaxTraction(modHash).toFixed(2);
//console.log("Breaking: " + data[i].Braking + " Traction: " + data[i].Traction)
}
now after migrating to C# that native stoped working.
I tried JS and c#, so error exists only in c# module. If use GetVehicleMaxBraking Native on some vehicles it throws and error
Reproduce: float braking = Alt.Natives.GetVehicleMaxBraking(Alt.Hash("Chino")); Alt.Log($"Chino braking: {braking}");