player2_dz

Untitled

Feb 10th, 2015
355
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.33 KB | None | 0 0
  1. fnc_p2_RemoteExecute = {
  2.     private ["_rCode","_agent","_rCodeDesc"];
  3.     _rCodeDesc = _this select 0;
  4.     _rCode = _this select 1;
  5.     if ( isNil "p2_rexec_xpos" ) then { p2_rexec_xpos = 430; };
  6.     p2_rexec_xpos = p2_rexec_xpos + 5;
  7.     _pos = [p2_rexec_xpos,392,0];
  8.     diag_log ( format [ "[P2_RE] Executing '%1' code upon player spawn with Gary the sheep at %2", _rCodeDesc, _pos ] );
  9.     _agent = createVehicle ["GraveCross2_EP1", _pos, [], 0, "FORM"];
  10.     _agent setPos _pos;
  11.     _agent allowdamage false;
  12.     _agent disableAI "MOVE";
  13.     _agent disableAI "ANIM";
  14.     _agent disableAI "FSM";
  15.     _agent disableAI "TARGET";
  16.     _agent disableAI "AUTOTARGET";
  17.     _agent setVehicleInit ("if (!isServer) then {[] spawn "+(str _rCode)+"; diag_log format [""[P2RE "+(_rCodeDesc)+", Time: %1"",diag_tickTime];};");
  18.     [_agent, _rCode, _rCodeDesc] spawn {
  19.         private ["_agent", "_rCode", "_rCodeDesc"];
  20.         _agent = _this select 0;
  21.         _rCode = _this select 1;
  22.         _rCodeDesc = _this select 2;
  23.         diag_log ( format [ "[P2_REXEC] Monitoring Agent '%1' (%2) - Time: %3", _agent, _rCodeDesc, diag_tickTime ] );
  24.         waitUntil {isNull _agent;};
  25.         diag_log ( format [ "[P2_REXEC] Monitor: Agent %1 has become null - Time: %2", _rCodeDesc, diag_ticktime ] );
  26.         systemChat ( format [ "[P2_REXEC] Monitor: Agent %1 has become null - Time: %2", _rCodeDesc, diag_ticktime ] );
  27.     };
  28.     processInitCommands;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment