trigger (hp+)

Have questions about CoD2 mapping that aren't covered in the tutorials section? Post here!

Moderator: Core Staff

Post Reply
Ilya1996
CJ Wannabe
CJ Wannabe
Posts: 5
Joined: August 7th, 2012, 4:06 pm

trigger (hp+)

Post by Ilya1996 » August 7th, 2012, 4:09 pm

Hello, mappers and users!
I have a problem (sorry for my english, me from Russia).
How to make trigger which gives HP in the fall and does not die?
Beforehand thanks!

megazor
CJ Worshipper
CJ Worshipper
Posts: 414
Joined: July 22nd, 2009, 3:02 am
Location: Russia, Vladivostok

Re: trigger (hp+)

Post by megazor » August 7th, 2012, 5:12 pm

скрипты к картам писать можешь?

создаешь в радианте простой триггер trigger_multiple, потом в его свойствах (кнопка N) в поле key вводишь targetname,
а в поле value вводишь trig_hp.

в gsc-скрипте к твоей карте делаешь такую функцию:

Code: Select all

super_puper_trig_hp()
{
	trig = getEnt("targetname", "trig_hp");
	while(1)
	{
		trig waittill("trigger", player);
		if(!isPlayer(player) || !player.AllowedToExecTrig)
			continue;

		if(player.health < player.maxhealth)
			player.health++;	
		player thread ping_me();
	}
}

ping_me()
{
	self.allowedToExecTrig = false;
	wait 1;
	if(isPlayer(self))
		self.allowedToExecTrig = true;
}
Кроме того, в onConnect() надо еще добавить строчку self.allowedToExecTrig = true;

Все.

Ilya1996
CJ Wannabe
CJ Wannabe
Posts: 5
Joined: August 7th, 2012, 4:06 pm

Re: trigger (hp+)

Post by Ilya1996 » August 7th, 2012, 8:14 pm

Спасибо, помог :)

Post Reply

Who is online

Users browsing this forum: No registered users and 8 guests