197 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 1cee09a394 Support partial player data updates
Add support for sending single-field player data updates to clients to reduce bandwidth. Added a new client event QBCore:Player:UpdatePlayerDataField that updates a single key on QBCore.PlayerData. Modified server QBCore.Player.CreatePlayer UpdatePlayerData to accept an optional key and value; when provided it triggers the new per-field client event, otherwise it falls back to sending the full player data. Updated various player functions to call UpdatePlayerData with specific keys (job, gang, metadata, money, etc.) instead of always triggering a full sync. Files changed: client/events.lua, server/player.lua.
2026-04-20 19:18:48 -05:00
Kakarot 6dbbfed6c7 Reduce client loop CPU usage; tweak Kick timing
Increase client loop default sleep from 0 to 1000 to avoid a tight busy-wait when the player is not logged in, reducing CPU usage. In server/functions.lua move the Wait(100) out of the inner Kick loop so the DropPlayer thread is spawned immediately and the short delay happens after the loop, improving timing and avoiding blocking behavior.
2026-04-20 18:51:33 -05: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
Christian J Bennett ba658d99a0 Fixed the hasKeys Export to return the value true of HasKeys 2025-01-21 12:04:58 -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 d7323ba147 fxdk handling + naming + duplicate license 2023-11-13 03:28:14 -06:00
Kakarot a73e878487 Weapon attachment rework 2023-11-03 09:40:35 -05:00
hakos 7775667139 fix-lint: client/events.lua:266:63: line contains trailing whitespace 2023-09-28 12:52:53 +02:00
hakos 8ea6644270 update shared at player connection 2023-09-28 12:32:57 +02:00
Kakarot 7314e8453f Natives 2023-09-23 15:35:54 -05:00
Kakarot e1deee88af Merge pull request #918 from DuoTheDev:main
Fix Taking Damage in Last Stand due to Hunger
2023-04-27 17:07:41 -07: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 2588e61e6f Merge branch 'main' into main 2023-04-27 16:12:47 -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
Mythic 2311af93b4 sets veh as mission entity to use delete native 2023-02-01 09:33:57 -08:00
LRemp 889196adf0 bugfix: force clear vehicle custom colors before applying standart vehicle colors 2023-01-29 17:20:25 +02:00
zwkf 68e64a7bec Merge branch 'main' into main 2023-01-26 02:02:28 +00:00
Charlie e6f5bf5ab6 Remove vehicle keys depdency from core (#920)
Co-authored-by: Zerio <54480523+Z3rio@users.noreply.github.com>
2023-01-18 17:17:15 +01:00
Duo 7f03857fe6 Add check for 'isinlaststand'
Prevents player taking damage from hunger after they are already downed.
2023-01-13 10:52:38 -08:00
KamuiKody c79a7b907a add baseevents back (#898) 2022-12-19 22:29:18 +01:00
R0adRa93 cc64ee38e8 Getting QB-Core ready for qb-jobs (#883)
Co-authored-by: Zerio <54480523+Z3rio@users.noreply.github.com>
2022-12-16 23:38:31 +01:00
KamuiKody ade0652ee2 fix variable 2022-09-04 23:05:02 -04:00
KamuiKody 8386143cd7 Framework Optimization
for optimization of other resources.
2022-09-04 22:51:27 -04:00