Forum

> > CS2D > Scripts > Wrong Ban (lua)
Forums overviewCS2D overview Scripts overviewLog in to reply

English Wrong Ban (lua)

9 replies
To the start Previous 1 Next To the start

old Wrong Ban (lua)

limonata
User Off Offline

Quote
Hi all i want to a script if it is possible to make.

I want to unban who banned last. For example i banned Player2. But it was wrong player. i will type "!remove" then
Only him ban will be remove. Thanks for your helps

old Re: Wrong Ban (lua)

D-D3ADxPro
User Off Offline

Quote
user limonata has written
Sorry, i couldnt understand you ?

He means he wants a script, when if someone accidently bans the wrong player, he will type !remove then that wrong player, (that he banned) will only be removed.

old Re: Wrong Ban (lua)

Xirot
User Off Offline

Quote
I'm not a scripter but while you're waiting for the scripters reply do this :
if you have the rcon's server type
Quote
/rcon unbanall

old Re: Wrong Ban (lua)

Rainoth
Moderator Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
function string.split(str,pat)
local t = {}
	for word in string.gmatch(str,pat or "[^%s]+") do
		t[#t+1] = word
	end
	return t
end

addhook("say","stuff")
function stuff(id,txt)
local words = txt:split()
	if player(id,"rcon") then
		if words[1]=="!banip" then
			if words[2] then
				parse("banip "..words[2])
				return 1
				local storedip = words[2]
			else
				msg2(id,"Invalid parameters!")
			end
		elseif words[1]=="!remove" then
			parse("unban "..storedip)
			return 1
		end
	end
end

My try. I was learning this recently so not sure if it would work but it should work as following :
• If player has entered rcon
• If he wrote in chat !banip AND ip of the player he wants to ban
• Last IP should be stored.
• If player who has entered rcon says "!remove" then the last stored IP should be unbanned.

I hope this works and will help you.
EDIT : In case you don't want it to be for rcon users you can change
1
if player(id,"rcon")
into
1
if player(id,"usgn")==YOURUSGN
But if you have many USGNs then you'll have to make a table. But I suppose you want it for yourself.

old Re: Wrong Ban (lua)

Kirby7
User Off Offline

Quote
@user Rainoth:
Your script won't work due to lines 16/17 ( you leave the function via return before you set the var and the var itself is local ).

Here is my script :
Spoiler >
edited 3×, last 03.06.13 04:33:14 pm

old Re: Wrong Ban (lua)

KimKat
GAME BANNED Off Offline

Quote
1
latest_ban = {[0] => {"id"=>#USGN_ID_HERE,"user"=>"Player",...}}
You could always log the latest ban into a array table or what not and use that table to unban a player. Try something like that.
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview