Posted: . At: 11:59 AM. This was 2 years ago. Post ID: 16333
Page permalink. WordPress uses cookies, or tiny pieces of information stored on your computer, to verify who you are. There are cookies for logged in users and for commenters.
These cookies expire two weeks after they are set.


A nice script to draw player icons on the GPS in Arma 3.


This code is placed in the initPlayerLocal.sqf. This will draw player icons and names on the GPS display. This is a very useful Arma 3 code sample.

initPlayerLocal.sqf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
[] spawn {
	waitUntil {!isNull (uiNamespace getVariable ["RscCustomInfoMiniMap", displayNull])};
 
	disableSerialization;
 
	private _display = uiNamespace getVariable ["RscCustomInfoMiniMap", displayNull];
	private _miniMapControlGroup = _display displayCtrl 13301;
	private _miniMap = _miniMapControlGroup controlsGroupCtrl 101;
 
	_miniMap ctrlAddEventHandler ["Draw", {
	(_this select 0) drawIcon [
		getText (configFile >> "CfgVehicles" >> typeOf (vehicle player) >> "icon"),
		sidecolorplayer,
		getPos player,
		19,
		19,
		getDir player,
		format ["%1:%2", profileName ,getText (configFile >> "CfgVehicles" >> typeOf (vehicle player) >> "displayName")],
		1,
		0.03,
		"PuristaMedium",
		"top"
	]
	}];
};

Use this code for a player to heal to full health when they use a First Aid Kit.

initPlayerLocal.sqf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
player addEventHandler ["HandleHeal", {
	_this spawn {
		params ["_injured","_healer"];
		missionNamespace setVariable ['Health',getDammage _injured,FALSE];
		_damage = Health;
		if (_injured == _healer) then {
			waitUntil { damage _injured != _damage };
			if (damage _injured < _damage) then {
				titletext ["You used Bandages and Morphine.", "PLAIN DOWN"];
				_injured setDamage 0;
			};
		};
	};
}];

That is also very useful indeed.


Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.