Function GetPlayersByMapControl
- Line
- 4865
- Location
- blizzard.j
- Constant?
- no
- Type
- function
- Arguments
- mapcontrol whichControl
- Returns
- force
| 4865 | function GetPlayersByMapControl takes mapcontrol whichControl returns force |
| 4866 | local force f = CreateForce() |
| 4867 | local integer playerIndex |
| 4868 | local player indexPlayer |
| 4869 | |
| 4870 | set playerIndex = 0 |
| 4871 | loop
|
| 4872 | set indexPlayer = Player(playerIndex) |
| 4873 | if GetPlayerController(indexPlayer) == whichControl then |
| 4874 | call ForceAddPlayer(f, indexPlayer) |
| 4875 | endif
|
| 4876 | |
| 4877 | set playerIndex = playerIndex + 1 |
| 4878 | exitwhen playerIndex == bj_MAX_PLAYER_SLOTS |
| 4879 | endloop
|
| 4880 | |
| 4881 | return f
|
| 4882 | endfunction
|