CreateVehicleServerSetter — RedM Natives
0x6AE51D4B · CFX · server
Equivalent to CREATE_VEHICLE, but it uses 'server setter' logic (like the former CREATE_AUTOMOBILE) as a workaround for reliability concerns regarding entity creation RPC. Unlike CREATE_AUTOMOBILE, this supports other vehicle types as well.
Parameters
| Name | Type | Description |
|---|---|---|
| modelHash | Hash | The model of vehicle to spawn. |
| type | char* | The appropriate vehicle type for the model info. Can be one of `automobile`, `bike`, `boat`, `heli`, `plane`, `submarine`, `trailer`, and (potentially), `train`. This should be the same type as the `type` field in `vehicles.meta`. |
| x | float | Spawn coordinate X component. |
| y | float | Spawn coordinate Y component. |
| z | float | Spawn coordinate Z component. |
| heading | float | Heading to face towards, in degrees. |
Returns
Vehicle