I would like to get some help or idea how to create an admin jail script. I did a jail on my map and when somebody do something which break rules, i can put he into the jail, where he need to reach checkpoints, if he wants to decrease his time in the jail.. then of course he spawn at specific place, what i defined
Forum




Admin Jail Script
5 replies



I would like to get some help or idea how to create an admin jail script. I did a jail on my map and when somebody do something which break rules, i can put he into the jail, where he need to reach checkpoints, if he wants to decrease his time in the jail.. then of course he spawn at specific place, what i defined
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
CP = { 	{12,56}, 	{32,26} } adminjailsec = {26,27,28} function admseconds() for num, val in ipairs(adminjailsec) do random (adminjailsec) end end local admsec = admseconds() addhook("movetile","check") function check(id, x, y) 	for num, val in ipairs(CP) do 		if x==val[1] and y==val[2] then 		msg2(id, "You decrease your time in Adminjail with -"..admsec.." sec") 		end 	end end
btw it's not working
edited 2×, last 27.03.14 02:58:23 pm
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
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
function initarray (limit, value) 	local array = {} 	 	for rep = 1, limit do 		array[rep] = value 	end 	return array end jail = {} jail.seconds = {26, 27, 29} jail.chekpoints = { 	{12, 56}, 	{32, 26} } jail.second = initarray (32, jail.seconds[math.random (1, #jail.seconds)]) addhook ("movetile", "movetilehook") function movetilehook (id, x, y) 	for key, value in pairs (jail.checkpoints) do 		if (x == value[1] and y == value[2]) then 			msg2 (id, "You decrease your time spent in jail with " .. jail.second[id] .. " seconds") 		end 	end end
edited 1×, last 28.03.14 10:37:37 am



