[Feature]: Add duration to txAdmin:events:playerBanned
Scope
Developer API
Feature Description
Simple thing (I guess), if I ban someone for 2 days and I want to display it ingame, I can't show these 2 days. I'm just able to show when the player will be unbanned.
Use Case
I wanted to show bans of online players for the users (just because of transparency) and wanted to display the actual duration of the ban as well but was only able to display the date the ban will end.
Proposed Solution
No response
Additional Info
No response
what should be returned, duration in seconds or the input duration string (like 1 day, 2 week)?
Maybe the input should be like an object {multiplier: 2, unit: 'week'}?
Should this duration string be the english input or should we translate it?
There's plenty of things or ways we can return it, let me know what you think would be best.
Okay, so it should return it the way the banned player sees it which is (I think) translated and like "1 day".
Okay, for update v5.0 in the playerBanned event I'll likely:
- remove
targetparam in favor oftargetNetIdandtargetIds(array); - add
durationInputwhich will contain something likepermanentor2 days; - add
durationTranslatedwhich will contain the translated duration orpermanentor maybefalseidk, since we don't actually have a way to translate "permanent" into other languages.
Done, this is what the event data will look like (for banning an online player when locale = german):
