Forum

> > CS2D > Scripts > Death zone.
Forums overviewCS2D overview Scripts overviewLog in to reply

English Death zone.

36 replies
Page
To the start Previous 1 2 Next To the start

old Death zone.

MixTape
User Off Offline

Quote
Hi guys. I d'like to make in map "death zone". On map are 2 places, where player's can die. One is for CT and one for TT. I dont know how to do it. Can it be make in map editor or must be make in LUA? I dont know how to start do script, im newbie (already learning basics of this language) so please help me

old Re: Death zone.

Raisun
User Off Offline

Quote
Try using entity in map editor called Info_TeamGate, it has everything you are asking for.

old Re: Death zone.

Rainoth
Moderator Off Offline

Quote
Ye, use info teamgate.
If you want a script, searc ''safe zone'' and change invulnerability into kill command.

old Re: Death zone.

MixTape
User Off Offline

Quote
Ok it's work!

Can i make a wall, that be deleted after 15 seconds from the round start?

old Re: Death zone.

Rainoth
Moderator Off Offline

Quote
You could accomplish that with Trigger_Delay and Dyn_Wall

Like so:

Trigger_Start:
Name:
Triggers: DelayTrigger

Trigger_Delay:
Name: DelayTrigger
Triggers: MyWall

Dyn_Wall:
Name: MyWall
Triggers:

Or if you would like to do it with lua, just record the position of where you wall is and then use objectdamage to destroy it after a while. You can use a timer for that.

old Re: Death zone.

MixTape
User Off Offline

Quote
Thanks, do u know how to make a timer on the screen with this time? It is maybe easy code? I delete hud time from screen.

old Re: Death zone.

Rainoth
Moderator Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
local TotalSeconds = 0
addhook("second","wow")
function wow()
	if TotalSeconds < 15 then
		TotalSeconds = TotalSeconds + 1
		parse("hudtxt 0 "\169255255255".. 15-TotalSeconds.." until wall opens!" 300 30 1")
	elseif TotalSeconds == 15 then
		parse("trigger MyWall")
		parse("hudtxt 0")
	end
end

addhook("startround","owo")
function owo(mode)
	TotalSeconds = 0
end
edited 3×, last 31.07.15 12:35:28 am

old Re: Death zone.

The Gajos
BANNED Off Offline

Quote
Better way is to create a msg entities in map editor and trigger them by delay.

old Re: Death zone.

Rainoth
Moderator Off Offline

Quote
Ignore user The Gajos because it's more efficient to run my code than waste time for a ton of delays and message entities √

old Re: Death zone.

MixTape
User Off Offline

Quote
Hmm.. This script doesn't work or i made something wrong but what?

old Re: Death zone.

Rainoth
Moderator Off Offline

Quote
It could be that your Dyn_Wall name is not "MyWall" or there are other scripts that use 0 hud id or I may have improperly written the parsing string for hudtxt or you didn't do something right.

old Re: Death zone.

MixTape
User Off Offline

Quote
My Dyn_Wall name is MyWall (for all), i dont think about use hud 0 in other script, but when i change here it can be better or what i can do with it?
1
2
3
4
5
parse("hudtxt 1 "\169255255255".. 15-TotalSeconds.." until wall opens!" 300 30 1")
     elseif TotalSeconds == 15 then
          parse("trigger MyWall")
          parse("hudtxt 1")
     end

And i think i make it good but im not sure.

old Re: Death zone.

Rainoth
Moderator Off Offline

Quote
Well.. Try opening console and check if hooks are added, maybe you'll find an error.

old Re: Death zone.

Talented Doge
User Off Offline

Quote
1
parse("hudtxt 0 "\169255255255".. 15-TotalSeconds.." until wall opens!" 300 30 1")

I'm sure you are capable of fixing this mistake, it's a minor one.
edited 1×, last 31.07.15 05:33:58 pm

old Re: Death zone.

MixTape
User Off Offline

Quote
Problem is with "", yes?


/edit: i try... And try... And try! Im angry now becouse i dont know what is wrong, can u help me better, dude? Maybe it's my fail but i will trying...
edited 1×, last 31.07.15 10:09:11 pm

old Re: Death zone.

Talented Doge
User Off Offline

Quote
I have already given you the mistaken code. Try it yourself, the cs2d cheatsheet may help you out.

old Re: Death zone.

The Gajos
BANNED Off Offline

Quote
parse('hudtxt 0 "\169255255255'..15 - TotalSeconds..' until wall opens!" 300 30 1')

or a better way:
1
2
3
4
5
6
7
8
9
10
11
12
13
function hudtxt(hudid,text,x,y,align)
	local align = align or 0
	--[[ this is same like:
	local align
	if not align then // if align == nil then
		align = 0 -- I can't set local here because outside the IF function, variable won't be visible
	end
	--]]
	parse('hudtxt '..hudid..' "'..text..'" '..x..' '..y..' '..align)
end

-- then use:
hudtxt(0,'\169255255255'..15 - TotalSeconds..' until wall opens!',300,30,1)

Admin/mod comment

Pointless More tag has been removed! /user GeoB99

old Re: Death zone.

Rainoth
Moderator Off Offline

Quote
Just use his code and be done with it I guess.
edited 1×, last 01.08.15 02:27:06 pm

old Re: Death zone.

MixTape
User Off Offline

Quote
Thank you @user The Gajos: for this line
Thank you@user Rainoth: for help, u re very helpful

Okay, now i see the text, but when the walls are open, after 1 sec they are closed, and then after 1 sec are open and again and again.
It is happen when hudtxt is 0:
1
2
3
4
elseif TotalSeconds == 30 then
          parse("trigger MyWall")
          parse("hudtxt 0")
     end
I was change seconds to 30 in code but in map stay on 15, i was make it special to see the this diffrence.

All code:

Spoiler >



//edit: okay i will delete this line from "elseif"

1
parse("trigger MyWall")

Btw. what's going on with this code in elseif? Why it is here? I think i script dont need it, and what do u think about it?
edited 2×, last 01.08.15 02:38:36 pm
To the start Previous 1 2 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview