Page 1 of 1

Turning off and on triggers

Posted: June 30th, 2008, 7:25 pm
by xeno
I want my hurt trigger to turn on then wait a couple seconds then turn off and waits then turns back on without anyone triggering it to do that. So it does it constantly. How would I write that?

Re: Turning off and on triggers

Posted: June 30th, 2008, 8:13 pm
by xeno
Nvm...I got it to work thanks to fuzzmunch.

main()
{
mp_test_lasers();
}

mp_test_lasers()
{
switch_laser = getent("mp_test_laser_1","targetname");
wait 0.05;
switch_status1 = 0;
wait 0.05;
maps\mp\_utility::triggerOff();
wait 0.05;

while(1)
{
switch_laser maps\mp\_utility::triggerOn();

wait 5;

switch_laser maps\mp\_utility::triggerOff();

wait 5;
}
}

Re: Turning off and on triggers

Posted: June 30th, 2008, 9:29 pm
by Drofder2004

Code: Select all

switch_laser = getent("mp_test_laser_1","targetname");
wait 0.05;
switch_status1 = 0;
wait 0.05;
maps\mp\_utility::triggerOff();
wait 0.05;
Change to (to simplify)

Code: Select all

switch_laser = getent("mp_test_laser_1","targetname");
switch_status1 = 0;
The switch the "while" thread order to Off then on instead of on then off. Save yourself about 30 bytes!