SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Filterscripts > Includes

Reply
 
Thread Tools Display Modes
Old 18/04/2016, 05:38 PM   #1
OstGot
Gangsta
 
OstGot's Avatar
 
Join Date: Mar 2013
Location: Gomel, Belarus
Posts: 959
Reputation: 347
Default Admin System - admin system with many features

Admin System


This is the administration system that has a lot of opportunities and very simple and clear in use at the same time.

Features:
* Multi-level spectate system
* Panel for administrators when you click on a player in Tab
* General admin panel with items depending on the level
* Ability to specify several players in one command at once
* Messages of administration's actions are displayed only for administrators and the specified player
* Interaction with RCon (logged into RCon become administrators)
* Ability to cancel the last typed command
* Dynamic panel with suspected players

Commands:
Some commands allow you to enter keywords instead of parameters, for example, "/spec off" will do the same as the command "/specoff".
Also you can omit the parameters in some commands, so then the command will work on the one who typed it.
The commands will work on any cmd processor! (except rCmd).

HTML Code:
/report [text] - send an question/complaint to administration

Level 1:
/achat [text] - Admin chat
/ahelp - Help with admin commands
/showstats [id] - Show player's statistics
/answer [id] [text] - Respond on player's report
/apanel - Admin panel with all available commands
/admins - List of online administrators
/eject [id] - Remove player from vehicle

Level 2:
/spec [id] - Begin spectate player
/spawnveh [vehicle id] - Teleport vehicle to respawn
/(un)mute [id] [time] [reason] - Mute/unmute player
/asay [text] - Message: "Administrator: [text]"
/warn [id] [reason] - Give warn to player
/kick [id] [reason] - Kick player from the server
/(un)freeze [id] - Freeze/unfreeze player
/slap [id] [reason] - Slap player
/goto [id] - Teleport to player

Level 3:
/suspectlist - List of suspected players
/gethere [id] - Teleport player to yourself
/gotoveh [vehicle id] - Teleport to vehicle
/ban [id] [reason] - Ban player's account
/gmtest [id] - Check for infinite health
/spawn [id] - Teleport player to respawn
/unwarn [id] - Remove warn from player
/banip [IP] - Block IP address
/cc - Clear chat

Level 4:
/sethealth [id] [health] - Set health to player
/setarmour [id] [armour] - Set armour to player
/setmoney [id] [money] - Set money to player
/setskin [id] [skin id] - Set skin to player
/setint [id] [interior] - Set interior to player
/setvw [id] [number] - Set virtual world to player
/giveweapon [id] [weapon] [ammo] - Give weapon to player
/repairveh [vehicle id] - Repair vehicle
/unbanip [IP] - Unblock IP address

Level 5:
/getall - Teleport all to yourself
/setweather [number] - Set weather
/settime [hour] - Set time of day
/destroyveh [vehicle id] - Destroy vehicle
/veh [vehicle id] [color 1] [color 2] - Create vehicle
/sban [id] - Silent ban
/skick [id] - Silent kick
Functions:
If you have an accounts system, some functions below will be useful.

public OnPlayerBan(playerid, gaveid, bool:sban)
PHP Code:
Parameters:
playerid The ID of the player who will be banned
gaveid 
The ID of the player who gave a ban
sban 
- If the ban is silent (true) or not (false)

This callback does not return any values 
public OnPlayerKick(playerid, gaveid, bool:skick)
PHP Code:
Parameters:
playerid The ID of the player who will be kicked
gaveid 
The ID of the player who gave a kick
skick 
- If the kick is silent (true) or not (false)

This callback does not return any values 
public OnPlayerWarn(playerid, gaveid, count)
PHP Code:
Parameters:
playerid The ID of the player who will be warned
gaveid 
The ID of the player who gave a warn
count 
The amount of warnings that 'playerid' have at the moment (including last given)

This callback does not return any values 
IsPlayerAdminEx(playerid, lvl = 1)
PHP Code:
Parameters:
playerid The ID of the player whose admin level we want to check
lvl 
Players admin level we check (if not specifiedwill be equal to 1)

Returns 1 if the player have the admin level equal to or greater than specified in the 'lvl'
Returns 0 if the player does not have this admin level 
GetPlayerAdminLevel(playerid)
PHP Code:
Parameters:
playerid The ID of the player whose admin level we want to get

Returns the admin level of the specified player 
SetPlayerAdminLevel(playerid, lvl)
PHP Code:
Parameters:
playerid The ID of the player for which you need to set the admin level
lvl 
The admin level you want to set the player

Returns 1 
if the function executed successfully
Returns 0 
if the specified player is not connected
Returns 
-if the level is entered incorrectly 
SendMessageToAdmins(lvl, color, const msg[])
PHP Code:
Parameters:
lvl The admin level required to obtain this message
color 
The color of the message which will be sent
msg 
The string with the message

Always returns 1 
GetPlayerMuteTime(playerid)
PHP Code:
Parameters:
playerid The ID of the player whose remaining mute time you want to know

Returns the remained time of mute 
for the specified player in seconds (is not muted
SetPlayerMuteTime(playerid, time)
PHP Code:
Parameters:
playerid The ID of the player for which you need to set the mute time
time 
The mute time (in secondsyou need to set the player

Returns 1 
if the function executed successfully
Returns 0 
if the specified player is not connected
Returns 
-if the time is entered incorrectly 
AddPlayerInSuspectList(playerid)
PHP Code:
Parameters:
playerid The ID of the player which you want to add to the list of suspects

Returns 1 
if the function executed successfully
Returns 0 
if the specified player is not connected 
RemovePlayerFromSuspectList(playerid)
PHP Code:
Parameters:
playerid The ID of the player which should be removed from the list of suspects

Returns 1 
if the function executed successfully
Returns 0 
if the specified player is not connected 
UpdateSuspectList()
PHP Code:
Returns the number of removed players from the list 
Installation and use:
1. Download admsys.inc on the links below and copy in pawno\include
2. Open your gamemode and add to the beginning: "#include <admsys>", compile changed script
3. Optionally, you can add delivery of the admin rights to all administrators when they login (in the account load)

If you want to add saving of the admin rights after disconnecting, use SetPlayerAdminLevel function (see "Functions"), add it to your account load and GetPlayerAdminLevel function to account save.

If you want to add some actions when a player gets ban, kick or warn, add in your gamemode publics OnPlayerBan, OnPlayerKick and OnPlayerWarn.

If you want to see "the suspected players" in the panel with these suspects players, use the AddPlayerInSuspectList function to add the player to the list of suspects, and RemovePlayerFromSuspectList to remove.

Download:
MediaFire Pastebin (v2.6)

Changelog:
Code:
v2.6
* Added a shorter alternative names for several commands

v2.5
* Added an ability to display player connection messages for admins
* Added an ability to display kill list for admins (enabled by default)
* Define "SEND_ACTION_MSGS_TO_ALL" renamed to "ADMSYS_SEND_ACTION_MSGS_TO_ALL"
* Added alternative names for "/banip" and "/unbanip" commands ("/blockip" and "/unblockip")

v2.4
* Ability to define the settings before the include
* OnPlayerBan, OnPlayerKick and OnPlayerWarn are now called from all filterscripts
* Removed additional y_hooks support
* Minor improvements and bug fixes

v2.3
* SetPlayerAdminLevel and SetPlayerMuteTime functions now return -1 if the second argument is specified incorrectly

v2.2
* Fixed return values in some callback functions

v2.1
* Now when you spectate dead player you will still see him
* Chat cleaning now cleans chat for 30 messages
* Minor improvements

v2.0
* Added SetPlayerMuteTime function
* Added check of the admin level argument for SetPlayerAdminLevel function
* Fixed return values in some functions

v1.9
* Now administrator can apply the punishments to himself
* Added a prohibition of certain actions if the player is in spectator mode

v1.8
* Fixed bug with calling dialogs

v1.7
* Reduced the likelihood of coincidence dialog ids with ids in other fs/gm
* Fixed compilation error that occurred when trying to use it together with izcmd

v1.6
* Compatibility with y_hooks
* Compatibility with foreach
* Minor improvements

v1.5
* Added check for some commands (you can't give warn/kick/ban admins higher level)

v1.4
* Compatible with Nexius's Update Checker

v1.3
* Small optimization

v1.2
* "/kick" command is available for admin level 2
* Added the ability to display the administration's actions messages to all players
* Minor corrections in the localization

v1.1
* Minor improvements

v1.0
* Initial release
Bugs:
They are not found at the moment. If you find any bug - please let me know.

Thanks:
DeimoS, _leon_lacartez_ - ideas and suggestions
Magic_York, Vitalik_Gonsor, RobertoYork, TheHero, Error4o4 - testing

Enjoy using :)
__________________
aka Nexius
Don't want to always check for updates of my scripts?
Include it the last, after all others
Nexius's Update Checker

Last edited by OstGot; 04/06/2020 at 06:20 PM.
OstGot is offline   Reply With Quote
Old 18/04/2016, 05:59 PM   #2
Max_Andolini
Huge Clucker
 
Max_Andolini's Avatar
 
Join Date: Oct 2013
Posts: 318
Reputation: 37
Default Re: Admin System - admin system with many features

Nice job keep it up
Max_Andolini is offline   Reply With Quote
Old 18/04/2016, 06:01 PM   #3
Gammix
High-roller
 
Gammix's Avatar
 
Join Date: Jan 2015
Location: Canada
Posts: 1,773
Reputation: 858
Default Re: Admin System - admin system with many features

Better to be placed in Filterscripts section if you want more people to watch this. The only reason why i would create an admin system as an include is to let the user decide what dialogs they want to have. Create their own admin commands with the interface provided with the include and etc etc.

Also, the reason why we use ZCMD is to eliminate the use of strcmp, but your code does it wrong:
pawn Code:
if(!strcmp(cmd, "/report", true)) return admsys_cmd_report(playerid, params);
Instead you make it more slower than before by using strcmp and a callback both.
__________________

Follow me on Github: Donate on Paypal to show your support:

Gammix is offline   Reply With Quote
Old 18/04/2016, 06:07 PM   #4
OstGot
Gangsta
 
OstGot's Avatar
 
Join Date: Mar 2013
Location: Gomel, Belarus
Posts: 959
Reputation: 347
Default Re: Admin System - admin system with many features

Quote:
Originally Posted by Gammix View Post
Better to be placed in Filterscripts section if you want more people to watch this.

Also, the reason why we use ZCMD is to eliminate the use of strcmp, but your code does it wrong:
pawn Code:
if(!strcmp(cmd, "/report", true)) return admsys_cmd_report(playerid, params);
Instead you make it more slower than before by using strcmp and a callback both.
It is made specifically to the commands could work both with cmd processor, and without
Nevertheless, thanks for the tip)
__________________
aka Nexius
Don't want to always check for updates of my scripts?
Include it the last, after all others
Nexius's Update Checker
OstGot is offline   Reply With Quote
Old 18/04/2016, 06:33 PM   #5
Gammix
High-roller
 
Gammix's Avatar
 
Join Date: Jan 2015
Location: Canada
Posts: 1,773
Reputation: 858
Default Re: Admin System - admin system with many features

Quote:
Originally Posted by OstGot View Post
It is made specifically to the commands could work both with cmd processor, and without
Nevertheless, thanks for the tip)
So why not do it like ZCMD does? (literally copy and paste)
__________________

