-
Notifications
You must be signed in to change notification settings - Fork 546
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
Spawn blimp crash #793
Spawn blimp crash #793
Conversation
When spawning a blimp it creates it with server setter "plane" instead of "heli" This is caused because somehow `GetVehicleClassFromName()` for blimp return plane type instead of heli, even though if you check it in the network object viewer (on normal blimps created by `CreateVehicle()`) - it will say its a heli. I see that the _solution_ for that issue for models such as `submersible` and `submersible2` is setting it specifically hardcoded, so I just added this model as well with the same solution.
Thanks for the PR! Also there are |
It crashing with both could be an issue with the native maybe? Since the docs define the types as: |
Hmm, that not making any sense to me because I checked (with runcode) it and it worked for me. |
Okay, I managed to get it working! The problem is that When I change my lines to |
Nice job. |
I removed the `GetHashKey()` native because `local model = data.model` is a string and not a hash. I also removed it from the submarines because I checked it and it didn't work on them either (spawning them as a boat), but unlike blimp, spawning submarines as boats won't crash the game. I fixed it anyway. I also added blimp2 and blimp3 to modelType `heli`
I have a better solution, if you would like to, instead of using the current solution which is depending on This is the list: |
I just talked to a FiveM dev that clarified that vehicle class is a totally different thing to vehicle type, and |
The reason Class was used, is because CFX just kinda forgot to add a native for getting said Type, the only one that exists is getting the type of an already spawned vehicle ( |
After a quick check, there is literally no native at all, for getting this exact type. Converting Model to Class to Type is literally the only non-hardcoded way it seems |
Having a server-sided native to get the vehicle type BEFORE the vehicle is spawned is not making any sense at all. The server can't know the vehicle type, because it is not containing the If there was a way to know the vehicle type in the server side, then they would have just change the |
@orel56000 that does not need to happen on the server side, it's actually the client which resolves the class (to be changed to type) before sending it to the server. |
Thanks @orel56000 for finding the issue.
When spawning a blimp it creates it with server setter "plane" instead of "heli" This is caused because somehow
GetVehicleClassFromName()
for blimp return plane type instead of heli, even though if you check it in the network object viewer (on normal blimps created byCreateVehicle()
) - it will say its a heli.I see that the solution for that issue for models such as
submersible
andsubmersible2
is setting it specifically hardcoded, so I just added this model as well with the same solution.