Official Soldat Forums

Server Talk => Scripting Releases => Topic started by: freestyler on October 13, 2008, 10:42:19 am

Title: Master Lock
Post by: freestyler on October 13, 2008, 10:42:19 am
Name: Master Lock
Short description: Locks all admin commands with one master command
Author: fri (http://soldatcentral.com/index.php?page=profile&u=24)
Compile test: passed
Core version: 2.6.3
Hosted by: Soldat Central - http://soldatcentral.com/ (http://soldatcentral.com/)

Full description:
This script allows any admin to completely block administrative commands for all players, so they can't /kick or /ban anyone, change game password, modify time limit, etc. The only command that would work is the master one (default: /masterlock, I suggest changing it to something 'weird').
Of course it will work only against admins that don't have the access to script files.


'How do I block other scripts?'
If you want to make it affect other scripts, you have to put this code:

Code: [Select]
if CrossFunc([], 'MasterLock.Lock') = true then exit;
at the very beginning of OnCommand function in the specified script, so it will look like this:

Code: [Select]
function OnCommand(ID: Byte; Text: string): boolean;
begin
if CrossFunc([], 'MasterLock.Lock') = true then exit;
{ rest of the original script }
end;

thanks to DorkeyDear for help with CrossFunc.


(http://soldatcentral.com/images/download.gif) (http://soldatcentral.com/dl.php?id=58&act=1)
(Size 807 B)
- http://soldatcentral.com/index.php?page=script&f=58 -


** Script hosted by Soldat Central (http://soldatcentral.com/index.php?page=script&f=58)! Please visit the author's script page (http://soldatcentral.com/index.php?page=script&f=58) and rate this script **
Title: Re: Master Lock
Post by: UnknownSniper on October 13, 2008, 10:50:29 am
Nice script, but the head admin could just take the administrative powers from the person they're trying to block to save time, right? O.o
Title: Re: Master Lock
Post by: freestyler on October 13, 2008, 10:58:51 am
If that person knows the adminlog, taking administrative powers from him wouldn't solve the problem (you'd have to change adminlog manually through FTP and restart the server). This method is faster.
Title: Re: Master Lock
Post by: Iq Unlimited on October 13, 2008, 12:09:47 pm
Suggestion: Make it so that it blocks only certain commands via an .ini file.
Title: Re: Master Lock
Post by: Mr on October 14, 2008, 12:59:55 am
Suggestion: /masterlock ID
Or better: /masterlock Password ID