Skip to content

a few updates #128

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Open

a few updates #128

wants to merge 11 commits into from

Conversation

Mustachedom
Copy link

edited:

On Player Loaded event to set your health based on metadata ( this may cause people to fly in dead on first run if their metadata is 0, but will work fine after the first log)

Added event handler for on player drop server side to save their health as metadata

added functions file for quick functions like checking if dead, notifys, metadata for qb and qbx

rewrote shooting add stress logic
IsPedShooting requires a fast loop to accurately catch when a player is shooting. a 10% config chance could really be a 1% chance currently. 

I wrote it that when you have a non whitelisted weapon in hand it will check your overall ammo, then wait a second and check again.

it then will run the random chance. also added a config option for max shots before stress. so if its set to 5 you will gain stress on the 5th shot if the random chance rolled in your favor the rest of the times.

also if you shoot more than 5x a second it will math.floor the total bullets and divide by the max shots before stress and multiple the stress math by the sum. so 20 shots with 5 max shots will be like math.random(1,3) * 4

mainly for fast shooting weapons

changed the loop for grabbing data to send to Ui to grab metadata and ignore locals on load so you spawn with your actual health, thirst, stress, and hunger

added getFuel() function that hard checks if you are running ox_fuel, if not then it will check for Config.fuel as it currently does

Change no stress police config option to a table that searches by job **type** or you can put 'all' and it will disable stress for everyone


Ran a in pairs loop before stress loops start i.e. shooting, speeding, no buckle so if stress is disabled then it wont run those loops for no reason

changed qbcore add command functions and callbacks to ox_lib add command and callbacks

added notify function client and server sided to allow people to use either qb/ox/ps-ui notifications

edited readme to reflect new steps for install for qbox and qb ( as simple as uncommenting something out of a fxmanifest and changing a config option) 


-- Edits from @McKlean 

Config options for adding stress past vehicle spped for heli/plane/bikes

Config Option for SeatBeltSpeed that will cause the unbuckled sound to play only while going above that speed. No more beeping when sitting in the car parked and unbuckled

@Mustachedom
Copy link
Author

newly added

Config.PersistantArmor 

if true it will save peoples armor as metadata on Player Unload and set it when they come back in. if false it forces armor meta to 0 on player unload

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant