OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting Multiplayer => Topic started by: 24Gamer on 05 May 2004, 19:43:49
-
i used a tutorial to aid in my making of a deathmatch and i only have one more problem to solve...
the ending score is displayed using an array called PlayerList, in the tutorial it said to create a trigger that would include all the players playing and upon activation PlayerList = ThisList, in theory it works but through debuging i found out that the count of the array is 22 and since there are only 6 players this is obviously wrong. i believe this is due to 'ThisList' of the trigger including stationary objects. :-\
does anyone know how to create the PlayerList?
-
You can do it that way:
Give each unit an individual name (like: w1, w2, etc.).
Now in your init.sqs you could place the following two lines:
PlayerList = []
"if (alive _x) then {PlayerList = PlayerList + [_x]}" foreach [w1,w2,w3,w4,w5,w6,w7,w8,w9,w10,w11,w12]
P.S: this method will not make a difference between AI or player
controlled units - it just fills the array PlayerList with all alive units
from given array: [w1,w2,w3,w4,w5,w6,w7,w8,w9,w10,w11,w12]
In the array you should type each unit's name, which you would
like to be present in PlayerList.
hope this helps
~S~ CD
-
thanks