Einzelnen Beitrag anzeigen
Alt 15.03.2010, 07:46   #3 (permalink)
DerSchakal
Newbie
 
Registriert seit: 12.03.2010
Beiträge: 48
Standard

Ja hab ich gemacht diese Kopiert und zu ner SQF erstellt.
Wie ruf ich dies nun auf?Ich habs per Auslöser versucht aber FAIL.
Wie muss ich das richtig machen?

Hier die template.sql die ich per Auslöser versucht habe aufzurufen.
Syntax hab ich nul = execVM "Script.sqf"; und zweiter versuch
nul ="Marker" execVM "Script.sqf";


Code:
private ["_result", "_center", "_dir", "_code", "_position", "_azimut", "_distance", "_array", "_pos", "_arr"];
_result = false;
switch (typeName _this) do {
    case "ARRAY": {
        switch (count _this) do {
            case 3: {
                _center = _this;
                _dir = 0;
                _result = true;
            };
            case 2: {
                _center = _this select 0;
                _dir = _this select 1;
                _result = true;
            };
        };
    };
    case "STRING": {
        _center = markerPos _this;
        _dir = markerDir _this;
        deleteMarker _this;
        _result = true;
    };
};
if (!_result) then {
    Player sideChat "Invalid parameter!";
} else {
    _code = compile "
            private [""_center"", ""_position"", ""_azimut"", ""_distance"", ""_result""];
            _center = _this select 0;
            _position = _this select 1;
            _distance = _position distance [0,0];
            _azimut = acos((_position select 0) / _distance);
            if (!finite _azimut) then {
                _azimut = 0;
            };
            if (_position select 1 < 0) then {
                _azimut = 360 - _azimut;
            };
            _azimut = _azimut + (_this select 2);
            _result = [cos(_azimut) * _distance, sin(_azimut) * _distance];
            _result = [(_result select 0) + (_center select 0),
                       (_result select 1) + (_center select 1),
                       _position select 2];
            _result
        ";        
    _array = [    [],     [],     [],     [
        [0, ["Barrack2", [-2.12427, -33.613, 0.19819], 0, "NONE", "UNLOCKED", 1, 1, 1, "doStop this;", ""]], 
        [2, ["C130J", [19.9731, 44.7839, -0.20880], 160.88, "NONE", "UNLOCKED", 1, 1, 1, "doStop this;", ""]], 
        [4, ["Barrack2", [-12.7043, -33.5129, 0], 0, "NONE", "UNLOCKED", 1, 1, 1, "doStop this;", ""]], 
        [6, ["Barrack2", [7.18555, -33.603, 0], 0, "NONE", "UNLOCKED", 1, 1, 1, "doStop this;", ""]], 
        [8, ["Can_small", [-4.07593, -34.1604, 1.4166], 0, "NONE", "UNLOCKED", 1, 1, 1, "doStop this;", ""]], 
        [10, ["FoldChair", [-3.06543, -33.9065, 0], 51.2639, "NONE", "UNLOCKED", 1, 1, 1, "doStop this;", ""]], 
        [12, ["Land_Barrel_empty", [-0.108643, -39.2869, 0], 0, "NONE", "UNLOCKED", 1, 1, 1, "doStop this;", ""]]
    ],     [
        [
            west, 
            [
                [14, ["USMC_Soldier_Light", [-20.0959, -44.5308, 0.0014228], 0, "NONE",0.5, "PRIVATE", 1, "c1 switchmove ""AmovPercMstpSsurWnonDnon"";c1 disableAI ""Anim"";doStop this;", "c1"]], 
                [16, ["USMC_LHD_Crew_Blue", [-3.83447, -40.5554, 0.0014495], 192.841, "NONE",0, "PRIVATE", 1, "c4 disableAI ""ActsPercMstpSnonWnonDnon_talking02"";doStop this;", "c4"]], 
                [18, ["USMC_Soldier_Light", [-3.27075, -33.9524, 0.73459], 212.817, "NONE",0, "PRIVATE", 1, "c2 switchmove ""miles_c0briefing_odpovedel_loop"";doStop this;", "c2"]], 
                [20, ["USMC_Soldier_Pilot", [-4.44775, -41.8354, 0.0014381], 30.1982, "NONE",0, "PRIVATE", 1, "c3 playmove ""ActsPercMstpSnonWnonDnon_talking02"";c3 disableAI ""ActsPercMstpSnonWnonDnon_talking02"";doStop this;", "c3"]]
            ], 
            [], 
            []
        ]
    ], [], false, true, []];
    {
        _pos = _x select 1;
        _azimut = _x select 4;
        _pos = [_center, _pos, _dir] call _code;
        _azimut = _azimut - _dir;
        _x set [1, _pos];
        _x set [4, _azimut];
    } forEach (_array select 0);
    {
        _pos = _x select 0;
        _azimut = _x select 3;
        _pos = [_center, _pos, _dir] call _code;
        _azimut = _azimut - _dir;
        _x set [0, _pos];
        _x set [3, _azimut];
    } forEach (_array select 1);
    {
        _arr = _x select 1;
        _pos = _arr select 0;
        _azimut = _arr select 1;;
        _pos = [_center, _pos, _dir] call _code;
        _azimut = _azimut - _dir;
        _arr set [0, _pos];
        _arr set [1, _azimut];
    } forEach (_array select 2);
    {
        _arr = _x select 1;
        _pos = _arr select 1;
        _azimut = _arr select 2;
        _pos = [_center, _pos, _dir] call _code;
        _azimut = _azimut - _dir;
        _arr set [1, _pos];
        _arr set [2, _azimut];
    } forEach (_array select 3);
    {
        {
            _arr = _x select 1;
            _pos = _arr select 1;
            _azimut = _arr select 2;
            _pos = [_center, _pos, _dir] call _code;
            _azimut = _azimut - _dir;
            _arr set [1, _pos];
            _arr set [2, _azimut];
        } forEach (_x select 1);
        {
            _arr = _x select 1;
            _pos = _arr select 1;
            _azimut = _arr select 2;
            _pos = [_center, _pos, _dir] call _code;
            _azimut = _azimut - _dir;
            _arr set [1, _pos];
            _arr set [2, _azimut];
        } forEach (_x select 2);
        {
            _pos = _x select 0;
            _pos = [_center, _pos, _dir] call _code;
            _x set [0, _pos];
        } forEach (_x select 3);
    } forEach (_array select 4);
    {
        _pos = _x select 0;
        _pos = [_center, _pos, _dir] call _code;
        _x set [0, _pos];
    } forEach (_array select 5);
    _array call ION_RTE_fRestore;
};
EDIT: Kommt es mir nur so vor oder ist die Syntax von Arma fast gleich wie PHP?Schleifen und so Oo nun beim genauer betrachten so.

Geändert von DerSchakal (15.03.2010 um 07:49 Uhr).
DerSchakal ist offline