HX3 Foren

HX3 Foren (https://hx3.de/)
-   Editing & Scripting (https://hx3.de/editing-scripting-167/)
-   -   Respawn / Removebody (https://hx3.de/editing-scripting-167/respawn-removebody-18437/)

Nephris 07.01.2010 21:44

Respawn / Removebody
 
Hallo,
ich habe mir folgende Zeilen zusammen geschirebn.
Über einen Eventhandler wollte ich eigentlöich den Respawn als auch das removebody initialisieren.

Leider will das nicht so wie ich will....
Hat jmd eine Idee

init.sqf
Code:

/////  Respawn EH             
if ( isNil{player getVariable "respawned"} ) then
{
        player addEventHandler ["killed",
        {
                [] spawn {
                        waitUntil { alive player }; // waitUntil player has respawned
                        hideBody _this;
                        [player] execvm "insertion.sqf";                       
            sleep 10;
            deleteVehicle _this;
                };       
        }];

        player setVariable ["respawned", true];

       
        };


insertion.sqf

Code:

_unit = _this select 0;


    _unit setpos [(getpos _unit select 0)+(random 1000)-1000,(getpos _unit select 1)+(random 1000)-1000,400];
    sleep 0.05;
[_unit] exec "ca\air2\halo\data\Scripts\HALO_AI.sqs";


//hint"insertion klar"


if ( isNil{player getVariable "respawned"} ) then
{
    player addEventHandler ["killed",
    {
        [] spawn {
            waitUntil { alive player };
            [player] execvm "insertion.sqf";
        };   
    }];
    player setVariable ["respawned", true];
};


Nephris 08.01.2010 14:13

fixed.


Alle Zeitangaben in WEZ +1. Es ist jetzt 22:59 Uhr.

Angetrieben durch vBulletin, Entwicklung von Philipp Dörner & Tobias


SEO by vBSEO 3.2.0 ©2008, Crawlability, Inc.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119