txAdmin icon indicating copy to clipboard operation
txAdmin copied to clipboard

[FEATURE]: playerKicked event

Open PC1up opened this issue 2 years ago • 6 comments

Scope

Developer API

Feature Description

Hey there, just wanted to request that the txAdmin:events:playerKicked event is called before the player is kicked so you can at least check their player name. Right now only thing you can see is the player id but because the player is kicked first and then the event is emitted you can't get their player name

Use Case

Imma just use my case. I want to create a script logging all txAdmin actions in discord but I cant get the player name out of the event

Proposed Solution

Call event first, then kick player. Maybe like 10ms wait in between

Additional Info

No response

PC1up avatar Jun 06 '22 08:06 PC1up

Although I don't like the use case, I still think this is a reasonable request.

tabarra avatar Jun 06 '22 12:06 tabarra

Whats wrong about my use case :o

PC1up avatar Jun 06 '22 12:06 PC1up

One day I'll still write an entire docs page on why webhook-like usage of discord is absolutely stupid :)

tabarra avatar Jun 06 '22 12:06 tabarra

uh aight

PC1up avatar Jun 06 '22 12:06 PC1up

One day I'll still write an entire docs page on why webhook-like usage of discord is absolutely stupid :)

I know I've never commented or made a PR here, but thank you for stating that fact. Coming from a SysOps background where I'm used to do AI log analysis, log mining and alerting, it is an absolute nightmare with the fact that everything is logged to Discord. It's impossible to maintain, you can't do ANYTHING with the data but use Discord's subpar search, and that's ONLY if you were smart enough to put a keyword in the log event to search for it later. It's rate limited. It's slow. It's taxing.

But for this usecase, what's wrong with using the built-in CFX event? I use this to track crashes, player's name, character name, etc. As long as your framework keeps a table of active players and their player data... its never failed.

AddEventHandler('playerDropped', function(reason)
    --TriggerClientEvent('chatMessage', -1, '', { 255, 255, 255 }, '^2* ' .. GetPlayerName(source) ..' left (' .. reason .. ')')
end)

jnccloud avatar Jun 12 '22 12:06 jnccloud

But for this usecase, what's wrong with using the built-in CFX event? I use this to track crashes, player's name, character name, etc. As long as your framework keeps a table of active players and their player data... its never failed.

I just want the message to be logged when the player is kicked, not when he disconnects, crashes or anything else.

PC1up avatar Jun 17 '22 21:06 PC1up

Planned v5.0

tabarra avatar Oct 16 '22 10:10 tabarra

Actually not planed.
But i'll think about it.

tabarra avatar Oct 17 '22 12:10 tabarra