Installation & Configuration & Integration
Step By Step Installation
Step By Step Installation
Configuration
ConfigurationSet Framework
Translation
Integrate Exports
Integrate ExportsLast updated
Step By Step Installation
Configuration
Integrate ExportsLast updated
ensure baseevents # Install this one from https://github.com/lesimov/baseevents
ensure es_extended
ensure dusa_vehiclekeys
ensure dusa_lockpickConfig.Framework = "esx" -- esx / oldesx
Config.CustomFramework = true
function CustomFrameworkExport() -- Add the export here, as in the following example.
ESX = exports["es_extended"]:getSharedObject()
end
Config.PlayerLoadedExport = 'esx:playerLoaded'--- @param -- For customized dispatch, edit AlertPolice function below here.
function AlertPolice(type, vehicle)
if not AlertSend then
local chance = Config.PoliceAlertChance
if GetClockHours() >= 1 and GetClockHours() <= 6 then
chance = Config.PoliceNightAlertChance
end
if math.random() <= chance then
-- Integrate your own dispatch script here
-- exports['ps-dispatch']:VehicleTheft(vehicle)
-- Default
TriggerServerEvent('dusa_vehiclekeys:server:policeAlert', Config.Language['info']["palert"] .. type)
end
AlertSend = true
SetTimeout(Config.AlertCooldown, function()
AlertSend = false
end)
end
end----------------------------------------------------------------
---- TRANSLATION ----
----------------------------------------------------------------
Config.Language = {
['notify'] = {
ydhk = 'You don\'t have keys to this vehicle.',
nonear = 'There is nobody nearby to hand keys to',
vlock = 'Vehicle locked!',
vunlock = 'Vehicle unlocked!',
vlockpick = 'You managed to pick the door lock open!',
fvlockpick = 'You fail to find the keys and get frustrated.',
vgkeys = 'You hand over the keys.',
vgetkeys = 'You get keys to the vehicle!',
fpid = 'Fill out the player ID and Plate arguments',
cjackfail = 'Carjacking failed!',
vehclose = 'There\'s no close vehicle!',
alertowner = 'Leave my car you idiot!',
removedkey = 'Key removed successfully!',
},
['progress'] = {
takekeys = 'Taking keys from body...',
hskeys = 'Searching for the car keys...',
acjack = 'Attempting Carjacking...',
stelingkeys = 'Stealing Keys..',
hotwiring = 'Hotwiring..',
},
['info'] = {
skeys = '[H] - Hotwire',
tlock = 'Toggle Vehicle Locks',
palert = 'Vehicle theft in progress. Type: ',
engine = 'Toggle Engine',
},
['addcom'] = {
givekeys = 'Hand over the keys to someone. If no ID, gives to closest person or everyone in the vehicle.',
givekeys_id = 'id',
givekeys_id_help = 'Player ID',
addkeys = 'Adds keys to a vehicle for someone.',
addkeys_id = 'id',
addkeys_id_help = 'Player ID',
addkeys_plate = 'plate',
addkeys_plate_help = 'Plate',
rkeys = 'Remove keys to a vehicle for someone.',
rkeys_id = 'id',
rkeys_id_help = 'Player ID',
rkeys_plate = 'plate',
rkeys_plate_help = 'Plate',
}
}exports['dusa_vehiclekeys']:IntegrateKey(plate) exports['dusa_vehiclekeys']:IntegrateDynamically()exports['dusa_vehiclekeys']:AddKey(plate)exports['dusa_vehiclekeys']:RemoveKey(plate)exports['dusa_vehiclekeys']:HasKeys(plate)