English Wrong Ban (lua)

9 replies
Goto Page
To the start Previous 1 Next To the start
02.06.13 10:38:03 pm
Up
limonata
User
Offline Off
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
02.06.13 10:56:13 pm
Up
krabob
User
Offline Off
implying you're using a script to ban?
People help the people
02.06.13 11:00:40 pm
Up
limonata
User
Offline Off
Sorry, i couldnt understand you ?
02.06.13 11:03:43 pm
Up
D-D3ADxPro
User
Offline Off
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.
Revisiting after 4 years, and boy how much cs2d really changed.
02.06.13 11:51:34 pm
Up
krabob
User
Offline Off
user limonata has written:
Sorry, i couldnt understand you

okay I'm out
People help the people
03.06.13 12:24:09 am
Up
Xirot
User
Offline Off
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
#Discord CS2D Rework - https://discord.gg/pbhdVdj
03.06.13 09:19:48 am
Up
Rainoth
Moderator
Offline Off
Code:
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
Code:
1
if player(id,"rcon")
into
Code:
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.
03.06.13 02:12:02 pm
Up
Kirby7
User
Offline Off
@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
03.06.13 04:26:17 pm
Up
KimKat
GAME BANNED
Offline Off
Code:
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.
03.06.13 04:31:37 pm
Up
limonata
User
Offline Off
Thank you very much Kirby

@user KimKat: I couldnt understand what did u mean?
To the start Previous 1 Next To the start