Jump to content
Spaxxow

Spawn units but to different players

Recommended Posts

So pretty much a long time I found this unit = group player createUnit ["classname", getPos player, [], 0, "FORM"]; and placed it in a radio trigger so when the player radios in he will get the corresponding unit. So after I implemented it in game it works but it spawns the unit for all players in game. Is there a way i can make it spawn only for the one activating the trigger.

Share this post


Link to post
Share on other sites

description.ext

class CfgCommunicationMenu {

	class spawnUnit {
		text = "Spawn new unit";
		icon = "\a3\Ui_f\data\GUI\Cfg\CommunicationMenu\call_ca.paa";
		expression = "null = (group (_this select 0)) createUnit ['B_medic_F', getPos (_this select 0), [], 0, 'FORM'];";
		cursor = "\A3\ui_f\data\igui\cfg\cursors\iconCursorSupport_ca.paa";
	};
};

init.sqf

if (hasInterface) then {

null = [player, "spawnUnit"] call BIS_fnc_addCommMenuItem;
};
  • Like 1

Share this post


Link to post
Share on other sites

 

description.ext

class CfgCommunicationMenu {

	class spawnUnit {
		text = "Spawn new unit";
		icon = "\a3\Ui_f\data\GUI\Cfg\CommunicationMenu\call_ca.paa";
		expression = "null = (group (_this select 0)) createUnit ['B_medic_F', getPos (_this select 0), [], 0, 'FORM'];";
		cursor = "\A3\ui_f\data\igui\cfg\cursors\iconCursorSupport_ca.paa";
	};
};

init.sqf

if (hasInterface) then {

null = [player, "spawnUnit"] call BIS_fnc_addCommMenuItem;
};

Thank you for your help. But I've googled and searched the mission folders and searched in game. I cannot find out where to put these. Again thank you much.

Share this post


Link to post
Share on other sites
On 10/29/2016 at 3:54 PM, davidoss said:

description.ext


class CfgCommunicationMenu {

	class spawnUnit {
		text = "Spawn new unit";
		icon = "\a3\Ui_f\data\GUI\Cfg\CommunicationMenu\call_ca.paa";
		expression = "null = (group (_this select 0)) createUnit ['B_medic_F', getPos (_this select 0), [], 0, 'FORM'];";
		cursor = "\A3\ui_f\data\igui\cfg\cursors\iconCursorSupport_ca.paa";
	};
};

init.sqf


if (hasInterface) then {

null = [player, "spawnUnit"] call BIS_fnc_addCommMenuItem;
};

I figured it out and now I will proceed to test it.

Share this post


Link to post
Share on other sites

I figured it out. Thank you Sergeant. This is going to be Legen wait for it...

Share this post


Link to post
Share on other sites

Ladies and Gentleman I present to you Spyder Addons completely laps what I wanted thanks again for the help.

Share this post


Link to post
Share on other sites

Sorry, I didn't see this post before.

For radio trigger, if you want to run a script on the PC which called the radio, you need to script the radio trigger with the local syntax. It's impossible with editor.

See more here and here.

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

×