140 Commits

Author SHA1 Message Date
Kakarot 74ac036d4a Refactor core structure and notification UI
Major refactor to centralize QBCore and replace the web UI stack:

- Move QBConfig into a unified QBCore.Config and initialize QBCore.PlayerData; add shared/functions.lua.
- Remove legacy client/main.lua and server/main.lua exports and update fxmanifest to include shared/functions and drop those main scripts.
- Update client event handling: adapt player data events to QBCore:Client:OnPlayerUpdated and trigger job/gang update events; remove deprecated exploitable handlers.
- Web UI rewrite: remove Vue/Quasar dependency and config module; implement a lightweight vanilla JS notification system (html/js/app.js) with updated html and css assets, plus drawtext tweaks.
- CSS overhaul for notification styling and animations; HTML head/meta/font cleanup.
- Server fixes: use QBCore.Shared.Locations in teleport command and strengthen numeric parsing/validation for coords.
- Add .gitattributes for consistent text/eol handling and small code cleanups (thread/comment removal).

These changes consolidate config/shared logic under QBCore, simplify the frontend dependencies, and fix a few parsing/event issues.
2026-05-19 18:13:35 -05:00
MrNewb b5ea0f7387 Add timeouts and validation to asset loaders
Enhance several asset-loading helpers in client/functions.lua to avoid indefinite blocking and provide explicit status. LoadModel, RequestAnimDict, LoadAnimSet, and LoadParticleDictionary now accept an optional timeout (default 5000ms), return a boolean load result and the resolved name/hash, and perform existence/validity checks before requesting. LoadModel also accepts string model names (converted via joaat) and logs a warning if the model doesn't exist. These changes make asset loading safer and easier to debug when assets fail to load.

Adds timeout as optional param, stops infinite loops on model/animset/anim dict/particle requests
No breaking changes and backwards compatable
2026-05-10 14:29:33 -04:00
Kakarot 9adb33b970 Core object filtering + exported functions/data
Maintains backwards compatibility and allows users to only get what they need from the core instead of importing it all
2025-01-25 00:36:31 -06:00
Cocodrulo 6f6bcf0321 Merge branch 'main' into feature/getname 2025-01-08 21:09:08 +01:00
Cocodrulo c3ad04d0c9 fix: Refactor GetName function to use QBCore namespace 2025-01-08 13:31:03 +01:00
Cocodrulo f553fe3f26 Add function to retrieve full character name 2025-01-08 13:27:48 +01:00
Cocodrulo 54261ecb4e Add function to retrieve player's full name from character info 2025-01-08 13:25:04 +01:00
Zerio d08d7bbeba chore: remove accidental automatic format changes 2025-01-07 07:21:50 +01:00
Zerio 8ab5f76bdf feat: simply funcref check 2025-01-07 07:20:53 +01:00
Zerio 8660c98d49 fix: wrong args passed 2025-01-06 21:41:53 +01:00
Zerio dc8fbf04e9 feat: use promises in callbacks + cleanup 2025-01-06 21:31:23 +01:00
James afb8eab8ed fix(client/vehProps): fix leaking bug by forcing tankHealth & oilLevel to be float vals 2024-11-24 20:18:16 +07:00
Zerio 36549a6cc9 fix: value assigned to variable 'turnSpeed' is unused 2024-05-25 21:14:44 +00:00
Zerio d203762b73 fix: lint issues 2024-05-25 21:10:01 +00:00
Kakarot d479831d0d server functions 2024-05-23 02:39:29 -05:00
EinS4ckZwiebeln 868600197d Optimizations 2024-03-28 12:56:32 +01:00
Kakarot 5c60c94197 Allow defining icon
- Adds warning class
2024-02-17 06:13:47 -06:00
Kakarot a4543646b4 Merge pull request #1062 from bfivem/main
refactor: small optimization
2024-02-10 17:41:33 -05:00
Man1C b485fe0a0d LookAtEntity
The QBCore.Functions.LookAtEntity function in Lua makes a player's character turn to face a specified entity in the game. It checks if the entity exists and if the input parameters are valid. It then calculates the direction to the entity and gradually adjusts the player's heading to match this direction. The function stops either when the player is facing the entity or when the specified timeout is reached.
2024-02-10 22:24:55 +00:00
Man1C b4c295f6ba Update functions.lua
forgot to remove the comment for local invoked = GetInvokingResource() and remove the hardcore variable
2024-02-10 22:03:12 +00:00
Man1C 3f33e3b09a Update functions.lua - PlayAnim
The runningAnim function is designed to play a specific animation for a player's ped (character) in FiveM. Here's a detailed breakdown of what the function does:

The function takes four parameters: animDict (the name of the animation dictionary), animName (the name of the animation within the dictionary), duration (the duration of the animation in milliseconds), and upperbodyOnly (a boolean indicating whether the animation should only affect the upper body of the ped).

It starts by creating a new promise, animPromise, which will be used to handle the asynchronous nature of loading and playing the animation.

The function then checks if animDict and animName are strings. If not, it rejects the promise with an error message and returns.

It checks if the animation dictionary exists. If not, it rejects the promise with an error message and returns.

It sets the animation flags based on the upperbodyOnly parameter. If upperbodyOnly is true, the flags are set to 16, otherwise, they are set to 0. If the duration is -1 (indicating the animation should loop indefinitely), the flags are set to 49.

It gets the player's ped and the current game time.

