OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting Multiplayer => Topic started by: CopyrightPhilly on 13 Jun 2005, 16:20:16
-
ok i have a script that will move the players the a possion using setpos
ok and another, i'm using the units init filed to exec a script, that then adds them to an array...
should these be ran localy or server only?
cheers,
Phil
-
Depends what you want to do. Your question is too vague.
Obviously if more then one script are running at the same time go local, however if you want an array to keep all units added to it, then you would have to go global.
-
You could just put this in your init.sqs:
;init.sqs - player detection
;
player_pool = [player1,player2,player3,player4,player5,player6,player7,player8,player9,player10,player11,player12]
player_array = []
"if (alive _x) then {player_array = player_array + [_x]}" forEach player_pool
all you need change of course is;
playerx to whatever name you gave your players, and the
names of the arrays ;)
No need for local/global, as init.sqs will be run everywhere and
so the check for presence of the units - no queries about wether local or global in this case.
And setposs'ing a player unit should be global anyway (as i
reckon setpos to be a global command).
:edit - oh i forgot to explain what the init.sqs script does;
first you put all playable units into an array (player_pool), and second you proove this array for present units (not disabled in player selection screen), and put them into another array (player_array)
~S~ CD