Commit Graph

187 Commits

Author SHA1 Message Date
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
David Malchin ce216ad676 🎨 Rename locales and remove notify translation type 2022-08-21 23:48:45 +03:00
ChatDisabled c6403fdc4b client/events.lua 2022-08-21 18:28:17 +02:00
Spudgun 7b33f25210 update: common functions and weapon type info 2022-08-20 21:07:42 +12:00
David Malchin ee92e7f436 👕 Remove usage of source in client script 2022-08-19 22:51:05 +03:00
Kakarot 8fffc421bb Merge Dev (#794)
* [Update] Stuff and Things - Fix Exploit

- Update doors on teleport so they don't get stuck (requires my doorlock PR that creates a updateDoors() export
- Support for heading with TeleportToCoords event
- Support for teleporting to location name with /tp and a default file with locations to use
- Remove 'QBCore:Server:AddItem' event (requires PR to other resources that use it)
- Support for an array of items that do the same thing with QBCore.Functions.CreateUsableItem
- Player exists check before removing or adding permission
- Trigger OnPlayerUnload as a server side event too
- Player.Functions.GetMetaData function
- Added reason to money remove logs
- Set dirt level to 0 on /car vehicles

* Export to Event

* Deprecate instead of remove?

* Player+License verification fix

* Update events.lua

* Export change for qb-management

* [Hotfix] Errors after Merge

* [Change] src to source

* Prevent people using /me to troll

This prevents people using that /me troll with the huge font size and different colors.

* Remove DoorUpdate event

* Update client/events.lua

Co-authored-by: BerkieBb <82737367+BerkieBb@users.noreply.github.com>

* Update server/functions.lua

Co-authored-by: BerkieBb <82737367+BerkieBb@users.noreply.github.com>

* Adjustments for BB

* Linting

* fix(server/functions): use indexed variables

Co-authored-by: David Malchin <malchin459@gmail.com>

* chore(server/events): remove unnecessary _

Co-authored-by: David Malchin <malchin459@gmail.com>

* chore(server/events): remove unnecessary _'s

Co-authored-by: David Malchin <malchin459@gmail.com>

* chore(server/events): language

Co-authored-by: David Malchin <malchin459@gmail.com>

* chore(server/events): language

Co-authored-by: David Malchin <malchin459@gmail.com>

* chore(server/events): language

Co-authored-by: David Malchin <malchin459@gmail.com>

* chore(server/events): language

Co-authored-by: David Malchin <malchin459@gmail.com>

* chore(server/player): indentation

Co-authored-by: David Malchin <malchin459@gmail.com>

* [Chore] Remove Money

Removed repetitive code that made zero sense

* Update en.lua

* Update player.lua

* Update player.lua

* Update functions.lua

Co-authored-by: ItsANoBrainer <itsanobrainergg@protonmail.com>
Co-authored-by: Scullyy <51968381+Scullyy@users.noreply.github.com>
Co-authored-by: Idris Dev <IdrisDose@users.noreply.github.com>
Co-authored-by: Idris <idrisdev@gmail.com>
Co-authored-by: BerkieBb <82737367+BerkieBb@users.noreply.github.com>
Co-authored-by: David Malchin <malchin459@gmail.com>
Co-authored-by: Chris Usiak <christopher.usiak@oakland.k12.mi.us>
2022-08-19 11:48:39 -05: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
SuperDaniel 2120ce506d Update loops.lua (#749)
Correction of typographical error.

Co-authored-by: BerkieBb <82737367+BerkieBb@users.noreply.github.com>
2022-07-24 00:10:56 +03: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
David Malchin 7fab401ed2 Fix Styling (#758)
* style: ensure consistent indentation

* style: add spacing

* style: add newlines

* style: simplify html

* fix: update javascript indent size in contribution guidelines
2022-07-18 23:45:46 +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