A simple plugin for Swiftly that implements an Admin System.
- Download the newest release.
- Everything is drag & drop, so I think you can do it!
- Setup database connection in
addons/swiftly/configs/databases.json
with the keyswiftly_admins
like in the following example:
{
"swiftly_admins": {
"hostname": "...",
"username": "...",
"password": "...",
"database": "...",
"port": 3306
}
}
Warning
Don't forget to replace the ...
with the actual values !!
- After installing the plugin, you need to change the prefix from
addons/swiftly/configs/plugins
(optional) and if you want, you can change the messages fromaddons/swiftly/translations
.
- To add admins on server, you need to add a new row in admin tables set in
addons/swiftly/configs/plugin/admins.json
respecting the following conditions:
steamid => SteamID 64 of the player
flags => The flags provided below (example: abcd)
immunity => A number greater or equal than 0
- Or, you can use
sw_admins add
in server console, respecting the following conditions:
steamid => SteamID 64 of the player
username => nickname of the player
flags => The flags provided below (example: abcd)
immunity => A number greater or equal than 0
group => Optional, Group Name
- Currently supported flags are the following:
Flag | Script Name | Description |
---|---|---|
a | ADMFLAG_RESERVATION | Reserved Slot |
b | ADMFLAG_GENERIC | Generic Admin; Access to u@ |
c | ADMFLAG_KICK | Kick players |
d | ADMFLAG_BAN | Ban players |
e | ADMFLAG_UNBAN | Unban players |
f | ADMFLAG_SLAY | Slay |
g | ADMFLAG_CHANGEMAP | Change map |
h | ADMFLAG_CONVARS | Change server cvars |
i | ADMFLAG_CONFIG | Executes commands over plugin specific config files |
j | ADMFLAG_CHAT | Access to private say, center say, etc. |
k | ADMFLAG_VOTE | Creates a vote on server |
l | ADMFLAG_PASSWORD | Changes server's password |
m | ADMFLAG_RCON | Use RCON commands |
n | ADMFLAG_CHEATS | Changes sv_cheats and allows to use cheating commands (noclip, etc) |
z | ADMFLAG_ROOT | Access to everything |
o | ADMFLAG_CUSTOM1 | Custom Flag 1 |
p | ADMFLAG_CUSTOM2 | Custom Flag 2 |
q | ADMFLAG_CUSTOM3 | Custom Flag 3 |
r | ADMFLAG_CUSTOM4 | Custom Flag 4 |
s | ADMFLAG_CUSTOM5 | Custom Flag 5 |
t | ADMFLAG_CUSTOM6 | Custom Flag 6 |
The following exports are available:
Name | Arguments | Description |
---|---|---|
HasFlags | playerid, flags | Checks if a player has the flags provided in the second argument |
GetImmunity | playerid | Returns the immunity of the player |
HasAdminGroup | playerid, group | Checks if a player has the group provided in the second argument |
GetAdminGroup | playerid | Returns the group of the player |
RegisterMenuCategory | translation_id, command, flag | Registers a menu category inside !admin and returns an option id |
UnregisterMenuCategory | id | Unregisters a menu category from !admin |
- Base commands provided by this plugin:
Command | Flag | Description |
---|---|---|
!admins | CONSOLE | Admins Manager command. |
!groups | CONSOLE | Groups Manager command. |
!admin | b | Admin Menu command. |
- Fork the Project
- Create your Feature Branch
- Commit your Changes
- Push to the Branch
- Open a Pull Request
Join Swiftly Discord Server and send a message in the topic from 📕╎plugins-sharing
of this plugin!