esx-framework / esx_core

Official Repo For core resources for esx-legacy
https://documentation.esx-framework.org/
GNU General Public License v3.0
368 stars 733 forks source link

[Feature Request] - esx_documentation - Add usage `ESX.RegisterPlayerFunctionOverrides(index, overrides)` and `ESX.SetPlayerFunctionOverride(index)` #1332

Closed Mesrine67 closed 3 months ago

Mesrine67 commented 7 months ago

Is it possible to add these functions to the documentation? example it is of little use to create this type of code:

RegisterCommand('setWounding', function(source)
    local xPlayer = ESX.GetPlayerFromId(source)
    xPlayer.setWounding('bonesOrBodyParts', {causeInfo = 'UPPER_BODY', state = 300, ...})
end, false)
RegisterCommand('getWounding', function(source)
    local xPlayer = ESX.GetPlayerFromId(source)
    print(xPlayer.getWounding('RFOOT', 'UPPER_BODY'))
    print(json.encode(xPlayer.getWounding(),{indent=true}))
end, false)
Gellipapa commented 5 months ago

@Mesrine67 Hi! Yes, this will be included in the documentation in the future. Thanks for the indication.

Mesrine67 commented 2 months ago

Wasn't this added to the documentation?

Gellipapa commented 2 months ago

Hi! @Mesrine67 You misunderstood the functionality of this, it's a very old development that was made to solve ox_inventory compatibility.

If you read through the implementation itself you will see that in this case you can't add anything else.

It only works if you don't use ox_inventory, but 98% of the servers use ox-inventory so they can never use this feature because then ox_inventory will not be compatible with es_extended.

So we have closed this issu until this is thought through, but for now we are not dealing with core stuff like this anymore because it is a legacy project and we are trying to focus on new stuff.