Forum
CS2D Scripts Auto ban for advertising ipAuto ban for advertising ip
24 replies1
2
3
4
2
3
4
addhook("say","check_for_ip") function check_for_ip(id,txt) 	if(string.find(txt,"%d+%.%d+%.%d+%.%d+")) then parse("banip "..player(id,"ip")) end end
EDIT: Changed to ban.
EDIT2: Corrected it for an error.
EDIT3: Re-corrected the same error.
edited 1×, last 14.07.11 03:48:18 pm
DannyDeth has written I haven't tested it, but I think it will work.
EDIT: Changed to ban.
EDIT2: Corrected it for an error.
EDIT3: Re-corrected the same error.
1
2
3
4
2
3
4
addhook("say","check_for_ip") function check_for_ip(id,txt) 	if(string.find(txt,"%d+%.%d+%.%d+%.%d+")) then parse("banip "..player(id,"ip")) end end
EDIT: Changed to ban.
EDIT2: Corrected it for an error.
EDIT3: Re-corrected the same error.
Thank you, DannyDeth I will testing your lua scirpt %d = Net mask? I never know net mask code at lua script
You get a ban too
Ooh, But there is changelog rights? So when someone get banned and they request unbanned at my forums, And they lieing I will not unban it, It just simplest way
loL why you do it @ @
No, it will not ban you if you type 'my KpD is 3.5', however it will ban you if you type something with 4 or more dots in it. ( because 1.1.1.1.1.1 still has 1.1.1.1 in it )
EDIT: and, if you want it to keep a log as well:
1
2
3
4
5
6
7
8
9
10
11
12
2
3
4
5
6
7
8
9
10
11
12
addhook("say","check_for_ip") function check_for_ip(id,txt) if(string.find(txt,"%d+%.%d+%.%d+%.%d+")) then 		log_advertiser(id,txt) 		parse("banip "..ip) 	end end function log_advertiser(id,txt) 	log_f = io.open("sys/lua/ip_advertisement/log.txt","a+") 	log_f:write("\nDetected IP advertisement from player ( ID: "..id.."; IP: "..player(id,"ip").."; USGN: "..player(id,"usgn").."; )\nPlayer said: "..txt.."\nPlayer was auto-banned.") end
edited 1×, last 15.07.11 10:25:18 am
DannyDeth has written
@2Fast4You:
No, it will not ban you if you type 'my KpD is 3.5', however it will ban you if you type something with 4 or more dots in it. ( because 1.1.1.1.1.1 still has 1.1.1.1 in it )
EDIT: and, if you want it to keep a log as well:
That way you can check if the player requesting an unban was doing IP adverts.
No, it will not ban you if you type 'my KpD is 3.5', however it will ban you if you type something with 4 or more dots in it. ( because 1.1.1.1.1.1 still has 1.1.1.1 in it )
EDIT: and, if you want it to keep a log as well:
1
2
3
4
5
6
7
8
9
10
11
12
2
3
4
5
6
7
8
9
10
11
12
addhook("say","check_for_ip") function check_for_ip(id,txt) if(string.find(txt,"%d+%.%d+%.%d+%.%d+")) then 		log_advertiser(id,txt) 		parse("banip "..ip) 	end end function log_advertiser(id,txt) 	log_f = io.open("sys/lua/ip_advertisement/log.txt","a+") 	log_f:write("\nDetected IP advertisement from player ( ID: "..id.."; IP: "..player(id,"ip").."; USGN: "..player(id,"usgn").."; )\nPlayer said: "..txt.."\nPlayer was auto-banned.") end
Woah, thanks alot for you newest lua script, btw I think this lua script have 1 bugs and cannot be fixed forever because Some of my moderator get banned because saying some of player ip I think now he is crying now because got banned
The code is inside the spoiler. Replace the 123 and 456 numbers with the USGN id's of ur mods. ( seperate them with commas. )
DannyDeth has written
The code is inside the spoiler. Replace the 123 and 456 numbers with the USGN id's of ur mods. ( seperate them with commas. )
The code is inside the spoiler. Replace the 123 and 456 numbers with the USGN id's of ur mods. ( seperate them with commas. )
Huuh, DannyDeath did you have a server? Because if you have a server maybe your server will be fun because you can make a lua script
And, yeah, this stuff is easy. You should see some of the other stuff I've written, haha.
DannyDeth has written
I run six servers on a WAN in South Africa, I might start hosting for the rest of the world, soon.
And, yeah, this stuff is easy. You should see some of the other stuff I've written, haha.
And, yeah, this stuff is easy. You should see some of the other stuff I've written, haha.
DannyDeath, for you it easy but for me? I dosen't understand lua script even i already learn it
String.match ---> "(.*).(.*).(.*).(.*)"
IF ---> (.*) <0 >256
No code shown, but you get the idea.
Apache uwu has written
Fail. you could do this...
String.match ---> "(.*).(.*).(.*).(.*)"
IF ---> (.*) <0 >256
No code shown, but you get the idea.
String.match ---> "(.*).(.*).(.*).(.*)"
IF ---> (.*) <0 >256
No code shown, but you get the idea.
I don't care about that, DannyDeath already give the lua script and it work well
dizziness has written
I don't care about that, DannyDeath already give the lua script and it work well
Apache uwu has written
Fail. you could do this...
String.match ---> "(.*).(.*).(.*).(.*)"
IF ---> (.*) <0 >256
No code shown, but you get the idea.
String.match ---> "(.*).(.*).(.*).(.*)"
IF ---> (.*) <0 >256
No code shown, but you get the idea.
I don't care about that, DannyDeath already give the lua script and it work well
Yay, users getting banned for having four periods in their messages! Don't be so ignorant - if there's something that could work better, you should use it.
EngiN33R has written
Yay, users getting banned for having four periods in their messages! Don't be so ignorant - if there's something that could work better, you should use it.
dizziness has written
I don't care about that, DannyDeath already give the lua script and it work well
Apache uwu has written
Fail. you could do this...
String.match ---> "(.*).(.*).(.*).(.*)"
IF ---> (.*) <0 >256
No code shown, but you get the idea.
String.match ---> "(.*).(.*).(.*).(.*)"
IF ---> (.*) <0 >256
No code shown, but you get the idea.
I don't care about that, DannyDeath already give the lua script and it work well
Yay, users getting banned for having four periods in their messages! Don't be so ignorant - if there's something that could work better, you should use it.
So can you edit it for me? I dosen't understand what that guy saying because I'm not a good scripter
Meh, you could write "hi.there.how.are" and it would probably ban you. There is no way to specify the content of a * wildcard in Lua.
DannyDeth has written
@Textual Content:
Meh, you could write "hi.there.how.are" and it would probably ban you. There is no way to specify the content of a * wildcard in Lua.
Meh, you could write "hi.there.how.are" and it would probably ban you. There is no way to specify the content of a * wildcard in Lua.
DannyDeth, This lua script is not working, so can you fix it?
Time to "flip over" the not_mod(id) function.
1
2
3
4
5
6
7
8
2
3
4
5
6
7
8
function not_mod(id) 	for i=0,#mods,1 do 		if player(id,"usgn")==mods[i] then 			return false -- Flipped 		end 	end 	return true -- Flipped end