OFPEC Forum

Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting Multiplayer => Topic started by: ACE5th on 09 Nov 2008, 19:43:23

Title: Count player
Post by: ACE5th on 09 Nov 2008, 19:43:23
Hi @ All

I wuold like to screen All Players inside a trigger (Name Trigger1)

I Know about this command
Code: [Select]
hint format["%1", name (thislist select 0)]
but this command is only for one i would like to have All in a list.

Can anybody tell me what i have to do?

greez
ACE5th
Title: Re: Count player
Post by: ModestNovice on 10 Nov 2008, 04:04:35
Code: [Select]
hint format ["%1", thisList]
dont know if that is right or maybe this one:

Code: [Select]
{List_array = []; List_Array = List_Array + [_x]} foreach thisList; hint format ["%1", List_Array]
Title: Re: Count player
Post by: Spooner on 10 Nov 2008, 12:24:04
@DaChevs:
The former is correct , but the poster asked for a list of player names, not varnames (or object-ids, should the players be un-var-named). The latter continually clears the array on each loop, so in the end you'll just give out the last element of thisList (even if it initialised it correctly, by placing List_array = [] before the loop, it would just be copying thisList).

Being lazy, this leaves a ", " after the last name in the list:
Code: [Select]
str = ""; { str = str + (name _x) + ", "} forEach thisList; hint str;