Nicolas Eymerich 0 Posted July 21, 2005 Hi I need a little suggestion. In particular, I've succeded to edit a script that check how many player are present in the same team. The script looks like: _unit = units group player _num = count _unit _i = 0; _b = 0; #lp ? ((_unit select _i) == player) : _b = _b + 1 ? (_b > 1) : goto "" _i = _i + 1 ? (_i >= num) : exit ~0.5 goto "lp" But I've a question. I'm doubtful that this script will work when two persons are playing in different teams. In such case, how can I solve the problem? Thanks for reading... Share this post Link to post Share on other sites
Metal Heart 0 Posted July 21, 2005 Use arrays to define all playable units. Like westplayableunits=[W01, W02, W03, W04...]; and eastplayableunits=[E01, E02...]; Then allplayableunits=westplayableunits + eastplayableunits. You can also use triggers to count units with thislist parameter. What's this do? ? (_b > 1) : goto "" And here should be _num I think: ? (_i >= num) : exit Share this post Link to post Share on other sites
Nicolas Eymerich 0 Posted July 21, 2005 Thanks! 2) Yes it is _num (just a mistake!. 1) Well ---> ? (_b>1) : goto "another part of the script". It was useless for the resolution of the problem. Your answer is pretty good for me. I've read somewhere that "list" statement is a command to avoid. Except the array and the list functions... (maybe i'm requesting too much) there'nt no other way? I mean a way, how can I put this..., "automatic"... or better: a way to allow user to avoid him to define, every time, every single playable unit (in the array [by the way: what's happen if there is the respawn?]) or to use a trigger in the mission editor? Share this post Link to post Share on other sites
Guest [B.B.S.] T_D Posted July 21, 2005 Maybe this command helps you: Quote[/b] ]playersNumber sideOperand types: side: Side Compatibility: Version 1.8 required. Type of returned value: Number Description: Return count of players playing on given side. Share this post Link to post Share on other sites
Garcia 0 Posted July 21, 2005 I once tried to make a script to check if any players were in different groups, and if there were no players in the group, then delete the whole group. Problem was, for some reason it worked sometimes, but then suddenly it deleted all the AI in all the playable groups...no matter if there were a player in the group The way I did it, was to run a script for every playable unit, then check if the unit was player...if the unit was a player, then add 1 to a variable, 3 variables, 1 for each group, then when the scripts were done, count the variables, and if one was 0, then delete that group...dunno why it failed...maybe the game can't count properly Share this post Link to post Share on other sites
Nicolas Eymerich 0 Posted July 22, 2005 ---> To Garcia: Maybe your script it was a bit... complicated I've learned that Mp mission have to be most simple as much as you can. Especially for scripts in it. ---> to [b.B.S.] T_D: Well, the command "playersNumber side" return me a number. In other words: now I know how many players are present in a Mp sessions. But for my purpose I need an array... However... Thanks again to you all... Share this post Link to post Share on other sites