Rommel 1 Posted July 22, 2006 <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> #loop ~1 M1 = {heli1} setmarkerpos getpos heli1 M2 = {hummer1} setmarkerpos getpos car1 M3 = {hummer2} setmarkerpos getpos car2 M4 = {Respawn_West} setmarkerpos getpos Field_Aid publicvariable "M1" publicvariable "M2" publicvariable "M3" publicvariable "M4" goto "loop" Does anyone know why it might not work? Share this post Link to post Share on other sites
Trapper 0 Posted July 22, 2006 I don't have the slightes idea what you're doing there with variables M1-M4. Just move the markers local on every client. <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> #loop ~1 "heli1" setmarkerpos getpos heli1 "hummer1" setmarkerpos getpos car1 "hummer2" setmarkerpos getpos car2 "Respawn_West" setmarkerpos getpos Field_Aid goto "loop" Share this post Link to post Share on other sites
Rommel 1 Posted July 22, 2006 It was an attempt at making it work on the server, it was originally like that, but after mucking around with the execution of the script I made it each individual executes it rather then the group, (individually [this] exec did it, rather than _x for each units group etc) and it worked. Share this post Link to post Share on other sites
Metal Heart 0 Posted July 22, 2006 I think you have the script running multiple times. Just exec the script from init.sqs ([] exec "script.sqs";) and it will run on each client and the server. The array that is passed to the script is just an array of variables, not a way of running commands on specific client. Share this post Link to post Share on other sites
Rommel 1 Posted July 23, 2006 Tried that Doesnt work, the only thing that works is making each individual execute it. Share this post Link to post Share on other sites
Metal Heart 0 Posted July 23, 2006 Init.sqs is run on everyone so a script executed there gets executed by all. If it doesn't work then you're doing it wrong. init.sqs goes into mission directory to exec a script without parameters: [] exec "scriptname.sqs"; Share this post Link to post Share on other sites
Trapper 0 Posted July 23, 2006 Metal Heart is right. You don't fully understand the scripting language and mp enviroment. Just because you've got it work in someway by trial and error it doesn't mean you've found the right way. 1. M1 = {heli1} setmarkerpos getpos heli1 This line will give you an error message in game. OFP variables can't store a direct command line. You would need a tricky combination of string varibale/format for this. And to make a script execute on the server only you have to place a gamelogic on map, name it server and make the first line of the script if (! local server) then {exit} 2. this exec "script.sqs" is run on every connected PC. When you add this for 12 group members the script is running 12 times on every PC. 3. There's no difference in adding this exec "script.sqs" to all soldiers of a group or a single {_x exec "script.sqs"} foreach units group this if done correctly. Share this post Link to post Share on other sites