OFPEC Forum

Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting Multiplayer => Topic started by: simonov on 30 May 2007, 11:38:40

Title: Server only problems.
Post 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.

Code: [Select]
?(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

Code: [Select]
?(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
Title: Re: Server only problems.
Post by: Mr.Peanut on 30 May 2007, 17:44:26
What you want is:
Code: [Select]
? !(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:
Title: Re: Server only problems.
Post by: simonov on 30 May 2007, 17:59:17
Doh! Im a n00b!

Cheers

S
Title: Re: Server only problems.
Post by: DucusSumus on 30 May 2007, 19:31:10
That line is .sqs syntax, but the rest of your script is .sqf syntax.  You actually should use this:
Code: [Select]
if !(local server) exitWith {};