Home   Help Search Login Register  

Author Topic: Server only problems.  (Read 1384 times)

0 Members and 1 Guest are viewing this topic.

Offline simonov

  • Members
  • *
Server only problems.
« 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

Offline Mr.Peanut

  • Former Staff
  • ****
  • urp!
Re: Server only problems.
« Reply #1 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:
« Last Edit: 30 May 2007, 18:58:46 by Mr.Peanut »
urp!

Offline simonov

  • Members
  • *
Re: Server only problems.
« Reply #2 on: 30 May 2007, 17:59:17 »
Doh! Im a n00b!

Cheers

S

Offline DucusSumus

  • Members
  • *
  • I'm a llama!
Re: Server only problems.
« Reply #3 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 {};