From 3d53d1c9f2df5ca83cd5a1ee00bffb1abe3c54ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonathan=20=C3=96hrstr=C3=B6m?= Date: Tue, 13 Mar 2018 12:34:44 +0100 Subject: [PATCH] version 1.0.1 You can now prevent mechanics to use the kit --- __resource.lua | 2 +- config.lua | 3 ++- server/main.lua | 8 +++++++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/__resource.lua b/__resource.lua index 67c059b..a592e5f 100644 --- a/__resource.lua +++ b/__resource.lua @@ -1,7 +1,7 @@ resource_manifest_version '44febabe-d386-4d18-afbe-5e627f4af937' description 'ESX Repairkit' -version '1.0.0' +version '1.0.1' client_scripts { '@es_extended/locale.lua', diff --git a/config.lua b/config.lua index 42e5ea8..043fa5c 100644 --- a/config.lua +++ b/config.lua @@ -2,5 +2,6 @@ Config = {} Config.InfiniteRepairs = false -- Should one repairkit last forever? Config.RepairTime = 15 -- In seconds, how long should a repair take? Config.IgnoreAbort = true -- Remove repairkit from inventory even if user aborts repairs? +Config.AllowMecano = false -- Allow mechanics to use this repairkit? -Config.Locale = 'sv' \ No newline at end of file +Config.Locale = 'en' \ No newline at end of file diff --git a/server/main.lua b/server/main.lua index ae063e0..d1ed146 100644 --- a/server/main.lua +++ b/server/main.lua @@ -6,7 +6,13 @@ ESX.RegisterUsableItem('repairkit', function(source) local _source = source local xPlayer = ESX.GetPlayerFromId(_source) - TriggerClientEvent('esx_repairkit:onUse', _source) + if Config.AllowMecano then + TriggerClientEvent('esx_repairkit:onUse', _source) + else + if xPlayer.job.name ~= 'mecano' then + TriggerClientEvent('esx_repairkit:onUse', _source) + end + end end) RegisterNetEvent('esx_repairkit:removeKit')