Forum

> > CS2D > Scripts > Say looks not working
Forums overviewCS2D overview Scripts overviewLog in to reply

English Say looks not working

3 replies
To the start Previous 1 Next To the start

old Say looks not working

MikuAuahDark
User Off Offline

Quote
yes i want to create a script again, but it now work again. ok when i say !whitelist add and my usgn not listed that i can use that command it says You don't have access to this command so i put my USGN and say !whitelist add name [IGR]-Spying for you it doesn't say anything and im tired to call lua function wlsave() at console and it not save [IGR]-Spying for you at file whitelistname.txt. so here my 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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
-- Removed above
function removewlusgn(id,usgn)
	for num, val in pairs(whitelistt) do
		if usgn==val then
			whitelistt:remove(num)
			msg2(id,string.char(169).."000255000"..string.format(removeusgn,usgn))
		end
	end
end

function removewlname(id,name)
	for num,val in pairs(whitelistname) do
		if name==val then
			whitelistname:remove(num)
			msg2(id,string.char(169).."000255000"..string.format(removecmd,name))
		end
	end
end
-- Removed
addhook("say","addremovewl")
function addremovewl(id,txt)		-- Beware, ask me if you want to mix it with citylife
	if txt:sub(1,14)=="!whitelist add" then
		for num, val in pairs(whiteadd) do
			if player(id,"usgn")==val then
				if txt:sub(16,20)=="name" then
					names = txt:sub("22+")
					table.insert(whitelistname,names)
					msg2(id,string.char(169).."000255000"..addcmd:format(names))
				elseif txt:sub(16,20)=="usgn" then
					usgns = txt:sub(22)
					usgns = tonumber(usgns)
					table.insert(whitelistt,usgns)
					msg2(id,string.char(169).."000255000"..addusgn:format(usgns))
				end
			else
				msg2(id,string.char(169).."255000000"..nopermmsg)
			end
		end
	elseif txt:sub(1,17)=="!whitelist remove" then
		for num, val in pairs(whiteremove) do
			if player(id,"usgn")==val then
				if txt:sub(19,23)=="name" then
					names = txt:sub(25)
					removewlname(id,names)
				elseif txt:sub(19,23)=="usgn" then
					usgns = tonumber(txt:sub(25))
					removewlname(id,usgns)
				end
			else
				msg2(id,string.char(169).."255000000"..nopermmsg)
			end
		end
	end
	return 1
end

addhook("minute","wlsave")
function wlsave()
	files = {"",""}
	for num,val in pairs(whitelistt) do
		if val~=nil then
			files[1] = files[1]..val.."\n"
		end
	end
	for num,val in pairs(whitelistname) do
		if val~=nil then
			files[2] = files[2]..val.."\n"
		end
	end
	wl = io.open("sys/lua/whitelist/whitelist.txt","w+")
	wlname = io.open("sys/lua/whitelist/whitelistname.txt","w+")
	wl:write(files[1]:format())
	wlname:write(files[2]:format())
	wl:close()
	wlname:close()
	whitelistt = {}
	whitelistname = {}
	whiteadd = {}
	whiteremove = {}
	listwhitelist()
end
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview