diff --git a/README.md b/README.md index 7b7ea0f..cf8b220 100644 --- a/README.md +++ b/README.md @@ -23,4 +23,25 @@ But I want this script to grow with help of others who know more about other cor The installation of this script is simple - it just needs to start before any script that requires it - it can start before core scripts if you want -- for `qb-core` I personally place this script in `resources > [standalone]` \ No newline at end of file +- for `qb-core` I personally place this script in `resources > [standalone]` + + +--- + +### Support for different exports and scripts + +In exports.lua is the list of script folder names + +This is for people who have customised/renamed scripts + +eg. for people who use `ps-inventory`, this is mainly based on qb-inventory +so you need to rename +```lua + QBInv = "qb-inventory", +``` +to +```lua + QBInv = "ps-inventory", +``` + +This will now use events from `ps-inventory` and use it through out the scripts. \ No newline at end of file diff --git a/functions.lua b/functions.lua index 4eb6ce5..4a7ff53 100644 --- a/functions.lua +++ b/functions.lua @@ -95,11 +95,26 @@ function makeProp(data, freeze, synced) end function cv(amount) - local formatted = amount + local formatted = amount or "0" while true do formatted, k = string.gsub(formatted, "^(-?%d+)(%d%d%d)", '%1,%2') if (k==0) then break end Wait(0) end return formatted end +function DrawText3D(x, y, z, text) + SetTextScale(0.35, 0.35) + SetTextFont(4) + SetTextProportional(true) + SetTextColour(255, 255, 255, 215) + BeginTextCommandDisplayText("STRING") + SetTextCentre(true) + AddTextComponentSubstringPlayerName(text) + SetDrawOrigin(x,y,z, 0) + EndTextCommandDisplayText(0.0, 0.0) + local factor = string.len(text) / 370 + DrawRect(0.0, 0.0 + 0.0125, 0.017 + factor, 0.03, 0, 0, 0, 75) + ClearDrawOrigin() +end + AddEventHandler('onResourceStop', function(r) if r ~= GetCurrentResourceName() then return end stopSpinner() @@ -287,7 +302,7 @@ function progressBar(data) lockInv(false) if data.cam then stopTempCam(data.cam) end end - + elseif Config.System.ProgressBar == "qb" then Core.Functions.Progressbar("mechbar", data.label, @@ -818,4 +833,4 @@ function StopEffects() -- Used to clear up any effects stuck on screen AnimpostfxStop('RaceTurbo') AnimpostfxStop('FocusIn') AnimpostfxStop('Rampage') -end +end \ No newline at end of file