Server Talk > Scripting Releases
remoteNet |updated|
cooz:
Script Name: remoteNet
Script Description: script allowing to add subnets to admin list
Original Author: cooz
Core Version: 2.5.2
--- Code: ---var
i: integer;
remotenet,adminip,joinip: TStringArray;
function OnRequestGame(IP: string;State: integer):integer;
begin
remotenet:= split(ReadFile('remotenet.txt'),chr(13)+chr(10));
for i:=0 to arrayhigh(remotenet)-1 do begin
adminip:= split(remotenet[i],'.');
joinip:= split(IP,'.');
if((adminip[0]+adminip[1]+adminip[2])=(joinip[0]+joinip[1]+joinip[2])) then begin command('/admip '+IP); end;
end;
result := state;
end;
--- End code ---
notes:
you have to create remotenet.txt file and add to it IPs, example file could look like this:
127.0.0.*
10.0.0.*
192.168.10.*
notice that script use split() function so it won't work properly on current linux server version
[!!]warning, script used in incorrect way can cause security risks[!!]
that would be all,
EnEsCe:
Why dont you just use the MaskCheck function?
Or use StrPos instead of making your own function >_>
cooz:
sorry, i just made it for entertainment,
it was fun for me to create those functions
does it make script run slower?
i can rewrite it... but then it will look so simple, hehe
Frenchie:
Sweet just what I needed ;D
Good Work Cooz. ++
chrisgbk:
If you use this script, be aware of the possible security risks. Used wrongly, it's possible for people to get admin that you don't want.
Navigation
[0] Message Index
[#] Next page
Go to full version