//init.sqf: [] execvm "crew.sqf";
if (isServer || isDedicated || !hasInterFace) exitWith {Diag_log "I was kicked from the crew.sqf I am not a true client";};
Private ["_name","_vehicle","_vehname","_weapname","_weap","_target","_picture","_vehtarget","_azimuth","_wepdir","_hudnames","_ui"];
disableSerialization;
while {true} do
{
1000 cutRsc ["HudNames","PLAIN"];
_ui = uiNameSpace getVariable "HudNames";
_HudNames = _ui displayCtrl 99999;
if(player != vehicle player) then
{
_name = "";
_vehicle = assignedVehicle player;
_vehname= getText (configFile >> "CfgVehicles" >> (typeOf vehicle player) >> "DisplayName");
_weapname = getarray (configFile >> "CfgVehicles" >> typeOf (vehicle player) >> "Turrets" >> "MainTurret" >> "weapons");
_weap = _weapname select 0;
_name = format ["%1
", _vehname];
{
if((driver _vehicle == _x) || (gunner _vehicle == _x) || (commander _vehicle == _x)) then
{
if(driver _vehicle == _x) then
{
_name = format ["%1
%2
", _name, (name _x)];
};
if(commander _vehicle == _x) then
{
_name = format ["%1
%2
", _name, (name _x)];
};
if(gunner _vehicle == _x) then
{
_name = format ["%1
%2
", _name, (name _x)];
};
}
else
{
//--- Fluit: Check if unit is second gunner
if (_vehicle turretUnit [2] == _x) then {
_name = format ["%1
%2
", _name, (name _x)];
} else {
_name = format ["%1
%2
", _name, (name _x)];
};
};
} forEach crew _vehicle;
_HudNames ctrlSetStructuredText parseText _name;
_HudNames ctrlCommit 0;
};
sleep 1;
//--- BL1P Leave script if player is not in vehicle
if(player == vehicle player) exitwith {diag_log "Leaving Crew.sqf";};
};