Adding Triggers to the Missionfile

Grafzahl

Valued Member!
Hey Guys,

i have ONE automated Fuelstation on my Namalsk-Server, and i wanted to add a trigger, so everyone who comes near the fuelstation gets a message that this one supports auto-refueling and how to use it.

So i opened the mission editor, added a trigger with X Meter Radius, thats triggert by all units, plays a sound and shows a PLAIN DOWN Message for X Seconds, Preview was working fine... when i came close to the fuelstation, the message and sound appeared.

So, i saved the mission, oppened the mission.sqf, searched for the trigger code and added it into my mission.sqf, but... offcours, it did not work ;)

Code:
_this = createTrigger ["EmptyDetector", [6239.0806, 9356.2764, 0]];
_this setTriggerActivation ["ANY", "PRESENT", false];
_this setTitleEffect ["TEXT", "PLAIN", "TEST!!!!"];
_trigger_1 = _this;

So, anyone has an idea what i would have to change to make it work? and does it have to run only on server or only on client?
 
Can anyone explain how to add a trigger please? I am wanting to have a siren played when a player enters a certain area. I have tried google but not had any luck so far.

Thanks
 
I am pretty sure I can help you with a message displayed across the players screen, not sure about a sound though, I can look later today
 
To get you started in the right direction, this is an admin base style kill script - kills players after a set time inside a radius.. modified for what you need (trim it up however you need it)

create autorefuelmessage.sqf

Code:
if ((getPlayerUID player) in ["UIDHERETONOTSEEMSG"]) then {
titleText ["Welcome back.", "PLAIN DOWN", 3];
} else {
titleText ["This station allows you to auto refuel your vehicles!", "PLAIN DOWN", 3];
sleep 5;
titleText ["It is the only station on the map that autorefuels.", "PLAIN DOWN", 3];
sleep 5;
titleText ["To refuel get close to the gas tank and use your scroll wheel to start refueling.", "PLAIN DOWN", 3];
sleep 5;
titleText ["Good Luck!", "PLAIN DOWN", 3];
sleep 5;
};

in your mission.sqm paste this
under class markers
Code:
    class Sensors
    {
        items=1
        class Item0
        {
            position[]={1250.1394,0,10058.651};
            a=30;
            b=30;
            activationBy="WEST";
            repeating=1;
            interruptable=1;
            age="UNKNOWN";
            name="AdminBase";
            expCond="(vehicle player) in thislist;";
            expActiv="adminbase = [] execVM ""autorefuelmessage.sqf"";";
            expDesactiv="terminate adminbase; titleText [""Come Back again!"", ""PLAIN DOWN"", 3];";
            class Effects
            {
                titleType="TEXT";
                titleEffect="PLAIN DOWN";
                title="Refuel Here!";
            };   
    };

Again its ripped from an admin protection thing, but it will work for what you need-

edit a= and b= to radius that you want
 
Back
Top