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
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
cs2d = {} api = {} api.timer = {} function cs2d.timer (time, count, func, parameters) 	local timerfunction, timerargument, timerid = func .. ((parameters ~= nil and parameters:gsub (";", ""):gsub (" ", ""):gsub ("'", ""):gsub ("\"", "")) or ""), {}, 0 	 	for parameter in parameters:gmatch ("[^;]+") do 		if (type (tonumber (parameter)) == "number") then 			table.insert (timerargument, tonumber (parameter)) 		else 			table.insert (timerargument, parameter) 		end 	end 	 	for index, othertimer in pairs (api.timer) do 		if (othertimer[2] == timerfunction) then 			timerid = index 			 			break 		end 	end 	 	if (timerid == 0) then 		timerid = #api.timer + 1 		 		table.insert (api.timer, {func, timerfunction, timerargument, count}) 	end 	 	_G[timerfunction] = function (id) 		id = tonumber (id) 		api.timer[id][4] = api.timer[id][4] - 1 		 		if (api.timer[id][4] == 0) then 			_G[api.timer[id][2]] = nil 			api.timer[id] = nil 		elseif (timercount > 0) then 			_G[api.timer[id][1]] (unpack (api.timer[id][3])) 		end 	end 	 	return { 		start = function () 			timer (time, timerfunction, timerid, count) 		end, 		remove = function () 			if (api.timer[timerid] ~= nil) then 				freetimer (timerfunction) 				 				_G[timerfunction] = nil 				api.timer[timerid] = nil 			end 		end 	} end addhook ("spawn", "spawnhook") function spawnhook (id) 	local timer = cs2d.timer (1000, 1, "localfunction", id .. ";cs2d.timer finished@C") 	 	function localfunction (id, message) 		msg2 (id, message) 	end 	 	timer.start () 	timer.remove () end
Well when I spawn, after one second, CS2D suddenly close. There is no error message. Where is the problem?