Der fertige Code der Init-Zeile sieht nun so aus.
Mit dem oberen Teil werden die Tore mit den Variablennamen - bordergate1r, bordergate2r, bordergate3r - geöffnet, im unteren Teil geschlossen.
Die Actions können nur Polizisten (west) ausführen und beim schließen der Tore werden diese abgeschlossen, damit andere Spieler sie nicht öffnen können.
Beim öffnen werden die Tore wieder aufgeschlossen, d.h. Zivilisten könnten sie per Hand zu und wieder aufmachen.
Code: Tore öffnen / schließen
this addAction ["<t color='#00cc00'>Tor öffnen</t>", {
params ["_target", "_caller", "_actionId", "_arguments"];
_theBuilding = bordergate1r;
_theBuilding animateSource["Door_1_sound_source", 1];
_theBuilding animateSource["Door_2_sound_source", 1];
_theBuilding setVariable ['bis_disabled_Door_1',0,true];
_theBuilding setVariable ['bis_disabled_Door_2',0,true];
_theBuilding = bordergate2r;
_theBuilding animateSource["Door_1_sound_source", 1];
_theBuilding animateSource["Door_2_sound_source", 1];
_theBuilding setVariable ['bis_disabled_Door_1',0,true];
_theBuilding setVariable ['bis_disabled_Door_2',0,true];
_theBuilding = bordergate3r;
_theBuilding animateSource["Door_1_sound_source", 1];
_theBuilding animateSource["Door_2_sound_source", 1];
_theBuilding setVariable ['bis_disabled_Door_1',0,true];
_theBuilding setVariable ['bis_disabled_Door_2',0,true];
}, nil, 1.5, true, false, "", 'playerSide isEqualTo west', 10];
this addAction ["<t color='#ff0000'>Tor schließen</t>", {
params ["_target", "_caller", "_actionId", "_arguments"];
_theBuilding = bordergate1r;
_theBuilding animateSource["Door_1_sound_source", 0];
_theBuilding animateSource["Door_2_sound_source", 0];
_theBuilding setVariable ['bis_disabled_Door_1',1,true];
_theBuilding setVariable ['bis_disabled_Door_2',1,true];
_theBuilding = bordergate2r;
_theBuilding animateSource["Door_1_sound_source", 0];
_theBuilding animateSource["Door_2_sound_source", 0];
_theBuilding setVariable ['bis_disabled_Door_1',1,true];
_theBuilding setVariable ['bis_disabled_Door_2',1,true];
_theBuilding = bordergate3r;
_theBuilding animateSource["Door_1_sound_source", 0];
_theBuilding animateSource["Door_2_sound_source", 0];
_theBuilding setVariable ['bis_disabled_Door_1',1,true];
_theBuilding setVariable ['bis_disabled_Door_2',1,true];
}, nil, 1.5, true, false, "", 'playerSide isEqualTo west', 10];
Alles anzeigen