Forum

> > CS2D > Scripts > Wrong Ban (lua)
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Wrong Ban (lua)

9 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Wrong Ban (lua)

limonata
User Off Offline

Zitieren
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

alt Re: Wrong Ban (lua)

D-D3ADxPro
User Off Offline

Zitieren
user limonata hat geschrieben
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.

alt Re: Wrong Ban (lua)

Xirot
User Off Offline

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

alt Re: Wrong Ban (lua)

Rainoth
Moderator Off Offline

Zitieren
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.

alt Re: Wrong Ban (lua)

Kirby7
User Off Offline

Zitieren
@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 >
3× editiert, zuletzt 03.06.13 16:33:14

alt Re: Wrong Ban (lua)

KimKat
GAME BANNED Off Offline

Zitieren
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.
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht