Advertisement
Guest User

Nen bissel Flotter

a guest
Apr 1st, 2015
34
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.17 KB | None | 0 0
  1. _logscript = compile preprocessFileLineNumbers "\ar3play\vendor\sock-rpc\log.sqf";
  2. call _logscript;
  3.  
  4. _sockscript = compile preprocessFileLineNumbers "\ar3play\vendor\sock-rpc\sock.sqf";
  5. call _sockscript;
  6.  
  7. diag_log "export-missiondatat.sqf: ok. start pinging sock_rpc...";
  8.  
  9. [] spawn {
  10.     while {true} do {
  11.         ['echo', ['keep-alive']] call sock_rpc;
  12.         sleep 20;
  13.     };
  14. };
  15.  
  16. ['echo', ['keep-alive']] call sock_rpc;
  17.  
  18. if (isDedicated) then {
  19.  
  20.     addMissionEventHandler ["Ended", {
  21.         ['missionEnd', []] call sock_rpc;
  22.     }];
  23.  
  24.     waitUntil { count allUnits > 0 };
  25.  
  26.     ['missionStart', [missionName, worldName]] call sock_rpc;
  27.  
  28.     if (IS_STREAMABLE) then {
  29.         ['setIsStreamable', [true]] call sock_rpc;
  30.     };
  31.  
  32.     [] spawn {
  33.         while {(count allUnits > 0) and (ENABLE_REPLAY)} do {
  34.             playersArray = [];
  35.             {
  36.                 pos = (getPos _x) + [getDir _x];
  37.  
  38.                 status = 'unconscious';
  39.                 if (alive _x) then {
  40.                     status = 'alive';
  41.                 } else {
  42.                     status = 'dead';
  43.                 };
  44.  
  45.                 vehicletype = 'unknown';
  46.                 if (vehicle _x == _x) then {
  47.                     vehicletype = 'none';
  48.                 } else {
  49.                     _veh = vehicle _x;
  50.                     if (_veh isKindOf "Helicopter") then {
  51.                         vehicletype = 'helicopter';
  52.                     };
  53.                 };
  54.  
  55.                 classtype = 'unknown';
  56.                 if ((typeOf _x) find "_AR_" > -1) then {
  57.                     classtype = 'mg';
  58.                 };
  59.                 if ((typeOf _x) find "_SL_" > -1) then {
  60.                     classtype = 'officer';
  61.                 };
  62.                 if ((typeOf _x) find "_TL_" > -1) then {
  63.                     classtype = 'leader';
  64.                 };
  65.                 if ((typeOf _x) find "_GL_" > -1) then {
  66.                     classtype = 'grenadier';
  67.                 };
  68.                 if (((typeOf _x) find "_LAT_" > -1) OR ((typeOf _x) find "_AA_" > -1)) then {
  69.                     classtype = 'at';
  70.                 };
  71.                 if ((typeOf _x) find "_medic_" > -1) then {
  72.                     classtype = 'medic';
  73.                 };
  74.                 if ((typeOf _x) find "_repair_" > -1) then {
  75.                     classtype = 'engineer';
  76.                 };
  77.                 if ((typeOf _x) find "_exp_" > -1) then {
  78.                     classtype = 'explosive';
  79.                 };
  80.                
  81.                 _toplayersArray = [name _x, pos, [format ["%1", side _x], classtype], [status, vehicletype]];
  82.  
  83.                 playersArray pushBack _toplayersArray;
  84.  
  85.             } forEach allUnits + allDead - vehicles - agents;
  86.  
  87.             ['setAllPlayerData', [playersArray]] call sock_rpc;
  88.             sleep 2;
  89.         }
  90.     };
  91. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement