Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- _logscript = compile preprocessFileLineNumbers "\ar3play\vendor\sock-rpc\log.sqf";
- call _logscript;
- _sockscript = compile preprocessFileLineNumbers "\ar3play\vendor\sock-rpc\sock.sqf";
- call _sockscript;
- diag_log "export-missiondatat.sqf: ok. start pinging sock_rpc...";
- [] spawn {
- while {true} do {
- ['echo', ['keep-alive']] call sock_rpc;
- sleep 20;
- };
- };
- ['echo', ['keep-alive']] call sock_rpc;
- if (isDedicated) then {
- addMissionEventHandler ["Ended", {
- ['missionEnd', []] call sock_rpc;
- }];
- waitUntil { count allUnits > 0 };
- ['missionStart', [missionName, worldName]] call sock_rpc;
- if (IS_STREAMABLE) then {
- ['setIsStreamable', [true]] call sock_rpc;
- };
- [] spawn {
- while {(count allUnits > 0) and (ENABLE_REPLAY)} do {
- playersArray = [];
- {
- pos = (getPos _x) + [getDir _x];
- status = 'unconscious';
- if (alive _x) then {
- status = 'alive';
- } else {
- status = 'dead';
- };
- vehicletype = 'unknown';
- if (vehicle _x == _x) then {
- vehicletype = 'none';
- } else {
- _veh = vehicle _x;
- if (_veh isKindOf "Helicopter") then {
- vehicletype = 'helicopter';
- };
- };
- classtype = 'unknown';
- if ((typeOf _x) find "_AR_" > -1) then {
- classtype = 'mg';
- };
- if ((typeOf _x) find "_SL_" > -1) then {
- classtype = 'officer';
- };
- if ((typeOf _x) find "_TL_" > -1) then {
- classtype = 'leader';
- };
- if ((typeOf _x) find "_GL_" > -1) then {
- classtype = 'grenadier';
- };
- if (((typeOf _x) find "_LAT_" > -1) OR ((typeOf _x) find "_AA_" > -1)) then {
- classtype = 'at';
- };
- if ((typeOf _x) find "_medic_" > -1) then {
- classtype = 'medic';
- };
- if ((typeOf _x) find "_repair_" > -1) then {
- classtype = 'engineer';
- };
- if ((typeOf _x) find "_exp_" > -1) then {
- classtype = 'explosive';
- };
- _toplayersArray = [name _x, pos, [format ["%1", side _x], classtype], [status, vehicletype]];
- playersArray pushBack _toplayersArray;
- } forEach allUnits + allDead - vehicles - agents;
- ['setAllPlayerData', [playersArray]] call sock_rpc;
- sleep 2;
- }
- };
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement