Servergroup Limiter

Servergroup Limiter 0.2

No permission to download
This script simply restricts the amount of clients that can have a specific servergroup assigned.
Requested by @Sofaeinhorn22

must-have-permissions
"i_client_private_textmessage_power"
add/remove clients from servergroups

Features & Commands
count -> The actual number of clients with the limited servergroup. (or at least what the bot thinks to be the number of clients in the limited servergroup)

!resetSgCount-> Simply resets the datebase and sets the number of clients in the limited servergroup to 0.

!setSgCount 2-> Sets the number of clients in the limited group to 2, the number is changeable.. So f.e. if you write "!setSgCount 4" it will set the number of clients in the group to 4.
This is useful if the script bugged or you removed/added a servergroup while the client was offline. (When you remove/add a servergroup while the client or bot were offline, the bot dont get it, so you have to adjust the number with that command then.)

Note:
Here is what you can change via Sinusbot Webinterface

webinterface_servergroupLimiter.JPG

How does the script work:
First of all, I know this script is very nieche, it was requested, thats why I made it.
Due to the fact, that sinusbot cant simply ask how many clients are in a servergrup (on &offline) I had to work around this problem. You can set a command (f.e. !x), you can set a servergroup (f.e. VIP with the servergroupID 3020 and you can tell the script to how many users you want to restrict the group.

So, if a user writes !x to the bot, the bot will assign the restricted group to the user.
Whenever an online client removes or assigns this restricted servergroup to a client, the bot creates a datebase and adds +1 or -1 to it.
When you f.e. restricted the servergroup to 5, and there are already 5 users with that servergroup, the bot will remove the servergroup from a user whenever it gets assigned a 6. time.

The problem with this script, the bot doesn´t notice a remove/assign when you remove or assign the servergroup when the client is not on the server at the moment. This is why I added the command
"!setSgCount 2" so you can adjust the actual amount of users with the limited servergroup as you want.

Iam open for more ideas! Just learning.
Greetings


Everlike
Likes: Sofaeinhorn22
Author
Everlike
Downloads
10
First release
Last update
Rating
0.00 star(s) 0 ratings

More resources from Everlike