This is a very nice script for Arma 3 that will give each player a icon over their heads and their name and role. This is very useful for IFF and works very well.
addMissionEventHandler ["Draw3D", { { if ((side _x) == west) then { drawIcon3D [([_x, "texture"] call BIS_fnc_rankParams), [0,1,1,1], visiblePosition _x vectorAdd [0,0,3], 0.6, 0.6, 45, format ["%1 : %2", name _x, str((configFile >> "CfgVehicles" >> TypeOf _x >> "displayName") call BIS_fnc_GetCfgData)], 1, 0.05, "Caveat"]; }; } forEach allUnits; }]; |
Give this a go to help provide protection against accidental team kills. Put this in initPlayerLocal.sqf and your mission will have a fun component to identify other players on the battlefield.
This code will put flags on vehicles when players are in them. This will also help out.
// Keep a NATO flag on vehicles with players in it player addEventHandler ["GetInMan", { if ([typeOf (_this select 2), CLIENT_FlagVehicleFilter] call KER_fnc_passesTypeFilter) then { missionNamespace setVariable ['LicensePlate',getPlateNumber (_this select 2),FALSE]; (_this select 2) forceFlagTexture "\A3\Data_F\Flags\Flag_NATO_CO.paa"; (_this select 2) setPlateNumber PlayerRole; } }]; player addEventHandler ["GetOutMan", { if ({ isPlayer _x } count crew (_this select 2) == 0) then { (_this select 2) forceFlagTexture ""; (_this select 2) setPlateNumber LicensePlate; } }]; |
Even more useful code for mission makers.
Spawn the biggest possible explosion in the game and then damage everything around it.
bomb="ammo_Missile_Cruise_01" createVehicle [4103.3,3555.95,0.567905]; sleep 1; { _x setdamage 1; sleep 0.6; } foreach ( nearestobjects [[4103.3,3555.95,0.567905], [], 150 ] ); |
This works gradually to avoid lag, but does work very well.
This code can show the player’s ID number ???????
“””” addMissionEventHandler [ “Draw3D” , {
{
if ( ( side _x ) == west ) então {
drawIcon3D [ ( [ _x , “texture” ] chama BIS_fnc_rankParams ) , [ 0 , 1 , 1 , 1 ] , visiblePosition _x vectorAdd [ 0 , 0 , 3 ] , 0,6 , 0,6 , 45 ,formato [ “% 1:% 2” , nome _x , str ( ( configFile >> “CfgVehicles” >> TypeOf _x >> “displayName” ) chama BIS_fnc_GetCfgData ) ] , 1 , 0,05 , “Advertência” ] ;
} ;
} forEach allUnits ;
} ] ; “”””