Turning off and on triggers

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

Moderator: Core Staff

Post Reply
xeno
CJ Wannabe
CJ Wannabe
Posts: 38
Joined: October 31st, 2007, 12:37 am
Location: United States - GA

Turning off and on triggers

Post by xeno » June 30th, 2008, 7:25 pm

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?
Image

xeno
CJ Wannabe
CJ Wannabe
Posts: 38
Joined: October 31st, 2007, 12:37 am
Location: United States - GA

Re: Turning off and on triggers

Post by xeno » June 30th, 2008, 8:13 pm

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;
}
}
Image

User avatar
Drofder2004
Core Staff
Core Staff
Posts: 13313
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

Re: Turning off and on triggers

Post by Drofder2004 » June 30th, 2008, 9:29 pm

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!
Image
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010

Post Reply

Who is online

Users browsing this forum: No registered users and 27 guests