Home   Help Search Login Register  

Author Topic: PlayerList  (Read 1439 times)

0 Members and 1 Guest are viewing this topic.

24Gamer

  • Guest
PlayerList
« 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?

Offline Chris Death

  • Former Staff
  • ****
  • Finally Death's gonna get ya
    • OFPEC
Re:PlayerList
« Reply #1 on: 05 May 2004, 19:50:14 »
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
Dont argue with idiots....they will bring you down to their level and beat you there with experience.

How to use Waypoint type Scripted

24Gamer

  • Guest
Re:PlayerList
« Reply #2 on: 05 May 2004, 21:53:34 »
thanks