Events and functions - TrAsKiN/vehicles GitHub Wiki
-
vehicle:player:entered- vehicle: number
-
vehicle:player:left- vehicle: number
-
vehicle:player:fastened- message: string
-
vehicle:engine:failed- gForce: number
- time: integer
- message: string
-
vehicle:player:eject- velocity: vector3
Here is a list of useful functions. To use the functions, just call them in the following ways:
exports.<folder name>:<function>exports['<folder name>']:<function>
-
getLocale(): returns a table containing all texts in the selected language -
getSeatbeltStatus(): returns the status of the seat belt -
getSpeedLimit(): returns the speed limit in kilometers per hour -
getVehicleAhead(): returns the vehicle in front of the player -
hasGps(): returns if a gps is owned -
isLimited(): returns if the limiter is activated -
isVehicleEmpty(): returns if the vehicle is empty
-
engineToggle(vehicle, state, options): toggle engine status (options:{instantly = false, preventRestart = false, halt = nil --[[distance number]]}) -
registerFunction(name, data, entered, looped, exited): register main functions -
registerHasGps(callback): register callback indicating owned gps -
registerHasKey(callback): register the callback indicating if the player has the key of the vehicle in parameter -
resetLimiter(vehicle): reset the limiter -
overrideAuthorizedVehicles(vehicles): override the array of authorized vehicles (format:key-> hash key of the model,value-> boolean true for allowed (see original)) -
resetAuthorizedVehicles(): resets the table of authorized vehicles