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
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
function totable(t,match) local cmd = {} if not match then match = "[^%s]+" end for word in string.gmatch(t,match) do table.insert(cmd,word) end return cmd end function init(m) local array = {} for i = 1, m do array[i]=0 end return array end prison = init(32) licznik = init(32) addhook('say','sayhook') addhook('spawn','spawnhook') addhook('second','secondhook') prisons = { 	[1] = {100,100}, 	[2] = {500,500}} function sayhook(id,txt) local p = totable(txt) local cmd = string.lower(p[1]) 	if (txt:sub(1,1) == "@" or txt:sub(1,1) == "!") and txt ~= "rank" then 		if cmd == "@prison" then 			local pl = tonumber(p[2]) 			local cell = tonumber(p[3]) 			local times = tonumber(p[4]) 			if pl ~= nil and cell ~= nil and times ~= nil then 				if player(pl,"exists") then 					parse("setpos "..pl.." "..prisons[cell][1].." "..prisons[cell][2]) 					prison[pl] = true 					licznik[pl] = times 				end 			end 		end 	end end function secondhook(id) 	if prison[id] == true then 		if licznik[id] > 0 then 			licznik[id] = licznik[id] - 1 		end 	end 	if licznik[id] == 1 then 		prison[id] = false 		licznik[id] = 0 		parse("killplayer "..id) 	end end
edited 1×, last 03.10.12 12:30:24 am