pedr0fontoura / fivem-appearance

👀 A flexible player customization script for FiveM.
https://forum.cfx.re/t/release-fivem-appearance/2438537
MIT License
120 stars 72 forks source link

When cancel it removes all weapons! #84

Closed Kraleemil closed 1 year ago

Kraleemil commented 1 year ago

Hi i have the problem where if you cancel when you are in the editor. image Its like your ped gets respawned and you lose all your weapons

Kraleemil commented 1 year ago

@pedr0fontoura

Kraleemil commented 1 year ago

@pedr0fontoura

pedr0fontoura commented 1 year ago

Store player weapons before opening the customization and apply them after you exit it.

If players change their model while on customization the weapons are removed, and that's the general use case. I can't make a workaround on the script thinking about each specific use case.

Kraleemil commented 1 year ago

Store player weapons before opening the customization and apply them after you exit it.

If players change their model while on customization the weapons are removed, and that's the general use case. I can't make a workaround on the script thinking about each specific use case.

How can I do that in typescript, i haven't been coding in it before

pedr0fontoura commented 1 year ago

You don't need to make changes to the fivem-appearance source code.

This workaround should be done on your side, where you call the startPlayerCustomization export.

Something like:

local weapons = MyFrameworkFunctionToGetPlayerWeapons(PlayerPedId())

exports['fivem-appearance']:startPlayerCustomization(...)

MyFrameworkFunctionToApplyPlayerWeapons(PlayerPedId(), weapons)
Kraleemil commented 1 year ago

You don't need to make changes to the fivem-appearance source code.

This workaround should be done on your side, where you call the startPlayerCustomization export.

Something like:

local weapons = MyFrameworkFunctionToGetPlayerWeapons(PlayerPedId())

exports['fivem-appearance']:startPlayerCustomization(...)

MyFrameworkFunctionToApplyPlayerWeapons(PlayerPedId(), weapons)

Arhh you just want to do it that way, didn't even think about that