Skip to content
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

IsThisModelA* incorrect return type #3002

Open
Scaarus opened this issue Dec 15, 2024 · 3 comments
Open

IsThisModelA* incorrect return type #3002

Scaarus opened this issue Dec 15, 2024 · 3 comments
Labels
bug triage Needs a preliminary assessment to determine the urgency and required action

Comments

@Scaarus
Copy link

Scaarus commented Dec 15, 2024

What happened?

When any of these functions are called when in the target vehicle, the return value is the number 1 instead of the boolean true. If you aren't in the target vehicle, the correct boolean false is returned.

I haven't actually tested every command, though I assume they're all the same. Tested Heli, Car, Boat, Bike.

Expected result

A boolean should always be returned, rather than mixing boolean and numbers.

Reproduction steps

  1. Enter a vehicle
  2. Run a resource with the following code
  3. See that the return values are false/boolean except for the type of vehicle you are in, which is 1/number.
local model = GetEntityModel(GetVehiclePedIsIn(PlayerPedId(), false))

print("Bicycle", IsThisModelABicycle(model), type(IsThisModelABicycle(model)))
print("Bike", IsThisModelABike(model), type(IsThisModelABike(model)))
print("Boat", IsThisModelABoat(model), type(IsThisModelABoat(model)))
print("Car", IsThisModelACar(model), type(IsThisModelACar(model)))
print("Heli", IsThisModelAHeli(model), type(IsThisModelAHeli(model)))
print("Jetski", IsThisModelAJetski(model), type(IsThisModelAJetski(model)))
print("Plane", IsThisModelAPlane(model), type(IsThisModelAPlane(model)))
print("Quadbike", IsThisModelAQuadbike(model), type(IsThisModelAQuadbike(model)))
print("Train", IsThisModelATrain(model), type(IsThisModelATrain(model)))
print("AmphibiousCar", IsThisModelAnAmphibiousCar(model), type(IsThisModelAnAmphibiousCar(model)))
print("AmphibiousQuadbike", IsThisModelAnAmphibiousQuadbike(model), type(IsThisModelAnAmphibiousQuadbike(model)))

Importancy

There's a workaround

Area(s)

Natives

Specific version(s)

Tested on FiveM 1604 Server 7290 and FiveM 3258 Server 12031

Additional information

No response

@Scaarus Scaarus added bug triage Needs a preliminary assessment to determine the urgency and required action labels Dec 15, 2024
@Scaarus
Copy link
Author

Scaarus commented Dec 15, 2024

Here's an image of the results for reference. Screenshot taken while in a boat.

image

@AvarianKnight
Copy link
Contributor

This is expected behavior and can't be changed without breaking compatibility.

@coalaura
Copy link

coalaura commented Dec 16, 2024

If you are doing boolean checks with the result you should still be able to as 1 would evaluate to true and false would still be false. Or you can do IsThisModelABoat(model) == 1 if you really want a boolean

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug triage Needs a preliminary assessment to determine the urgency and required action
Projects
None yet
Development

No branches or pull requests

3 participants