Fahrzeugschlüssel-System
Fortschrittliches Fahrzeugschlüssel-System, kompatibel mit ESX und QBCore für FiveM-Server.
Video-Vorschau
Click to load video from YouTube. By watching, you agree to their privacy policy.
Vehicle Key System
Config file
--------------------------------------------------------------------
DUSADEV.TEBEX.IO
--------------------------------------------------------------------
Config = {}
--- @param -- Check https://lesimov.gitbook.io/dusa-docs for documentation
--------------------------------------------------------------------
FRAMEWORK
--------------------------------------------------------------------
Config.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'
--------------------------------------------------------------------
GENERAL
--------------------------------------------------------------------
Config.Progressbar = 'ox_lib' -- ox_lib / mythic / rprogress / progressbar / none
Config.LockNPCDrivingCars = true -- Lock driven NPC cars | true = locked | false = unlocked
Config.LockNPCParkedCars = true -- Lock parked NPC cars | true = locked | false = unlocked
Config.ToggleLockKey = 'L' -- Toggle lock default keybind
Config.EngineKey = 'G' -- On / Off engine default keybind
--- @param --IMPORTANT! ESX selection is for only newest ESX versions
-- if your ESX version isn't the newest one, use baseevents --> Dont forget to replace your baseevents with this one https://github.com/lesimov/baseevents
Config.Events = 'baseevents' -- esx / baseevents
Config.RemoveLockpickNormal = 0.5 -- Chance to remove lockpick on fail
Config.RemoveLockpickAdvanced = 0.2 -- Chance to remove advanced lockpick on fail
Config.LockPickDoorEvent = function()
local result = exports['dusa_lockpick']:startLockpick(5) -- 5 means try chance for lockpick minigame
LockpickFinishCallback(result)
end
--------------------------------------------------------------------
NOTIFICATION
--------------------------------------------------------------------
function Notification(message, type)
ESX.ShowNotification(message, type)
-- exports[qs-notify]:Notify(type, 3500, message)
-- exports[dusa_notify]:notify(message, type)
end
function ServerNotification(src, message, type)
TriggerClientEvent('qs-notify:Alert', src, message, 3500, type)
end
--- @param -- If you set this one ox_lib, go to fxmanifest and uncomment ox_lib line!
Config.TextUI = 'ox_lib' -- drawtext / ox_lib
--------------------------------------------------------------------
ALERT OWNER SCENARIO
--------------------------------------------------------------------
Config.AlertOwner = true -- Will spawn NPC to save his own vehicle when lockpick failed
Config.AlertChance = 100 -- Alert NPC vehicle owner chance
Config.PedTypes = { -- If you want to add new NPC model, you can add from here
`a_f_m_bodybuild_01`,
`a_m_m_mexcntry_01`,
`s_m_m_hairdress_01`,
`csb_cletus`,
`csb_anton`,
`a_m_y_hipster_03`,
`a_m_m_beach_01`,
}
--------------------------------------------------------------------
KEY FOB
--------------------------------------------------------------------
Config.EnableKeyFob = true -- Enable disable key fob
Config.FobKeybind = 'I' -- Keybind key
Config.FobDescription = 'Open Key Fob' -- Keybind desc
--------------------------------------------------------------------
HOTWIRE
--------------------------------------------------------------------
Config.HotwireChance = 50 -- Hotwiring chance (For hotwire minigame)
Config.TimeBetweenHotwires = 5000 -- Place a delay between hotwire attempts
Config.minHotwireTime = 1000 -- Define time in ms for min-max hotwire progressbar length
Config.maxHotwireTime = 5000
--------------------------------------------------------------------
CARJACKING
--------------------------------------------------------------------
Config.CarJackEnable = true -- Can players jack vehicles when a NPC inside? true or false
Config.CarjackingTime = 2500 -- Car Jack Progressbar Length
Config.DelayBetweenCarjackings = 5000 -- Place a Delay between jacking another car
Config.CarjackChance = { -- Ped will flee depends on this chances
['2685387236'] = 0.0, -- melee
['416676503'] = 0.99, -- handguns
['-957766203'] = 0.99, -- SMG
['860033945'] = 0.90, -- shotgun
['970310034'] = 0.90, -- assault
['1159398588'] = 0.99, -- LMG
['3082541095'] = 0.99, -- sniper
['2725924767'] = 0.99, -- heavy
['1548507267'] = 0.0, -- throwable
['4257178988'] = 0.0, -- misc
}
--------------------------------------------------------------------
POLIZEI ALERT
--------------------------------------------------------------------
Config.AlertCooldown = 10000 -- Will send alert defined ms later
Config.PoliceAlertChance = 0.75 -- Chance of alerting police at daytime
Config.PoliceNightAlertChance = 0.50 -- Chance of alerting police at night (times:01-06)
--- @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
--------------------------------------------------------------------
BERUF FAHRZEUGE
--------------------------------------------------------------------
Config.SharedKeys = { -- Share keys amongst employees. Employees can lock/unlock any job-listed vehicle
['police'] = { -- Job name
vehicles = {
'police', -- Vehicle model
'police2',
'police3',
},
},
['mechanic'] = {
vehicles = {
'towtruck',
},
},
}
--------------------------------------------------------------------
KLEINERE ANPASSUNGEN
--------------------------------------------------------------------
Config.ImmuneVehicles = { -- Defined vehicles will be protected for car jacking (May be useful for your car heist scripts)
'hauler2',
'stockade',
'rtxbumper'
}
Config.NoLockVehicles = { -- This vehicles can not be locked
--'vehiclename',
'rtxbumper'
}
Config.NoCarjackWeapons = { -- Blacklist weapons for car jacking
WEAPON_UNARMED,
WEAPON_Knife,
WEAPON_Nightstick,
WEAPON_HAMMER,
WEAPON_Bat,
WEAPON_Crowbar,
WEAPON_Golfclub,
WEAPON_Bottle,
WEAPON_Dagger,
WEAPON_Hatchet,
WEAPON_KnuckleDuster,
WEAPON_Machete,
WEAPON_Flashlight,
WEAPON_SwitchBlade,
WEAPON_Poolcue,
WEAPON_Wrench,
WEAPON_Battleaxe,
WEAPON_Grenade,
WEAPON_StickyBomb,
WEAPON_ProximityMine,
WEAPON_BZGas,
WEAPON_Molotov,
WEAPON_FireExtinguisher,
WEAPON_PetrolCan,
WEAPON_Flare,
WEAPON_Ball,
WEAPON_Snowball,
WEAPON_SmokeGrenade,
}
--------------------------------------------------------------------
ÜBERSETZUNG
--------------------------------------------------------------------
Config.Language = {
['notify'] = {
ydhk = 'Du hast keine Schlüssel für dieses Fahrzeug.',
nonear = 'Es ist niemand in der Nähe, dem du die Schlüssel geben könntest.',
vlock = 'Fahrzeug verriegelt!',
vunlock = 'Fahrzeug entriegelt!',
vlockpick = 'Du hast es geschafft, die Tür zu knacken!',
fvlockpick = 'Du hast es nicht geschafft, die Schlüssel zu finden, und bist frustriert.',
vgkeys = 'Du gibst die Schlüssel weiter.',
vgetkeys = 'Du bekommst die Schlüssel für das Fahrzeug!',
fpid = 'Gib die Player-ID und das Kennzeichen an.',
cjackfail = 'Autodiebstahl fehlgeschlagen!',
vehclose = 'Es gibt kein nahes Fahrzeug!',
alertowner = 'Lass mein Auto in Ruhe, Idiot!',
removedkey = 'Schlüssel erfolgreich entfernt!',
idnotvalid = 'Die von dir angegebene ID ist nicht gültig!',
},
['progress'] = {
takekeys = 'Entferne Schlüssel vom Körper...',
hskeys = 'Suche nach den Autoschlüsseln...',
acjack = 'Versuche den Autodiebstahl...',
stelingkeys = 'Stehle Schlüssel...',
hotwiring = 'Kurzschließen...',
},
['info'] = {
skeys = '[H] - Kurzschließen',
tlock = 'Fahrzeugverriegelung umschalten',
palert = 'Autodiebstahl im Gange. Typ: ',
engine = 'Motor umschalten',
},
['addcom'] = {
givekeys = 'Gib die Schlüssel an jemanden weiter. Wenn keine ID angegeben ist, gibt es an den nächstgelegenen Spieler oder an alle im Fahrzeug.',
givekeys_id = 'id',
givekeys_id_help = 'Spieler-ID',
addkeys = 'Füge Schlüssel zu einem Fahrzeug für jemanden hinzu.',
addkeys_id = 'id',
addkeys_id_help = 'Spieler-ID',
addkeys_plate = 'kennzeichen',
addkeys_plate_help = 'Kennzeichen',
rkeys = 'Entferne Schlüssel von einem Fahrzeug für jemanden.',
rkeys_id = 'id',
rkeys_id_help = 'Spieler-ID',
rkeys_plate = 'kennzeichen',
rkeys_plate_help = 'Kennzeichen',
}
}



