edited 2×, last 30.06.13 07:06:58 pm
Forum
CS2D Scripts [solved] Spawn ct-bot with id 15[solved] Spawn ct-bot with id 15
7 replies 1
1
2
3
4
5
6
7
8
9
2
3
4
5
6
7
8
9
_player=player function player(id,value) 	if value:lower()=="ip" and player(id,"bot") then 		return "4.4.4.4" 	else 		return _player(id,value) 	end end
A call on `player(2,"ip")` where a bot is taking up slot 2 would return an IP address of `4.4.4.4`.
Viewing the scoreboard (default: tab) would still indicate that the bot is a bot, there is no way around that.
Is it possible that you are actually talking about the player ID? You can't assign player IDs manually. The game allocates them automatically. Just keep your scripts flexible and use variables for the IDs.
You could make the game allocate ID 15 by adding/kicking players so the next free ID is 15. It doesn't make much sense to do something like this though.
the spacial id is just because i need a ct-bot, so that the players all can be tt and the script uses the id for tabels. i don't want that the bot get a place in such a table...
But maybe i change it.
1
if not player(id,"bot") then
no, i asked to spawn a bot with a spacial id
just like in this thread i now had seen other thread
Well that's just easy, check out of all the players who is not a bot.
Believe in the force, Luke.
i think you understand me wrong, and your magic is made from the dark side. i won't use it i decided.
here is my solution:
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
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
addhook("startround_prespawn","_startround_prespawn") function _startround_prespawn(mode) add_id_ct_bot(15) end function add_id_ct_bot(pos) 	if player(pos,"exists") then 		if player(pos,"bot") and player(pos,"team")==2 then 			for _,id in pairs(player(0,"table")) do 				if player(id,"bot") and id~=pos then 					parse("kick "..id) 				end 			end 		else 			parse("kick "..pos.." this server needs the id you took. you can reconnect if you want") 			add_id_ct_bot(pos) 		end 	else 		local ipos=0 		for i,id in pairs(player(0,"table")) do 			if id>pos then 				ipos=i-1 			end 		end 		for c=1,pos-ipos do 			parse("bot_add_ct") 		end 		add_id_ct_bot(pos) 	end end
edited 1×, last 30.06.13 07:08:31 pm
1