Determining whether the script is running on a client or the server

By Spooner and Mandoble

In older versions of the game, the most common way to check for server was to add a gamelogic named "server" from the editor to the mission, and then just do the following check:

? local server
if (local server) then {

This workaround is actually not needed any more, although it still works correctly and you will still see it used in older scripts, since the introduction of the isServer command (in ArmA 1.07):

? isServer && !local player : hint "I'm a dedicated server"
? isServer && local player : hint "I'm a single-player host (client & server)"
if (isServer && !local player) then { hint "I'm a dedicated server"; }
if (isServer && local player) then { hint "I'm a single-player host (client & server)"; };