It enters a loop where it requests the animation dictionary and waits until it's loaded. If the dictionary isn't loaded within 5 seconds, it rejects the promise with an error message and returns.

Once the animation dictionary is loaded, it plays the animation on the player's ped using TaskPlayAnim.

It waits for a short time to allow the animation to start, then gets the duration of the animation using GetAnimDuration.

If the animation duration is 0 (indicating the animation doesn't exist), it rejects the promise with an error message and returns.

It calculates the full duration of the animation in milliseconds and sets the wait time to the minimum of the provided duration and the full duration.

It waits for the duration of the animation, then removes the animation dictionary.

Finally, it resolves the promise with the current time, indicating when the animation concluded.
2024-02-10 21:37:03 +00:00
Kakarot 4efc515fab Update support for rgb xenon 2024-01-08 01:20:58 -06:00
MoskalykA fb4cc3e113 refactor: small optimization 2023-12-21 20:17:32 +01:00
Kakarot 7314e8453f Natives 2023-09-23 15:35:54 -05:00
Kakarot 0ae843856f Merge pull request #935 from LRemp:main
bugfix: force clear vehicle custom colors before applying colors
2023-04-27 16:16:59 -07:00
Kakarot c1759f85cd Merge branch 'main' of https://github.com/qbcore-framework/qb-core 2023-04-27 17:34:54 -05:00
Kakarot 78bde5070a PR #963 2023-04-27 17:34:51 -05:00
Zerio 4ba2262a27 Improve code readability 2023-03-25 14:19:51 +01:00
Hakos47 6738c06d55 Update functions.lua 2023-03-23 15:02:35 +01:00
Hakos47 50d73ed52b fix lint failed
return material hash , entity hit, surfaceNormal, end coords, hit, and retval
2023-03-23 12:44:34 +01:00
Hakos47 66c88b51e0 GetGroundHash
returns the hash of the terrain you are on. quite useful for planting scripts
2023-03-23 12:29:46 +01:00
Hakos47 15a264c3c9 GetGroundHash
returns the hash of the terrain you are on. quite useful for planting scripts
2023-03-23 12:24:30 +01:00
LRemp 889196adf0 bugfix: force clear vehicle custom colors before applying standart vehicle colors 2023-01-29 17:20:25 +02:00
Spudgun 7b33f25210 update: common functions and weapon type info 2022-08-20 21:07:42 +12:00
BerkieBb d88e51ee4f Remove inventory code from the core (#784)
* tweak(config): remove inventory code

* tweak(client/functions): remove inventory code

* cleanup(server/commands): remove inventory command

* cleanup(server/events): remove hasitem callback

* cleanup(server/functions): remove inventory code

* cleanup(server/player): remove inventory code

* feat(server/player): QBCore:Player:SetPlayerData server side

Removed QBCore:Server:PlayerLoaded for PR that will be merged before me that adds it

* feat(server/player): QBCore:Server:OnGangUpdate

* fix(shared/items): remove duplicate snowball

* fix(server/events): warn for exploitable event

* fix(server/functions): startup error

* feat(server/player): some backwards compatibility

* fix(server/events): warn for exploitable event

* feat(server/player): Player.Functions.AddField

* feat(server/exports): SetField and AddField

* fix(server/player): inventory state check
2022-08-19 11:33:38 -05:00
NetOut 38ed80fed2 Fixed isnetworked (#764)
With the above way, the condition was always true because (false or true) is true or (nil or true) is true.

With this change it is fixed.
2022-07-23 16:01:23 +03:00
Niunisas 52cb62c3b2 Fix HasItem check if amount is provided and item not found (#741)
* fix(server/events): amount checking fix

* fix(client/functions): item checking fix
2022-06-30 20:20:45 +02:00
BerkieBb 4fc5e46d0b fix(client/functions): object amount parameter 2022-06-23 21:40:29 +02:00
Kakarot 5949d83cc1 Merge branch 'main' into patch-1 2022-06-18 14:01:13 -05:00
Jonas Suter f9161afe1a fixed wrong type 2022-06-18 09:51:36 +02:00
BerkieBb 483f14d66a feat(client/functions): client side hasitem check 2022-06-17 01:09:50 +02:00
ItsANoBrainer 7daf9f121a Merge branch 'main' into ClientCallbacks 2022-06-15 21:56:46 -04:00
ItsANoBrainer 46ba99291c [Feature] Client Callbacks
Creates support for utilization of Client Callbacks.
2022-05-04 21:18:38 -04:00
TheiLLeniumStudios db11c7dcec Fix linting issues 2022-05-04 08:08:29 +00:00
BerkieBb 00dba8864d chore(client/functions): remove QBCore.Functions.CreateBlip
- This function has an issue with some references of blips and the usage is not very user friendly, no need for this because local functions are better
2022-04-30 22:41:53 +02:00
Kakarot b73014a0aa Merge pull request #624 from HAMz-Project/patch-1
Add utility LoadAnimSet
2022-04-13 05:45:48 -07:00
Ilham Wicaksono 646c916b81 Add utility LoadAnimSet 2022-04-08 04:57:59 +07:00
Atikur Rahaman Santo bf0b3eef65 Neon color saving issue solved 2022-03-31 01:28:59 +06:00
ItsANoBrainer 52dc610c6c [Fix] Livery Mod Saving
- Fixed bug where livery mod would not save if it was set to default
2022-03-28 20:28:01 -04:00
Kakarot d0ea8571e3 Pull #521 2022-03-22 23:03:49 -05:00