OFPEC Forum
Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting Multiplayer => Topic started by: simonov on 30 May 2007, 11:38:40
-
I have seen many posts about this but for some reason cannot get it working. I need certain events within a mission to be executed on the the server only. At present, when I run the mission on my dedicated server I get as many bombs as there are players as opposed to the one bomb I want. Can someone adjust this for me so that it works. I have the logic named "server" in the mission and it seems to work in the editor but as soon as I get it on the dedicated it starts multiplying the events by the number of players.
?(Local server): exit
bomb = "Bo_GBU12_LGB" createvehicle [getpos bomb1 select 0, getpos bomb1 select 1,(getpos bomb1 select 2) +1800];
sleep4;
exit;
and for flares
?(Local server): exit
blah = "F_40mm_White" createvehicle [getpos myflare select 0, getpos myflare select 1,(getpos myflare select 2) +225];
exit;
Tx in advance
S
-
What you want is:
? !(local server): exit
If the machine is not the server, you want the script to exit. The exclamation point is the not operator. Your original code line
you had the script executing on every machine except the server! :blink:
-
Doh! Im a n00b!
Cheers
S
-
That line is .sqs syntax, but the rest of your script is .sqf syntax. You actually should use this:
if !(local server) exitWith {};