diff --git a/client/exports.lua b/client/exports.lua index 737b0cd..4bfb7df 100644 --- a/client/exports.lua +++ b/client/exports.lua @@ -78,9 +78,9 @@ local function DriveBy(vehicle) class = vehdata.class, plate = vehdata.plate, gender = GetGender(), - weapon = math.random() <= 0.5 and exports.ox_inventory:getCurrentWeapon().label, + weapon = math.random() <= 0.5 and exports.ox_inventory:getCurrentWeapon()?.label or locale("general.unknown"), weaponclass = GetWeaponClass(cache.weapon) or nil, - automatic = math.random() <= 0.5 and (automatics[GetWeapontypeGroup(cache.weapon)] or automatics[cache.weapon])or false, + automatic = math.random() <= 0.5 and (automatics[GetWeapontypeGroup(cache.weapon)] or automatics[cache.weapon]) or false, doors = vehdata.doors, type = 0, color = vehdata.color, @@ -99,7 +99,7 @@ local function Shooting() tencode = tenCodes["shooting"].tencode, location = GetLocation(GetEntityCoords(cache.ped)), gender = GetGender(), - weapon = math.random() <= 0.5 and exports.ox_inventory:getCurrentWeapon().label, + weapon = math.random() <= 0.5 and exports.ox_inventory:getCurrentWeapon()?.label or locale("general.unknown"), weaponclass = GetWeaponClass(cache.weapon) or nil, type = 0, automatic = math.random() <= 0.5 and automatics[GetWeapontypeGroup(cache.weapon)] or false, diff --git a/client/main.lua b/client/main.lua index 85f61c8..85f4c8a 100644 --- a/client/main.lua +++ b/client/main.lua @@ -267,12 +267,13 @@ RegisterNetEvent("y_dispatch:client:AddBlip", function(coords, data, CallId) end) RegisterNetEvent('CEventMeleeAction', function(_, ped) + if not config.events.fight.enabled then return end if fightAntiSpam then return end fight(ped) end) AddEventHandler('CEventShockingGunshotFired', function(_, ped, _) - if not config.events.shotsfired then return end + if not config.events.shotsfired.enabled then return end if shotsfiredAntiSpam then return end shotfired(ped) end) diff --git a/fxmanifest.lua b/fxmanifest.lua index b184200..5c6fd31 100644 --- a/fxmanifest.lua +++ b/fxmanifest.lua @@ -4,7 +4,7 @@ game 'gta5' author 'Tonybyn_Mp4' description 'Dispatch resource for the Qbox framework' repository 'https://github.com/TonybynMp4/y_dispatch' -version '1.5.2' +version '1.5.3' ox_lib 'locale' shared_scripts {