Skip to content

Instantly share code, notes, and snippets.

@tabarra
tabarra / README.md
Created April 19, 2023 06:52
Listing FiveM/GTA5 vehicle model classes/types that diverge.

If you need to spawn a vehicle on the server side, you can use CreateVehicleServerSetter(), but the issue is that you need the vehicle type, but on the server there is no native to get it from a vehicle model.
In txAdmin this was initially "solved" by getting the vehicle class on the client and sending that to the server use it as a type when creating the vehicle. The logic used on the client is to check for the class on the vehClassNamesEnum table and assuming automobile for classes not on that table.

Later it was noticed that the server needs "type" instead of "class", and there is also no GetVehicleTypeFromName() on the client.
To solve this issue, it was created a lookup table to fix mismatched types.

This gist shows how to generate that table.
This must be run every now and then since new vehicles are added to the game on new DLC releases.

@tabarra
tabarra / admins.json
Last active September 27, 2024 04:47
Temporary admins file for txAdmin, please add it to txData/admins.json. The password is masterpassword123.
[
{
"name": "txmaster",
"master": true,
"password_temporary": true,
"password_hash": "$2a$12$JterWfFQx1abyi.OBKTIW.mOiHl7wrlyaTnz21SmygI20qO2xIdu2",
"providers": {},
"permissions": []
}
]