Jump to content
Sign in to follow this  
Skagget

Unit Init GroupCommands

Recommended Posts

I dont really know how to explain the idea I have. I feel like Im missing a good solution to my fixing.

What I got is alot of diffrent units on the map. Some text/script is common for all units, but it gets messy and feels lame to copy/paste into all units init field.. is there not a better way to mirror the code ?

Say that I have the init "removeallweapon this;" and some other lines. But instead of multicopy.. I write either "exacVM code.sqf" or stash all the codes somewhere.

Share this post


Link to post
Share on other sites

If your doing it for player controlled units, you can put it in a simple script and execute it like this:

init.sqf

execVM "myscript.sqf";

That will get executed on everyones client.

If you wanted to do something to all units you could use this array:

allUnits

{removeAllWeapons _x;} forEach allUnits;

You could do that in the init.sqf or a trigger or an object init.

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
Sign in to follow this  

×