Page 1 of 1

trigger (hp+)

Posted: August 7th, 2012, 4:09 pm
by Ilya1996
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!

Re: trigger (hp+)

Posted: August 7th, 2012, 5:12 pm
by megazor
скрипты к картам писать можешь?

создаешь в радианте простой триггер 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;

Все.

Re: trigger (hp+)

Posted: August 7th, 2012, 8:14 pm
by Ilya1996
Спасибо, помог :)