Jump to content

Recommended Posts

Hi, I'm having problems figuring out what I'm doing wrong with the command drawIcon. It works in singleplayer and the icon shows up on the map, but in multiplayer it doesn't. It's supposed to be displayed on both the GPS-minimap and the regular map screen.

 

Here's the code I've got so far. It's executed on the init of the unit (fredrik) in question.

((findDisplay 12) displayCtrl 51) ctrlAddEventHandler ["Draw", {
	(_this select 0) drawIcon [
		"iconManMedic",
		[0,0,1,1],
		(getPosWorld fredrik),
		0.5 / ctrlMapScale (_this select 0),
		0.5 / ctrlMapScale (_this select 0),
		getDir fredrik,
		(name fredrik)
	];
}];

 

Any kind of clarification on how to get it to show up on the GPS and in multiplayer would be appreciated!

Thanks!

Share this post


Link to post
Share on other sites

For the GPS:

miniMapEH = ((uiNamespace getVariable "RscCustomInfoMiniMap") displayCtrl 101) ctrlAddEventHandler ["Draw", client_fnc_playerMarkers];

Where do you run your code?

  • Like 1

Share this post


Link to post
Share on other sites
3 hours ago, HazJ said:

For the GPS:


miniMapEH = ((uiNamespace getVariable "RscCustomInfoMiniMap") displayCtrl 101) ctrlAddEventHandler ["Draw", client_fnc_playerMarkers];

Where do you run your code?

 

Thanks for the code!

 

I'm executing it on the players init field inside the editor. But I've tried initServer.sqf and initPlayerLocal.sqf

Share this post


Link to post
Share on other sites

In initPlayerLocal.Sqf:

[] spawn {

waitUntil {!isNull findDisplay 12};

//your script here 

} ;

Share this post


Link to post
Share on other sites
16 hours ago, mrcurry said:

In initPlayerLocal.Sqf:

[] spawn {

waitUntil {!isNull findDisplay 12};

//your script here 

} ;

 

Right, so the display wasn't initialized when the event handler was made. Guess that makes sense. Thanks!

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×