Commit Graph

120 Commits

Author SHA1 Message Date
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
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
BerkieBb 8efd4266a5 fix(client/functions): error when progressbar is not started 2022-03-13 21:42:23 +01:00
BerkieBb e63d9f744d fix(client/functions): undefined variable 2022-03-13 20:44:17 +01:00
BerkieBb 4cf4030ad3 fix(client/functions): undefined variable
Co-authored-by: ItsANoBrainer <itsanobrainergg@protonmail.com>
2022-03-12 12:26:42 +01:00
BerkieBb 815ff542ac fix(client/functions): notify text type 2022-03-01 21:10:38 +01:00
BerkieBb 3da18e61ea chore(client/functions): remove unused variable 2022-03-01 20:50:40 +01:00
BerkieBb cc0ed41653 fix(client/functions): blip creation log and dubble if statement 2022-03-01 20:50:21 +01:00
BerkieBb 64b5ec4885 fix(client/functions): blip creation 2022-03-01 20:41:55 +01:00
BerkieBb d1e20143b1 Merge branch 'dev' into dev 2022-03-01 20:08:59 +01:00
BerkieBb 0ba5d9cb40 refactor!: cleanup and some features 2022-03-01 18:54:18 +01:00
Idris Dev a76a651379 feat (vehicles): Updated Missing Vehicle Properties
[Update] Missing Vehicle Properties
2022-03-01 18:20:48 +11:00
BerkieBb 31888996ab feat!: ace permission system 2022-02-24 21:58:49 +01:00
ItsANoBrainer cc43734a3c Use SetVehicleFuelLevel Native
Use SetVehicleFuelLevel on  QBCore.Functions.SpawnVehicle
2022-02-19 13:11:26 -05:00
ItsANoBrainer 66ca5a7bb7 Removed Legacyfuel usage 2022-02-19 12:56:44 -05:00
BerkieBb 3d3562a296 Merge branch 'dev' into dev 2022-02-19 12:54:19 +01:00
Liam Dormon 3b36f7e4e5 fix(client/functions): type checking for vectors (#430)
allows for cross scrt compatibility with newer functions
2022-02-19 17:39:50 +11:00
BerkieBb a5bb0c99ce tweak(functions): small changes 2022-02-18 10:07:19 +01:00
ItsANoBrainer 2c5253918b [Update] Missing Vehicle Properties
Added door state and window state.
2022-01-27 17:58:07 -05:00
ItsANoBrainer f7ef019d26 [Update] Missing Vehicle Properties
Added proper support for missing or unfinished vehicle property saving/getting:

- neons enabled/disabled
- tire health
- tire burst state
- tire burst completely
- oil level
- wheel size
- wheel width
- headlight color
- interior color
- modkit 17, 19, 21, 47, 49
- livery roof
- tankHealth

- Set LegacyFuel on setting fuel level
2022-01-27 14:32:14 -05:00
BerkieBb f69f68c7ce fix(client/functions): Return right result when with hasitem callback 2022-01-11 13:49:59 +01:00
Kakarot 206853b660 Merge pull request #396 from darknight2590/patch-13
attachProp function
2022-01-06 19:55:59 -06:00