Forum

> > CS2D > Scripts > License System 'I need License...
Forums overviewCS2D overview Scripts overviewLog in to reply

English License System 'I need License...

3 replies
To the start Previous 1 Next To the start

old Re: License System 'I need License...

Yasday
User Off Offline

Quote
This is a really simple version of what you want:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
for i = 1,32 do
	license[i] =false
end

adm = 123456

addhook([[say]],[[s]])
function s(id,txt)
	txt = string.lower(txt)
	if player(id,"usgn") == adm then
		if string.sub(txt,1,2) == "!g" then
			local pl = tonumber string.sub(txt,3)
			license[pl] = true
		elseif string.sub(txt,1,2) == "!t" then
			local pl = tonumber string.sub(txt,3)
			license[pl] = false
		end
	end
end

addhook([[leave]],[[l]])
function l(id)
	license[id] = false
end

old Re: License System 'I need License...

Cure Pikachu
User Off Offline

Quote
It won't work, as the loop isn't in a function.
Replace
1
2
3
for i = 1,32 do
	license[i] =false
end
with this
1
2
3
4
5
6
7
8
9
function initArray(i,x)
	local array = {}
	for m = 1 , i do
		array[m] = x
	end
	return array
end

license = initArray(32,false)
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview