Forum

> > CS2D > Scripts > Someone can do this script?
Forums overviewCS2D overview Scripts overviewLog in to reply

English Someone can do this script?

2 replies
To the start Previous 1 Next To the start

old Someone can do this script?

Jedediastwo
User Off Offline

Quote
Whenever missing 10 seconds to finish the game, each of alive counter terrorists receive 1 score and replace round draw with a custom message, for example "GAME IS OVER".

And a command, when terrorist say: @info id, will show the area where the counter terrorist is, for 5000 money.

Area "X, Y" in map have a name, for example:
Area "1000, 500" is Beach Location.
edited 1×, last 05.11.16 06:41:30 pm

old Re: Someone can do this script?

Rainoth
Moderator 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
rounds = {}
rounds.spots = {
{420,69,"Location 1"},
{69,420,"Location 2"}
}

addhook("startround","_sr")
function _sr()
	rounds.time = game("mp_roundtime")*60
end

addhook("second","_s")
function _s()
	rounds.time = rounds.time - 1
	if rounds.time  == 10 then
		for _,id in pairs (player(0,"team2living")) do
			parse("setscore "..id.." "..player(id,"score")+1)
		end
	end
end

addhook("say","_sa")
function _sa(id,t)
	if t:sub(1,5) == "@info" then
		local target = tonumber(t:sub(7,#t))
		if player(id,"money") >= 5000 then
			if target then
				local closest = 9999
				for k,v in pairs (rounds.spots) do
					if math.sqrt(((player(target,"x")-(v[1]))^2 + ((player(target,"y")-(v[2]))^2) < closest then
						closest = k
					end
				end
				msg2(id,"Player "..player(target,"name").." is in "..rounds.spots[closest][3])
				parse("setmoney "..id.." "..player(id,"money")-5000)
			end
		end
	end
end

Does not handle the "Game is over" message.
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview