CREATE_VEHICLE_SERVER_SETTER
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.
CFX
Signature
lua
CreateVehicleServerSetter(GetHashKey("..."), type, 0.0, 0.0, 0.0, 0.0)
-- returns VehicleParameters
| Name | Type | Description |
|---|---|---|
| Hash | The model of vehicle to spawn. | |
| 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`. | |
| float | Spawn coordinate X component. | |
| float | Spawn coordinate Y component. | |
| float | Spawn coordinate Z component. | |
| float | Heading to face towards, in degrees. |
Usage
lua
CreateVehicleServerSetter(GetHashKey("..."), type, 0.0, 0.0, 0.0, 0.0)Details
- Hash
- API set
- Source
- cfx
Source: cfx
