Disabling Triggers after time amount

General talk about editing, cheating, and deprotecting maps.

Moderator: Cheaters

Nightmare
Junior Member
Posts: 38
Joined: December 28th, 2007, 6:15 pm

Disabling Triggers after time amount

Post by Nightmare »

How do you put this in jass:

Disable this trigger after 300 seconds.

and also add in

Remove all units for (Triggering Player) when used.

also if this helps this is a loading trigger, and the substring to say is -loadhero <code> if that helps at all.
Thanks for all your help! If you need more info just tell me :D thanks!
-Nightmare
initialD
Some Honorary Title
Posts: 1713
Joined: June 8th, 2007, 5:08 am
Title: Angry Bird

Re: Disabling Triggers after time amount

Post by initialD »

To destroy trigget after 300 seconds:

local trigger t7=CreateTrigger()
call TriggerSleepAction(300)
call DestroyTrigger(t7)
set t7=null


To remove units:

Call RemoveUnit(Units)

For details, ask Aero. :p
User avatar
Aero
Forum Staff
Posts: 829
Joined: January 28th, 2007, 8:10 pm
Title: JASS Programmer
Location: Canada

Re: Disabling Triggers after time amount

Post by Aero »

Use a timer....

Create a timer variable called whatever you want (I'm calling it "abc" for this example).

Make a new trigger again called whatever you want.

For the event, have this:
Event - abc Expires

For the actions. make it do whatever you want.

Then, in you're map init trigger, do this:

Timer - Start abc as a One-Shot timer that will expire in 300 seconds.

Ta-dah, you're done.