Follow me on Github: Donate on Paypal to show your support:

Gammix is offline   Reply With Quote
Old 18/04/2016, 06:42 PM   #6
OstGot
Gangsta
 
OstGot's Avatar
 
Join Date: Mar 2013
Location: Gomel, Belarus
Posts: 959
Reputation: 347
Default Re: Admin System - admin system with many features

Quote:
Originally Posted by Gammix View Post
So why not do it like ZCMD does? (literally copy and paste)
If you do so, then everything will be even slower..
Why: zcmd calls commands isn't directly but through CallLocalFunction that is much slower than a normal function call
__________________
aka Nexius
Don't want to always check for updates of my scripts?
Include it the last, after all others
Nexius's Update Checker
OstGot is offline   Reply With Quote
Old 18/04/2016, 07:27 PM   #7
Gammix
High-roller
 
Gammix's Avatar
 
Join Date: Jan 2015
Location: Canada
Posts: 1,773
Reputation: 858
Default Re: Admin System - admin system with many features

Quote:
Originally Posted by OstGot View Post
If you do so, then everything will be even slower..
Why: zcmd calls commands isn't directly but through CallLocalFunction that is much slower than a normal function call
Actually you are right, all time i though strcmp was slower than CallLocalFunction
Well but it won't stop people using ZCMD because it's easier than strcmp

There is no saving system, i won't recommend using SAMP's ban system since its so old, ugly and glitchy. Use your own BAN script. Its really easy to code a custom IP range ban using this maybe.
__________________

Follow me on Github: Donate on Paypal to show your support:

Gammix is offline   Reply With Quote
Old 18/04/2016, 07:47 PM   #8
aoEXE
Gangsta
 
Join Date: Dec 2013
Location: Japón
Posts: 789
Reputation: 39
Default Respuesta: Admin System - admin system with many features

your "include" concept is wrong...
aoEXE is offline   Reply With Quote
Old 18/04/2016, 08:04 PM   #9
HydraHumza
Gangsta
 
HydraHumza's Avatar
 
Join Date: Oct 2014
Posts: 626
Reputation: 130
Default Re: Admin System - admin system with many features

Nice one..
__________________
Quote:
Originally Posted by Kalcor View Post
The fact is, I am right. And if you think I'm wrong, you are wrong.
HydraHumza is offline   Reply With Quote
Old 25/04/2016, 12:40 PM   #10
OstGot
Gangsta
 
OstGot's Avatar
 
Join Date: Mar 2013
Location: Gomel, Belarus
Posts: 959
Reputation: 347
Default Re: Admin System - admin system with many features

New version v1.1

Changes:
Minor improvements
__________________
aka Nexius
Don't want to always check for updates of my scripts?
Include it the last, after all others
Nexius's Update Checker
OstGot is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[FilterScript] Cross Admin System V1.3 [updated] Anti Cheat(sscanf, dcmd,y_ini) and lots more ! No.1 Admin System CROSS_Hunter Filterscripts 9 20/07/2014 06:45 AM
[FilterScript] Cross Admin System V1.2 [updated] + Added IRC System + Anti Cheat(sscanf, dcmd,y_ini) No.1 Admin System CROSS_Hunter Filterscripts 21 02/01/2013 06:32 PM
[FilterScript] Cross Admin System V1.1 [updated] + Added V.I.P System(sscanf, dcmd,y_ini) No.1 Admin System CROSS_Hunter Filterscripts 8 10/09/2012 11:18 AM
[FilterScript] Cross Admin System V1.0 (sscanf, dcmd,y_ini) No.1 Admin System CROSS_Hunter Filterscripts 6 09/09/2012 12:01 PM


All times are GMT. The time now is 04:32 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.