I thought you had a trigger doing the groupChat thing. If so, then use the same trigger to excute the script. No you shouldn't replace "_alldudes" and "_ndudes" to real player names because you've already parsed them in when you call the script.
See if you go [P6, P7, P8] exec "aliveNChat.sqs", I presume that P6, P7 and P8 are all names that you've assigned, so the value parsed into the script will be valide as well.
[P6, P7, P8] is parsed as an array into the script. In the script, you can access this array by using the variable "_this". What I did there is just trying to make things clearer by assigning a variable "_alldudes" to "_this" meaning it's the array of all the people's name you've parsed in. (obviously I failed
)
"_ndudes" is just the number of elements in the array, so if the array is parsed in proprely, when you do a count, it should return the right number.
About the loop, at the first time the loop runs. _i should be 0, which means it will take the first element of the _alldudes array. If he is the sole survivor, then he should speak when the loop runs the first time and exit. And let's say the first guy (p6) died, then _i will become 1, and _curdude will be the second element in the array and so on so forth.
btw,
?(alive _curdude) : goto "speak"
means if _curdude is alive, then speak. To check if the first guy is dead, will be:
? (!alive _curdude) : got "speak"
Hope that helped
.