Skip to content

Commit

Permalink
refactor: remove seatbelt
Browse files Browse the repository at this point in the history
  • Loading branch information
TonybynMp4 authored Jan 10, 2024
1 parent 67ffedb commit 0681d00
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 330 deletions.
12 changes: 1 addition & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
##### This resource is now deprecated and will be deconstructed in future releases. No new code will be added.

# qbx_smallresources
Base scripts for QBox Core Framework :building_construction:
Base scripts for the QBox Core Framework :building_construction:

## Dependencies
- [qbx_core](https://github.com/Qbox-project/qbx_core)
Expand All @@ -15,24 +15,14 @@ Base scripts for QBox Core Framework :building_construction:
- Removal of GTA's default wanted system
- Weapon draw animations (normal/holster)
- Ability to add teleport markers (from a place to another place)
- Pointing animation with finger (by pressing "B")
- Seatbelt and cruise control
- Useable parachute
- Useable armor
- Weapon recoil (specific to each weapon)
- Tackle
- Calm AI (adjusting npc/gang npc aggresiveness)
- Race Harness
- /id to see the id
- Adjusting npc/vehicle/parked vehicle spawn rates
- Infinite ammo for fire extinguisher and petrol can
- Removal of GTA's default huds (weapon wheel, cash etc.)
- Automatically engine on after entering vehicle
- Discord rich presence
- Crouch and prone




## Installation
### Manual
Expand Down
281 changes: 0 additions & 281 deletions client/seatbelt.lua

This file was deleted.

39 changes: 1 addition & 38 deletions server/main.lua
Original file line number Diff line number Diff line change
@@ -1,40 +1,3 @@
RegisterNetEvent('tackle:server:TacklePlayer', function(playerId)
TriggerClientEvent('tackle:client:GetTackled', playerId)
end)

exports.qbx_core:CreateUseableItem('harness', function(source, item)
TriggerClientEvent('seatbelt:client:UseHarness', source, item)
end)

RegisterNetEvent('equip:harness', function(item)
local src = source
local player = exports.qbx_core:GetPlayer(src)

if not player then return end

if item.metadata.harnessuses == nil then
item.metadata.harnessuses = 19
exports.ox_inventory:SetMetadata(src, item.slot, item.metadata)
elseif item.metadata.harnessuses == 1 then
exports.ox_inventory:RemoveItem(src, 'harness', 1)
else
item.metadata.harnessuses -= 1
exports.ox_inventory:SetMetadata(src, item.slot, item.metadata)
end
end)

RegisterNetEvent('seatbelt:DoHarnessDamage', function(hp, data)
local src = source
local player = exports.qbx_core:GetPlayer(src)

local harness = exports.ox_inventory:Search(src, 1, 'harness')

if not player then return end

if hp == 0 then
exports.ox_inventory:RemoveItem(src, 'harness', 1, data.metadata, data.slot)
else
harness.metadata.harnessuses -= 1
exports.ox_inventory:SetMetadata(src, harness.slot, harness.metadata)
end
end)
end)

0 comments on commit 0681d00

Please sign in to comment.