Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fnc_p2_RemoteExecute = {
- private ["_rCode","_agent","_rCodeDesc"];
- _rCodeDesc = _this select 0;
- _rCode = _this select 1;
- if ( isNil "p2_rexec_xpos" ) then { p2_rexec_xpos = 430; };
- p2_rexec_xpos = p2_rexec_xpos + 5;
- _pos = [p2_rexec_xpos,392,0];
- diag_log ( format [ "[P2_RE] Executing '%1' code upon player spawn with Gary the sheep at %2", _rCodeDesc, _pos ] );
- _agent = createVehicle ["GraveCross2_EP1", _pos, [], 0, "FORM"];
- _agent setPos _pos;
- _agent allowdamage false;
- _agent disableAI "MOVE";
- _agent disableAI "ANIM";
- _agent disableAI "FSM";
- _agent disableAI "TARGET";
- _agent disableAI "AUTOTARGET";
- _agent setVehicleInit ("if (!isServer) then {[] spawn "+(str _rCode)+"; diag_log format [""[P2RE "+(_rCodeDesc)+", Time: %1"",diag_tickTime];};");
- [_agent, _rCode, _rCodeDesc] spawn {
- private ["_agent", "_rCode", "_rCodeDesc"];
- _agent = _this select 0;
- _rCode = _this select 1;
- _rCodeDesc = _this select 2;
- diag_log ( format [ "[P2_REXEC] Monitoring Agent '%1' (%2) - Time: %3", _agent, _rCodeDesc, diag_tickTime ] );
- waitUntil {isNull _agent;};
- diag_log ( format [ "[P2_REXEC] Monitor: Agent %1 has become null - Time: %2", _rCodeDesc, diag_ticktime ] );
- systemChat ( format [ "[P2_REXEC] Monitor: Agent %1 has become null - Time: %2", _rCodeDesc, diag_ticktime ] );
- };
- processInitCommands;
- }
Advertisement
Add Comment
Please, Sign In to add comment