OFPEC Forum

Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting Multiplayer => Topic started by: corrupt3d_Oracle on 09 Aug 2007, 04:56:57

Title: SOLVED: Script calling for both players
Post by: corrupt3d_Oracle on 09 Aug 2007, 04:56:57
I took Kronzky's portable target range script and tried to make it compatible for my friend and I online.
Link here (http://www.armaholic.com/page.php?id=1262)

Unfortunately, it creates 2 of each target. One pair for me and another for my friend. I thought it had to do with the 'player' words in the sqf included (targetrange.sqf). I took that out and replaced it with specific names (spotter for myself and sniper for my friend)...but it still does this.

Is there a way (calling from a trigger or elsewhere) to call this and only have the 1 group spawn rather than 1 group for each of us?

Thanks again guys,

Corrupt3d

(I will post scripts if necessary, but I thought it was mainly a theory question that could be explained)
Title: Re: Script calling for both players
Post by: DarkNova on 11 Aug 2007, 10:31:46

sounds like you're executing code on the server and the client instead of just the server/host

use the command IsServer so the create code is only executed on the server/host

multiplayer scripting examples here:

http://community.bistudio.com/wiki/Multiplayer_scripting#Examples

Title: Re: Script calling for both players
Post by: corrupt3d_Oracle on 14 Aug 2007, 19:44:32
Worked like a charm (modifying it for sqf instead of sqs at least).

All I had to do was add the following to the beginning of the script and it worked fine.
Code: [Select]
if (!isServer) exitWith {};

Thanks again,
Corrupt3d