-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue with GetVehicleModelNumberOfSeats #986
Comments
Just tested it, and I have the same result. However, testing with the |
This seems like it would be somewhat expected behavior, if the model is in memory then it can get reliable information based on the actual model info, but if its not then it has to use the meta files which might be incorrect in some cases. const model = GetHashKey('kamacho');
setImmediate(async () => {
// will output 2, the model hasn't been loaded into memory
console.log(GetVehicleModelNumberOfSeats(model));
RequestModel(model)
while (!HasModelLoaded(model)) {
await Delay(0);
}
// will output 4, the model has been loaded into memory
console.log(GetVehicleModelNumberOfSeats(model));
SetModelAsNoLongerNeeded(model);
while (HasModelLoaded(model)) {
await Delay(0);
}
// will output 2, model is no longer in memory.
console.log(GetVehicleModelNumberOfSeats(model));
}) |
If the model seat data is in memory, it returns the valid number of seats; otherwise it will fall back to the number of seats in the vehicle model's layout. Similar behavior to natives like GetModelDimensions which will also only work properly if the model is loaded. |
Details on replicating the bug:
Spawn in
kamacho
.Call the
GetVehicleModelNumberOfSeats(vehicleModel)
function, where vehicleModel =GetHashKey('kamacho')
, the value returned is 4 - correct.Despawn the vehicle.
Redo step 2, the value returned is 2 - incorrect.
The text was updated successfully, but these errors were encountered: