Skip to content

Commit

Permalink
weapon names (V1.0.1)
Browse files Browse the repository at this point in the history
  • Loading branch information
TonybynMp4 authored May 8, 2023
1 parent bf6dcd8 commit b22122c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Then

- [qbx-core](https://github.com/qbox-project/qbx-core) (Latest)
- [ox_lib](https://github.com/overextended/ox_lib)
- [ox_inventory](https://github.com/overextended/ox_inventory) (Used in gun related alerts to get the name of the weapon)
- [interact-sound](https://github.com/Qbox-project/interact-sound) (Comes with qbx-core and has sounds included)

## Preview
Expand Down
2 changes: 2 additions & 0 deletions client/exports.lua
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ local function DriveBy(vehicle)
class = vehdata.class,
plate = vehdata.plate,
gender = GetGender(),
weapon = math.random() <= 0.5 and exports.ox_inventory:getCurrentWeapon().label,
weaponclass = GetWeaponClass(GetSelectedPedWeapon(cache.ped)) or nil,
automatic = math.random() <= 0.5 and (automatics[GetWeapontypeGroup(GetSelectedPedWeapon(cache.ped))] or automatics[GetSelectedPedWeapon(cache.ped)])or false,
doors = vehdata.doors,
Expand All @@ -96,6 +97,7 @@ local function Shooting()
tencode = Config.TenCodes["shooting"].tencode,
location = GetLocation(GetEntityCoords(cache.ped)),
gender = GetGender(),
weapon = math.random() <= 0.5 and exports.ox_inventory:getCurrentWeapon().label,
weaponclass = GetWeaponClass(GetSelectedPedWeapon(cache.ped)) or nil,
type = 0,
automatic = math.random() <= 0.5 and automatics[GetWeapontypeGroup(GetSelectedPedWeapon(cache.ped))] or false,
Expand Down
7 changes: 6 additions & 1 deletion fxmanifest.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
fx_version 'cerulean'
game 'gta5'

version '1.0.0'
version '1.0.1'


shared_scripts {
Expand Down Expand Up @@ -29,4 +29,9 @@ files {
'html/*.js',
}

dependencies {
'ox_lib',
'ox_inventory'
}

lua54 'yes'
2 changes: 1 addition & 1 deletion html/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ function NewCall(Id, length, data) {
if (data.weapon || data.automatic || data.weaponclass) {
let style = `margin-right: .5vh;`
Call += `<div class="weapon information">`
if (data.weapon) { // need to find a *good* way to get the weapon name from the hash
if (data.weapon) {
Call += `<span class="fas fa-gun" style="${style}"></span> ${data.weapon}`
}
if (data.weaponclass) {
Expand Down

0 comments on commit b22122c

Please sign in to comment.