open.mp forum
[Filterscript] Adminsystem - Printable Version

+ open.mp forum (https://forum.open.mp)
-- Forum: SA-MP (https://forum.open.mp/forumdisplay.php?fid=3)
--- Forum: Releases (https://forum.open.mp/forumdisplay.php?fid=13)
---- Forum: Filterscripts (https://forum.open.mp/forumdisplay.php?fid=30)
---- Thread: [Filterscript] Adminsystem (/showthread.php?tid=2360)



Adminsystem - T4125Gamer - 2023-02-25

After a long time, I felt like doing PAWN scripting again and really wanted to develop something again. But since I thought that a complete game mode is a bit too much, I decided to use filter scripts with different systems. My first among them is this admin system, which is bilingual. I tried to keep the system as dynamic as possible. I'll explain what that means below. Let's start with the basic settings.

1. Required Plugins
The sscanf plugin is required. This can be downloaded here.

2. Folders and files
In order for the filter script to run properly, some folders and files are necessary in the script files. This structure is also included in the ZIP file. The required files are created by the script if they do not exist. In this way, the original state can be restored if necessary.

[Image: 01%20Ordner%20Struktur.png]

/scriptfiles/adminsystem/playerAdmin.ini  - This is where it is saved which player has which admin level

/scriptfiles/adminsystem/rangNames.ini - This is where the rank names are stored

/scriptfiles/adminsystem/settings.ini - The releases and general settings are saved here

/scriptfiles/adminsystem/warnings.ini - This is where player warnings are saved

/scriptfiles/adminsystem/bans - This is where player bans are stored

/scriptfiles/adminsystem/logs - Daily updated logs are saved here. The format is adminLog_DATE.txt

/scriptfiles/adminsystem/support -The tickets created are saved here on a daily basis. The format is ticketlog_DATE.txt

3. Settings
As soon as the required folders have been created and the filter script has been loaded, you can start making the general settings. These can be viewed in-game using the /settings command. This command can only be used if you are logged in as RCON Admin. This is to prevent misuse of the settings.

[Image: 02%20Settings%20Menü%20EN.png]

1. Become an admin
If this menu item is selected, the current maximum admin level is assigned to the player

2. Edit admin ranks
The rank names of the individual admin ranks can be edited under this menu item.

[Image: 03%20Adminränge%20bearbeiten%20EN.png]

3. Edit max. admin ranks
The maximum admin level can be adjusted here. There is no upper limit here. All new admin ranks are automatically set to PLEASE CHANGE RANK NAME!.

[Image: 04%20Adminlevel%20bearbeiten%20EN.png]

4. Edit access level
This menu item can be used to specify which command is released for which rank. In this way, permissions can be changed while the server is running.

[Image: 05%20Zugriffsrechte%20EN.png]

5. General Settings
The basic settings for the admin system are made here.

MAX WARNINGS = Indicates the maximum number of warnings a player can have before being automatically kicked by the system.
STACK WARNINGS = Should the warnings be stacked? Here you can specify whether this should happen. If the warnings are not stacked, the player will be kicked from the server at, for example, the 4th warning. If stacking is activated, the player will only be kicked from the server after the 6th warning. (Default settings at MAX_WARNINGS)
LOSE WARNING TIMER = Indicates the time in which a warning is cleared.
LANGUAGE = This sets the language of the admin system. Currently there is DE (German) and EN (English)
SUPVEH MODEL = The model of the support vehicle, which can be created with /supveh, can be set here

[Image: 06%20Allgemeine%20Einstellungen%20EN.png]

4. Overview of the commands
Commands that normal users can use

/admins
Returns an overview of currently connected team members

/supchat [text]
Creates a support ticket

/endchat
Closes a support ticket

Commands for Administrators

/kick [playerid][reason]
Kicks a player from the server

/ban [playerid][reason]
Permanently bans a player from the server

/timeban [playerid][time in minutes][reason]
Bans a player for a certain amount of time.

/unban [playername]
Unbans a player

/tp [playerid][target playerid]
Teleports a player to another player

/freeze [playerid]
Freeze or unfreeze a player

/setint [playerid][interiorid]
Changes a player's interior

/setvw [playerid][virtualworld]
Changes a player's virtual world

/supveh
Spawns a support vehicle

/spectate [playerid]
A selected player is watched here. If you re-enter the command, the viewer mode is terminated

/sethealth [playerid][amount]
Sets a player's life to a certain value

/setarmour [playerid][amount]
Sets a player's armor to a specific value

/repveh
Repairs the current vehicle. The player must be in it for this

/setweather [weatherid]
Changes the current weather

/killall
Kill all players on the server

/resetveh
Resets all unoccupied vehicles on the server

/delveh [vehicleid]
Deletes a specific vehicle

/respawnveh [vehicleid]
Respawns a specific vehicle

/getvid
Returns the current ID of the vehicle you are in

/warn [playerid][reason]
Gives the selected player a warning

/eject [playerid]
Kicks a player out of a vehicle if they are in one

/ slap [playerid]
Knocks up the selected player by +8

/cc
Cleans up the chat

/makeadmin [playerid][level]
Gives a selected player a specific rank. MAX_ADMINRANG cannot be exceeded

/getticket [id]
This accepts an open ticket

/a [text]
This allows team members to communicate with each other

/spawnveh [model]
This spawns a new vehicle

/restartserver [time in seconds]
The server will restart after the specified number of seconds.

5. Download

Quellcode: https://pastebin.com/MezvVVug
DL Link: https://dl.t4125gamer.de/SAMP/tg_adminsystem.zip

If you notice any errors or if you want more functions, please let me know. I would be happy about a rating.