Forum
CS2D Scripts Hostage Dead = Round End?!Hostage Dead = Round End?!
7 Antworten 1
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
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
parse("restart") addhook("startround","nakelo_obla") function nakelo_obla(mode) 	-- if restarted (game annulled player hostage kills) 	if mode==5 then 		-- Amount of killed hostages; initial level of hostage kills; player hostage kills 		mert_tal = 0 		mert_tal_urv = 0 		igraq_tal = {} 	-- set initial level of hostage kills 	else 		mert_tal_urv = mert_tal 	end end addhook("attack","napad") function napad(id) 	ubistvo_tal(id) end addhook("attack2","napad2") function napad2(id) 	ubistvo_tal(id) end -- check hostage kills for some player function ubistvo_tal(id) 	-- if never killed then set 0 	if not igraq_tal[id] then 		igraq_tal[id] = 0 	end 	-- if table is outdated <-- player killed hostage(s) 	if igraq_tal[id] ~= player(id,"hostagekills") then 		-- add amount of new killed hostage(s) 		mert_tal = mert_tal + player(id,"hostagekills") - igraq_tal[id] 		-- update table 		igraq_tal[id] = player(id,"hostagekills") 	end 	-- check amount of killed hostages 	if igraq_tal[id] - mert_tal_urv >= 2 then 		parse("endround 0") 	end end
After that you must do these things:
Move the lua script file in cs2d folder/sys/lua and paste it
Go to server.lua of the lua folder and write the dofile to activate the script (note this thing is not important if you put the script in autorun).
To write the dofile you must write like this:
1
dofile("sys/lua/yourscriptname.lua")
Then after, open CS2D, click new game and you're done.
HoOtix hat geschrieben
How do I use this? Lol sorry Im a scirpt noob
1. Open notepad
2. Copy and paste all of the code
3. click CTRL+S
4. Change the "Text Documents (*.txt)" to All files
5. Name it to: Hostage.lua
6. Place it in *CS2D FOLDER*/sys/lua/autorun/
[OPTIONAL] If you don't have autorun folder CREATE IT
Admin/Mod Kommentar
No need to quote the user above you / useigor1. Take the script that is given by useigor (Copy & Paste) and modify values if needed for one map.
2. Save the file in your *CS2D root folder*\maps folder under the name *map name*.lua, where *map name* is the name for that particular map (without the .map extension)
3. Repeat step 1 & 2 for any remaining maps that you need this script applied on.
4. Before you start the server, make sure mp_luamap is set to 1 in your server settings.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
2
3
4
5
6
7
8
9
10
11
12
13
14
-- Map list with specific hostage kills carta_tal = {cs_office = 3, cs_assault = 1} -- Check current map for carta,tal in pairs(carta_tal) do 	if carta==map("name") then 		c_tal = tal 	end end -- If current map is not listed if not c_tal then 	c_tal = 2 end
'2' must be replaced by 'c_tal' in 41 line
1