View Single Post
  #5  
Old 05-27-2012, 02:25 PM
FG28_Kodiak FG28_Kodiak is offline
Approved Member
 
Join Date: Dec 2009
Location: Swabia->Bavaria->Germany
Posts: 884
Default

Yes, simply add an other if clause (in a script you can only use one method, a second OnTrigger would cause an error, so you must modify the existing):
Code:
public override void OnTrigger(int missionNumber, string shortName, bool active)
    {
        base.OnTrigger(missionNumber, shortName, active);


        if ("109".Equals(shortName))
        {
            AiAction Action = GamePlay.gpGetAction(shortName); // if your action has an other Name than your trigger change GamePlay.gpGetAction(shortName) into GamePlay.gpGetAction("ActionName")

            if (Action != null)
                Action.Do();

            GamePlay.gpGetTrigger(shortName).Enable = false; // if trigger is TPassThru to avoid multiple activation

            return; // leave method to avoid second call of the Action
        }

        if ("Spit".Equals(shortName))
        {
            AiAction Action = GamePlay.gpGetAction(shortName); // if your action has an other Name than your trigger change GamePlay.gpGetAction(shortName) into GamePlay.gpGetAction("ActionName")

            if (Action != null)
                Action.Do();

            GamePlay.gpGetTrigger(shortName).Enable = false; // if trigger is TPassThru to avoid multiple activation

            return; // leave method to avoid second call of the Action
        }

        AiAction Action = GamePlay.gpGetAction(shortName); 

        if (Action != null)
            Action.Do();
        GamePlay.gpGetTrigger(shortName).Enable = false;
        
    }

Last edited by FG28_Kodiak; 05-27-2012 at 02:27 PM.
Reply With Quote