The importance of determining where the server is

By Spooner and Mandoble

For example, your mission might have many scripts that should not be executed on every connected machine and that isn't required to affect non-local units. For these cases you have two options:

There where you want to execute the script (for example, init.sqs or init.sqf), place a condition first:

? isServer : [] exec "myscript.sqs"
if (isServer) then {[] exec "myscript.sqs";};

Alternatively, put a guard condition inside the script itself, which will stop the script at that point if it is the server. Code before this guard condition will run on all machines, code after it will run only on the server:

; <--- Code run on every machine up to this point
? !isServer : exit
; <--- Code run only on the server after this point
// <--- Code run on every machine up to this point
if (!isServer) exitWith {};
// <--- Code run only on the server after this point