to make sure a line or a command is run only by the server
1) Create a game logic, and in it's "name Box", type
Server
then use the following line at the very top of the script
? !(local server):exit
which translates as
"If this machine is not the server, then exit"
or if starting the script from the Init.sqs
? (local server):[] exec "myscript.sqs"
(If this machine is the server, then run "myscript.sqs")
reason being, that gamelogics are only seen as local to the server machine, therefore, a gamelogic named server can only be local to the server machine
any name would do, however, normal protocol is to name the gamelogic "server"
other options are to use the query in a script line
eg
;;myscript.sqs
line 1 do this
line 2 do this
?(local server): myvariable = myvariable + 1; Publicvariable "Myvariable"
line 3 will be run by the server only
the statement "local", basically means is the object i am referring too, local on this machine.
Things that arent local on a server are normally only Players