Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE]: Method to add more/custom death causes dinamicaly #858

Open
Bossman02 opened this issue Aug 2, 2023 · 5 comments
Open

[FEATURE]: Method to add more/custom death causes dinamicaly #858

Bossman02 opened this issue Aug 2, 2023 · 5 comments
Labels
enhancement New feature or request

Comments

@Bossman02
Copy link

Bossman02 commented Aug 2, 2023

Scope

Developer API

Feature Description

It would be nice to have a system with which to add new causes of death without having to modify the resource code and run the risk of losing those modifications in future updates by not remembering to reapply the addition

Use Case

Currently I can only think of the case of addon weapons, I don't know if there can be any other case of non-vanilla deaths that can be detected from the log system.

Proposed Solution

Adding this code to cl_logger.lua (i haven't tested it yet, it's only a concept)

local function addDeathCause(weapon, name)
    deathHashTable[GetHashKey(weapon)]=name
end

exports('addDeathCause',addDeathCause)

RegisterNetEvent('txAdmin:beta:addDeathCause')
AddEventHandler('txAdmin:beta:addDeathCause',addDeathCause)

Additional Info

No response

@Bossman02 Bossman02 added the enhancement New feature or request label Aug 2, 2023
@Mycroft-Studios
Copy link
Contributor

Death causes are defined by GTA

@Mycroft-Studios
Copy link
Contributor

Also, the proposed solution wouldn't work without the API system

@Bossman02
Copy link
Author

Death causes are defined by GTA

GTA only gives you the hash of the cause, and if this hash is not in the table used by txAdmin, the logger returns unknow, this snippet is to add more causes, mainly from addon weapons.

imagen

In this screenshot you can see that txAdmin does not recognize the addon weapon weapon_paintball.

imagen

I do not deny that the code is not the most suitable for the purpose.

@Mycroft-Studios
Copy link
Contributor

exports('addDeathCause',addDeathCause)

This would require the full API system since at the moment that would be triggered by exports.monitor not exports.txAdmin, aswell as tx has no control over how its used, which is not good.

and as far as im aware, the api will be full exports, not events :)

So, once the API system is completed and done, this could be a solution, yes :)

@Bossman02
Copy link
Author

Ok, now I understand what you mean, I put export because as far as I know it is safer, but also the events because it is what is being used at the moment, logically if this is implemented in the future API should use your system.

I really stated that it was a suggestion for the api because it was the most similar to what the suggestion is really for (web I understand that refers more to the web itself, and is not something for the menu)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants