Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

admin2: Add GUI panel for mute#684

Draft
omar-o22 wants to merge 12 commits intomultitheftauto:master from
omar-o22:feature/add-GUI-mute
Draft

admin2: Add GUI panel for mute #684
omar-o22 wants to merge 12 commits intomultitheftauto:master from
omar-o22:feature/add-GUI-mute

Conversation

@omar-o22
Copy link
Contributor

@omar-o22 omar-o22 commented Sep 18, 2025
edited
Loading

Summary

  • This PR adds a proper mute system with a new GUI and fixes admin2: permanent mute from serial #108 .
  • Previously, mutes were just a toggle and expired on reconnect.
  • Now, admins can set a duration, and the mute duration only counts while the player is connected (it pauses if the player disconnects).

Preview:

image

Edited

I did a mention for issue 106 by mistake

Copy link
Contributor

@ArranTuna ArranTuna left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you close admin panel while the mute GUI is open, it doesn't close, and then after that I clicked close (with console) and GUI won't close.

Copy link
Contributor

Also it's not very user friendly if you want to set a custom time, say 1 month, right now you'd have to open calculator to see how many seconds are in a month. Nobody wants to mute someone for less than 1 minute anyway, so at least the box should be minutes not seconds, and or have different boxes, so you can put amount of seconds, minutes, hours, or days.

Fernando-A-Rocha reacted with thumbs up emoji

Copy link
Contributor

I agree mute duration should be minutes by default, but also allow other units of measurement for custom needs (seconds, hours..)

Copy link
Contributor Author

Alright, I’ll start working on the fix tonight.

Copy link
Contributor Author

If you close admin panel while the mute GUI is open, it doesn't close, and then after that I clicked close (with console) and GUI won't close.

It works correctly for me. can u explain more what u did?

Copy link
Contributor

You're right, what you have to do is, press mute twice, then close the panel and you're stuck with a second panel. So basically when you click mute, don't make another GUI if one already exists.

Copy link
Contributor

@jlillis jlillis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this quite resolves #108, as it mutes are not able to persist if the server or resource restarts. There will also need to be a new tab to view, modify, and delete existing mutes.

Copy link
Contributor Author

omar-o22 commented Sep 19, 2025
edited
Loading

I don't think this quite resolves #108, as it mutes are not able to persist if the server or resource restarts. There will also need to be a new tab to view, modify, and delete existing mutes.

I don't know where to save the data because admin2 saves some data in conf/***.xml and some in admin.db too
So should I save data in admin.db or create a new xml file?

Copy link
Contributor

You're right, what you have to do is, press mute twice, then close the panel and you're stuck with a second panel. So basically when you click mute, don't make another GUI if one already exists.

I don't know where to save the data because admin2 saves some data in conf/***.xml and some in admin.db too So should I save data in admin.db or create a new xml file?

Use this existing connection to admin.db:

connection = dbConnect("sqlite", "admin.db"),

And use the dbExec and dbQuery functions and use dbQuery call back function feature.

omar-o22 reacted with thumbs up emoji

- Added a new tab 'mutes'
- Created a new event for mute instead of "aPlayer"
- Saves the data in database
Copy link
Contributor Author

omar-o22 commented Sep 22, 2025
edited
Loading

Thanks for the review. I've included everything in the last commit,
I implemented mute duration in seconds, same as bans, since I reused the ban code as a base,
I'll create another PR to update ban dialog (adds radio boxes seconds, minutes, etc...) And update mute/ban details style soon

Copy link
Contributor

I added a mute on myself and don't see it in mutes tab and refresh button is disabled?

Copy link
Contributor Author

I added a mute on myself and don't see it in mutes tab and refresh button is disabled?

You need to update your acl.xml because I added some new access

<right name="general.tab_mutes" access="true"></right>
<right name="command.listmute" access="true"></right>

Copy link
Member

xLive commented Sep 22, 2025

I added a mute on myself and don't see it in mutes tab and refresh button is disabled?

You need to update your acl.xml because I added some new access

<right name="general.tab_mutes" access="true"></right>
<right name="command.listmute" access="true"></right>

New ACL rights need to be added to ACL.xml, otherwise the admin2 resource won’t add them with the rest of the rights on start.

Copy link
Contributor Author

I added a mute on myself and don't see it in mutes tab and refresh button is disabled?

You need to update your acl.xml because I added some new access

<right name="general.tab_mutes" access="true"></right>
<right name="command.listmute" access="true"></right>

New ACL rights need to be added to ACL.xml, otherwise the admin2 resource won’t add them with the rest of the rights on start.

Ty, I thought I should make a PR in mtasa-blue to update the ACL, but I didn’t see this file.

Copy link
Member

@Lpsd Lpsd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

As mentioned in Discord, may be nice to have an option/checkbox for muting player voice too, if that's possible.

omar-o22 and Fernando-A-Rocha reacted with thumbs up emoji
@omar-o22 omar-o22 marked this pull request as draft December 11, 2025 18:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@Lpsd Lpsd Lpsd approved these changes

@jlillis jlillis Awaiting requested review from jlillis jlillis is a code owner

@ArranTuna ArranTuna Awaiting requested review from ArranTuna

@qaisjp qaisjp Awaiting requested review from qaisjp qaisjp will be requested when the pull request is marked ready for review qaisjp is a code owner

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

admin2: permanent mute from serial

AltStyle によって変換されたページ (->オリジナル) /