Im hopeless trying to run my script.
The only thread that I found which applies to me is here but it doesnt help.
I am using Windows 7 (x64) and the archive version of CS2D on D:/CS2D/.
When I run my script it just says:
parsing Lua autorun script 'sys/lua/autorun/botcontrolnew.lua'
Nothing else even though I added a bunch of hooks.
I tried it with autoexec folder, executing by server.lua and executing it manually with mp_luaserver.
In the thread above it was because of wrong parameters in the hooks. Im 100% sure that this is not the case (script is below).
I am able to run example scripts and a test script but not my botcontrolnew script.
My script config:
server.lua executes samples/advertise.lua
botcontrolnew.lua
At line 154 and more you can see all functions.
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
botCont = {} -- namespace --[[ 	bool: true - player can only pick their own bots, false - player can pick opponent bots as well ]] botCont.teamSensitive = false -- use 'true' for any kind of competitive gameplay --[[ 	bool: true - get the visual skin of the bot (NOT RECOMMENDED; glitchy), false - you probably wont get the skin that the bot had. (RECOMMENDED) ]] botCont.skinGet = false -- if you use 'true' you will respawn/die until you have the skin of the bot which can be an unlimit process --[[ 	int: max amount of tries (respawn & die) to get the skin of the bot if bcSkinGet is true! ]] botCont.skinTries = 4 -- if you use 0 you have unlimit tries (warning: in the worst case you will respawn & die forever) -- global vars local botCont.freeBots = {} 		-- all available bots that a player can use local botCont.busyBots = {} 		-- all already used bots (every entry has bot-id and player-id) local botCont.isNewBot = false 		-- true - bot was added/kicked/used in this round, false - no bot was added/kicked/used in this round local botCont.teamChange = {}		-- {id,team} structure, for bcTeamSensitive -- list functions function botCont.NewLists() -- saves all free bots in lists (trigger this function when you add bots) 	botCont.freeBots = {} 	for _,id in pairs(player(0,"tableliving")) do 		if (player(id,"bot")==true) and (botCont.IsBotPicked(id) == false) then 			botCont.freeBots[#botCont.freeBots + 1] = id 		end 	end end function botCont.IsBotPicked(bid) -- check if this bot ID is already picked by a player 	for i=1,#botCont.busyBots do 		if (botCont.busyBots[i][1] == bid) then 			return botCont.busyBots[i][2] -- return player id 		end 	end 	return 0 -- or 0 if nothing found end function botCont.IsPlayerPicked(id) -- check if this player id is actually a bot 	for i=1,#botCont.busyBots do 		if (botCont.busyBots[i][2] == id) then 			return botCont.busyBots[i][1] 		end 	end 	return 0 end -- outsource functions function botCont.CopyWeapons(id,id_source) 	for _,wpn in pairs(playerweapons(id)) do 		parse("strip "..id.." "..wpn) 	end 	for _,wpn in pairs(playerweapons(id_source)) do 		parse("equip "..id.." "..wpn) 	end 	parse("setweapon "..id.." "..player(id_source,"weapontype")) end function botCont.CopyWeapons2(id,wpn_array) 	for _,wpn in pairs(playerweapons(id)) do 		parse("strip "..id.." "..wpn) 	end 	for _,wpn in pairs(wpn_array) do 		parse("equip "..id.." "..wpn) 	end 	parse("setweapon "..id.." 50") end function botCont.SwapTeam(id) 	if (player(id,"team")==1) then 		parse("makect "..id) 		botCont.teamChange[#botCont.teamChange+1] = {id,1} 	elseif (player(id,"team")>=2) then 		parse("maket "..id) 		botCont.teamChange[#botCont.teamChange+1] = {id,2} 	elseif (player(bid,"team")==0) then 		if (math.random(0,1) == 0) then 			parse("makect "..id) 			botCont.teamChange[#botCont.teamChange+1] = {id,0} 		else 			parse("maket "..id) 			botCont.teamChange[#botCont.teamChange+1] = {id,0} 		end 	end end function botCont.ChangeStats(id1,id2) -- change whole stats-set (from bcCommands) of 2 players 	local botCont.cvalues 		= {	"maxhealth", 	"health", 	"armor", 	"money", 	"score", 	"deaths", 	"speedmod"} -- all important stats of a player 	local botCont.ccommands 	= {	"setmaxhealth",	"sethealth","setarmor",	"setmoney",	"setscore",	"setdeaths","speedmod"} -- all important commands to edit stats of a player 	local botCont.temp = {} 	for i=1,#botCont.ccommands do 		temp[i] = player(id1,botCont.cvalues[i]) 		parse(botCont.ccommands[i].." "..id1.." "..player(id2,botCont.cvalues[i])) 		parse(botCont.ccommands[i].." "..id2.." "..temp[i]) 	end end -- main functions function botCont.PickBotAuto(id) -- find bid automatic and then do BcPickBot(id,bid) 	local bid 	for i=1,#botCont.freeBots do 		if (botCont.freeBots[i] ~= nil) then 			bid = botCont.freeBots[i] 			table.remove(botCont.freeBots,i) 			botCont.isNewBot = true 			break 		end 	end 	botCont.PickBot(id,bid) end function botCont.PickBot(id,bid) -- try to let id pick bid 	if (bid == nil) or (id == nil) or (id == bid) then return end 	 	botCont.busyBots[#botCont.busyBots+1] = {bid,id} 	if (botCont.IsBotPicked(bid) == false) then 		if (player(id,"health") <= 0) then 			-- correct teams 			if (player(id,"team") ~= player(bid,"team")) then 				botCont.SwapTeam(id) 			end 			 			parse("spawnplayer "..id.." "..player(bid,"x").." "..player(bid,"y")) 			 			-- skin correction 			local botCount.counter = botCount.skinTries 			while (botCount.skinGet == true) do 				if (player(id,"skin") == player(bid,"skin")) then 					break 				else 					parse("killplayer "..id) 					parse("setdeaths "..id.." "..player(id,"deaths")-1) 					parse("spawnplayer "..id.." "..player(bid,"x").." "..player(bid,"y")) 					botCount.counter = botCount.counter - 1 					if (botCount.counter = 0) then 						break 					end 				end 			end 			botCont.ChangeStats(id,bid) 			botCont.CopyWeapons(id,bid) 			parse("killplayer "..bid) 			parse("setdeaths "..bid.." "..player(bid,"deaths")-1) 			msg2(id,char(169).."033222033Bot Control Script: You are now the bot.") 		else 			msg2(id,char(169).."200033033Bot Control Script: You need to be dead to do this!") 		end 	end end -- hook functions addhook("die","botCount.Hdie") function botCount.Hdie(id) 	local bid = botCount.IsPlayerPicked(id) 	if (bid > 0) then 		botCont.ChangeStats(id,bid) 		for i=1,#botCont.busyBots do 			if (botCont.busyBots[i][2] == id) or (botCont.busyBots[i][1] == bid) then 				table.remove(botCont.busyBots,i) 			end 		end 	end end addhook("leave","botCont.Hjoin_leave") addhook("join","botCont.Hjoin_leave") function botCont.Hjoin_leave(id) 	if (player(id,"bot") == true) then 		botCont.isNewBot = true 	end end addhook("startround","botCont.Hstartround") function botCont.Hstartround() 	for _, id in pairs(player(0,"tableliving")) do 		local bid = botCont.IsPlayerPicked(id) 		if (bid > 0) then 			-- Team Change 			if (botCont.teamSensitive == true) then 				for i=1,#botCont.teamChange do 					if (botCont.teamChange[i][1] == id) then 						botCont.SwapTeam(id) 						if (botCont.teamChange[i][2] == 0) then 							msg2(id,char(169).."200200200Bot Control Script: You aren´t Spectator anymore!") 						end 					end 				end 			end 			 			-- Weapon Change 			local botCont.temp = playerweapons(bid) 			botCont.CopyWeapons(bid,id) 			botCont.CopyWeapons2(id,botCont.temp) 		end 	end end addhook("startround_prespawn","botCont.Hstartround_prespawn") function botCont.Hstartround_prespawn() 	if (botCont.isNewBot == true) then 		botCont.NewLists() 		botCont.isNewBot = false 	end 	for i=1,#botCont.teamChange do 		if (botCont.teamChange[i] ~= nil) then 			botCont.SwapTeam(botCont.teamChange[i][1]) 		end 	end end addhook("serveraction","botCont.Hserveraction") function botCont.Hserveraction(id,b) 	if (b==1) then 		botCont.PickBotAuto(id) 	end end
Log
Server log has written
----- Server started -----
parsing Lua server script (mp_luaserver = 'server.lua')
Lua: Adding function 'sample.ads.join' to hook 'join'
Lua: Adding function 'sample.ads.minute' to hook 'minute'
parsing Lua autorun script 'sys/lua/autorun/botcontrolnew.lua'
parsing Lua autorun script 'sys/lua/autorun/test.lua'
Lua: Adding function 'test' to hook 'say'
Welcome on my Server, Player!
U.S.G.N.: Sending serverlist ADD-request...
U.S.G.N.: Server added to serverlist
Player joins the Counter-Terrorist Forces
100% WORKING
Player: hi
Server Shutdown
U.S.G.N.: Sending serverlist DELETE-request...
U.S.G.N.: Server removed from serverlist
----- Disconnected -----
parsing Lua server script (mp_luaserver = 'server.lua')
Lua: Adding function 'sample.ads.join' to hook 'join'
Lua: Adding function 'sample.ads.minute' to hook 'minute'
parsing Lua autorun script 'sys/lua/autorun/botcontrolnew.lua'
parsing Lua autorun script 'sys/lua/autorun/test.lua'
Lua: Adding function 'test' to hook 'say'
Welcome on my Server, Player!
U.S.G.N.: Sending serverlist ADD-request...
U.S.G.N.: Server added to serverlist
Player joins the Counter-Terrorist Forces
100% WORKING
Player: hi
Server Shutdown
U.S.G.N.: Sending serverlist DELETE-request...
U.S.G.N.: Server removed from serverlist
----- Disconnected -----
I have to admit that I didnt test this script until this state and now I can´t test it because the server won´t accept the script.
I already tried to delete some code but with no effect.
Do you have some idea what could be wrong?
Thank you for reading