Skip to content

Commit

Permalink
Fix shots fired (#21)
Browse files Browse the repository at this point in the history
* fix shots fired exports & events

* yeet print

* update manifest version
  • Loading branch information
TonybynMp4 authored May 21, 2024
1 parent ee1543b commit f3ff7a2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
6 changes: 3 additions & 3 deletions client/exports.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down
3 changes: 2 additions & 1 deletion client/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion fxmanifest.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit f3ff7a2

Please sign in to comment.