Forum

> > CS2D > Scripts > In game ban list.
Forums overviewCS2D overview Scripts overviewLog in to reply

English In game ban list.

12 replies
To the start Previous 1 Next To the start

old In game ban list.

H-X
User Off Offline

Quote
hey guys if someone can make me a lua in which if i say !banlist and i get all the players list of ip's or USGN's which are banned.

old Re: In game ban list.

DarkBooy
User Off Offline

Quote
user H-X has written
hey guys if someone can make me a lua in which if i say !banlist and i get all the players list of ip's or USGN's which are banned.


Use Console this cmds IF you'r SERVER / RCON

cs2d cmd listbans
cs2d cmd bans

old Re: In game ban list.

H-X
User Off Offline

Quote
ya guys i know that but i have to open the console but if there is any kind of way that it comes like a message.I think you get my point that i don't need to open console.

old Re: In game ban list.

Rainoth
Moderator Off Offline

Quote
I can't think of any other way besides saving the players IP whenever the user is banned and then show the list when you write your command. If there's another,easier way then I'm sorry for my inexperience. I won't be doing what I said as I'm not a friend of saving/loading.

old Re: In game ban list.

EngiN33R
Moderator Off Offline

Quote
This won't get temporary bans because I couldn't find a way to get them other than through using the output of the cs2d cmd bans (cs2d cmd listbans) command, and I'm not really in the mood to do that right now.

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
27
28
29
addhook("say","getbanlist")
function getbanlist(id,txt)
	if (txt=="!banlist") then
		msg2(id,"----- List of Bans -----")
		local fh = io.open("sys/bans.lst","r")
		local bans = {}
		for line in fh:lines() do
			if line:sub(1,2)~="//" and #line>0 then
				local mode,value = line:gsub("(.+)\t\t(.+)")()
				local str = "* "
				if mode == "banusgn" then
					str = str .. "USGN ID #"
				elseif mode == "banip" then
					str = str .. "IP "
				elseif mode == "banname" then
					str = str .. "Name "
				end
				str = str .. value
				bans[#bans+1] = str
			end
		end
		msg2(id,"bans total: "..#bans)
		for _,v in ipairs(bans) do
			msg2(id,v)
		end
		fh:close()
		return 1
	end
end

old Re: In game ban list.

Dimas541
User Off Offline

Quote
@user EngiN33R: You give her the code there is an error
I was trying to use bots
I kept bans, and I wrote! banlist writing this only ----- List of Bans -----

Admin/mod comment

Please don't quote long posts. /EngiN33R

old Re: In game ban list.

EngiN33R
Moderator Off Offline

Quote
user Dimas541 has written
@user EngiN33R: You give her the code there is an error
I was trying to use bots
I kept bans, and I wrote! banlist writing this only ----- List of Bans -----

Well, as far as I checked, it didn't have any errors. Mind at least saying what the error text is, if there is any?

old Re: In game ban list.

MikuAuahDark
User Off Offline

Quote
user Dimas541 has written
@user EngiN33R: You give her the code there is an error
I was trying to use bots
I kept bans, and I wrote! banlist writing this only ----- List of Bans -----


Are you sure that there is also a "total bans: 0" message? if not then make sure that your CS2D have full-rights. If it's also showing "total bans: 0" then there is no banned players on your server

old Re: In game ban list.

omg
User Off Offline

Quote
yea, u cant really ban bots because theyre part of server. u have to ban an actual player. if u have dedicated server, u can actually ban urself and then remove the ban later
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview