Exports
Suggestions for Export Usage
When a player purchases or acquires a new vehicle, use the
GiveKeyVehicle
orGiveKeyPlate
exports to give them the key.In your garage scripts, use the
CheckKeyInIgnitionWhenSpawn
export. This way, if the player parked the vehicle with the key in the ignition, it will spawn in the same state. If they removed the key, it will already be with the player.For scripts where you don’t want the key to be removable from the ignition, such as jobs or driving schools, use the
SetNonRemoveableIgnition
export.
Client Exports
CheckKeyInIgnitionWhenSpawn
If the vehicle's key is in the ignition when the vehicle is stored in the garage, and you trigger this export when retrieving the vehicle, it will put the key back in the ignition.
You can use it to give keys in your garage script or different scripts
Note: Event 'vehiclekeys:client:SetOwner' in qb triggers this export
Parameters :
Name | Type | Description |
---|---|---|
vehicle | int | you don't have to use plate or vehicle data at the same time. just use one of them |
plate | string | you don't have to use plate or vehicle data at the same time. just use one of them |
SetNonRemoveableIgnition
You can use this export in situations where you don't want the vehicle's key to be removed. For example, if you have a farming job and you're spawning a vehicle, you can use this export to insert the key into the ignition, preventing the player from removing it!
Parameters :
Name | Type | Description |
---|---|---|
vehicle | int | Vehicle entity id |
bool | bool | if true, put it on, if false, take it remove |
GiveKeyPlate
Gives the player the vehicle key
Parameters :
Name | Type | Description |
---|---|---|
plate | text | Vehicle plate text |
isNew | boolen | If true, the vehicle's key id changes and old keys cannot be used |
GiveKeyVehicle
Gives the player the vehicle key
Parameters :
Name | Type | Description |
---|---|---|
vehicle | int | Vehicle entity id |
isNew | boolen | If true, the vehicle's key id changes and old keys cannot be used |
HaveKeyPlate
Returns data on whether the player has a key to the vehicle
Parameters :
Name | Type | Description |
---|---|---|
plate | string | Vehicle plate text |
HaveKeyVehicle
Returns data on whether the player has a key to the vehicle
Parameters :
Name | Type | Description |
---|---|---|
vehicle | int | Vehicle entity id |
KeyInIgnition
Returns data on whether the key is inserted in the ignition
Parameters :
Name | Type | Description |
---|---|---|
vehicle | int | Vehicle entity id |
SetKeyInIgnition
Inserts or removes the key in the ignition
Parameters :
Name | Type | Description |
---|---|---|
vehicle | int | Vehicle entity id |
bool | boolen | if true, put it on, if false, take it remove |
Server Exports
CheckKeyInIgnitionWhenSpawn
If the vehicle's key is in the ignition when the vehicle is stored in the garage, and you trigger this export when retrieving the vehicle, it will put the key back in the ignition.
You can use it to give keys in your garage script or different scripts
Parameters :
Name | Type | Description |
---|---|---|
netid | int | Vehicle Net Id (You don't have to use netid or vehicle data at the same time. just use one of them) |
entity | int | Vehicle Entity Id (You don't have to use netid or vehicle data at the same time. just use one of them) |
SetNonRemoveableIgnition
You can use this export in situations where you don't want the vehicle's key to be removed. For example, if you have a farming job and you're spawning a vehicle, you can use this export to insert the key into the ignition, preventing the player from removing it!
Parameters :
Name | Type | Description |
---|---|---|
netid | int | Vehicle Net Id (You don't have to use netid or vehicle data at the same time. just use one of them) |
entity | int | Vehicle Entity Id (You don't have to use netid or vehicle data at the same time. just use one of them) |
bool | bool | if true, put it on, if false, take it remove |
GiveKeyPlate
Gives the player the vehicle key
Parameters :
Name | Type | Description |
---|---|---|
src | int | Player source |
plate | text | Vehicle plate text |
isNew | boolen | If true, the vehicle's key id changes and old keys cannot be used |
KeyInIgnition
Returns data on whether the key is inserted in the ignition
Parameters :
Name | Type | Description |
---|---|---|
netid | int | Vehicle Net Id (You don't have to use netid or vehicle data at the same time. just use one of them) |
entity | int | Vehicle Entity Id (You don't have to use netid or vehicle data at the same time. just use one of them) |
SetKeyInIgnition
Inserts or removes the key in the ignition
Parameters :
Name | Type | Description |
---|---|---|
netid | int | Vehicle Net Id (You don't have to use netid or vehicle data at the same time. just use one of them) |
entity | int | Vehicle Entity Id (You don't have to use netid or vehicle data at the same time. just use one of them) |
bool | boolen | if true, put it on, if false, take it remove |
Last updated