OFPEC Forum

Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting General => Topic started by: epsilonsun on 03 Oct 2008, 05:34:47

Title: How to run script only in server?
Post by: epsilonsun on 03 Oct 2008, 05:34:47

I try to edit a mp mission,but something wrong there.

script runs every player,

How to run script only in server?

thanks alot!
Title: Re: How to run script only in server?
Post by: Luke on 03 Oct 2008, 05:46:41
Try:

Code: [Select]
(isnull player)
as a condition, because servers do not have players.

luke
Title: Re: How to run script only in server?
Post by: Mandoble on 03 Oct 2008, 12:05:44
Wrong, servers have players, dedicated servers dont have players.
If you only want to be sure the script is run on the server (with or without player), just put a simple condition at the very first line of your script:

IF it is SQF then:
if (!isServer) exitWith {};

IF it is SQS then:
? !isServer: exit