Jump to content
GentleKnot

How to Setidentity to all Zeus Spawned Opfor units

Recommended Posts

anybody would help me make sure that all zeus opfor spawned units have their Voice changed to something else as i use a custom voice mod and i just want all my opfor units to spawn with it on. would i need to put that in my init.sqf?

Share this post


Link to post
Share on other sites

Here is an example of a code that could do the trick.

 

But it will affect even the OpFor units placed in the editor or spawned differently than Zeus.

 

In the init.sqf:

if (isServer) then {

	[] spawn {

		while {true} do {

			{
				if (side _x == east && {!(_x getVariable ["withCustomIdentity", false])}) then {

					_x setVariable ["withCustomIdentity", true];

					[_x, "yourCustomIdentity"] remoteExecCall ["setIdentity" , 0, true]; // change "yourCustomIdentity" by the identity you want
				};

			} forEach allUnits;

			sleep 5;
		};
	};
};

EDIT : I've change the JIP option to true for the remoteExecCall command so that JIP players has the setIdentity too.

Edited by Crazy_Man
JIP compatible
  • Like 1

Share this post


Link to post
Share on other sites

Now i have an other question, when making a brand new and custom unit, for some reason it doesnt want to use the custom voice im chosing, ive tried everything, how can i force it to spawn with it? is there a way to add a init code into a custom unit?

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

×