| 01-23-2010, 12:36 AM | #2 |
What about a for loop from 1 to 12? Pseudo:
for each integer A from 1 to 12:
If (Player(A) Slot status = playing) and (Player(A) Controller = user) then
// Real player - do nothing
else
// BAM!
endif |
| 01-23-2010, 12:39 AM | #3 |
In a sense, it does loop from 1-12 because it does it for each player. I know the trigger fires correctly because it will work if the player is set to a computer. The problem is that my conditions can't identify an Open or Closed slot. EDIT: Yeah, I tried that but couldn't get it to work. |
| 01-23-2010, 03:22 AM | #4 |
JASS:function blah takes nothing returns nothing local integer i = 0 local player p = null loop exitwhen i >= bj_MAX_PLAYERS set p = Player(i) if not (GetPlayerSlotState(p) == PLAYER_SLOT_STATE_PLAYING and GetPlayerController(p) == MAP_CONTROL_USER) then // do what you want here endif set i = i + 1 endloop return Player(0) endfunction this is what I use, and also what Themerion posted. It should work. |
| 01-23-2010, 04:28 AM | #5 |
Yes! Thank you, both. That worked perfectly. |
| 01-23-2010, 09:09 AM | #6 |
Ammorth, why do you need to return Player(0) in your code? |
| 01-23-2010, 09:48 AM | #7 |
It was a copy/paste from a function I was using, but the function returned a player and I forgot to remove it... |
| 01-23-2010, 11:09 AM | #8 |
Oh alright then. I thought this involved another one of those bug-exploiting tricks or something.. |
