Forum

> > CS2D > Scripts > Check mapname
Forums overviewCS2D overview Scripts overviewLog in to reply

English Check mapname

4 replies
To the start Previous 1 Next To the start

old Check mapname

Suprise
BANNED Off Offline

Quote
Well guys I need your helps. I want to create a script like:
1
2
type1_maps = {"de_dust2","de_dust"}
type1_weapons = {30,80} - Ak47, Armor
type2_maps, etc, etc

So when the type1 map loaded and I spawn I get Ak-47 and armor! If type2 map loaded then I get type2's weapons.

I think this will need a checkmap function, but I can't do it .
Helps are welcome
Thx in advance.

old Re: Check mapname

Alistaire
User Off Offline

Quote
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
maps={
	[1] = "de_dust2"
	[2] = "de_dust"
}

weapons={
	[1] = {
		[30] = true
		[80] = true
	},
	[2] = {
		[30] = true
		[80] = true
	}
}

start = {}

k = 0

for i = 1, #maps do
	if map('name') == maps[i] then
		for j = 1, #weapons[i] do
			if weapons[i][j] == true then
				start[k] = weapons[i][j]
				k = k + 1
			end
		end
	end
end

addhook('spawn', 'AA_spawn')

function AA_spawn(id)
	l = ' '
	for i = 1, #start do
		l = l..' tostring(start[i])'
	end
	return l;
end

old Re: Check mapname

Suprise
BANNED Off Offline

Quote
Its doesn't work. When I spawned I didn't get weapons.

EDIT: Problem solved by myself..lol - Thanks you Alistaire.
edited 1×, last 15.08.12 04:44:27 pm

old Re: Check mapname

Suprise
BANNED Off Offline

Quote
Well, I don't know who need it (Except me) but here it is
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
classic_set1 = {}
classic_set2 = {}
classic_set3 = {}

classic_set1={"de_dust","de_dust2","de_cs2d","de_dust3","de_dust2_unlimited","de_frozen","de_hollogen.kc"}

classic_set2={"zm_9_areas","zm_alien_space","zm_Zombie's","ze_caution"}

classic_set3={"cs_assault","fun_base_town","DR_LIGHT"}

addhook("spawn","lolz")
function lolz(id)
	for i = 1, #maps do
		if map("name") == classic_set1[i] then
			parse("equip "..id.." 30")
			parse("equip "..id.." 51")
		end
		if map("name") == classic_set2[i] then
			parse("equip "..id.." 74")
			parse("equip "..id.." 79")
		end
	end
end

addhook("startround","lolz1")
function lolz1(id)
	for i = 1, #maps do
		if map("name") == classic_set1[i] then
			parse("mp_autoteambalance 0")
			parse("sv_gm 2")
		end
	end
end
I use this way, but I used here other thing, what I'm actually using in my script. (I mean maps, equips)
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview