12.12.2010, 10:21
I have 2 players online but it only loops only for 1?
It should print 2 times, because there are 2 players but it stops at first player so it prints only 1 time.
What's the prob?
EDIT: I just used my brain and my brain says that it will stop looping at returns, any ideas?
EDIT2: testing code
Код:
stock IsOnline(cid) { foreach(Player, i) { printf("CharID: %i Search ID:%i", AccountData[i][characterID], cid); if(AccountData[i][characterID] == cid) return i; else return INVALID_PLAYER_ID; } }
What's the prob?
EDIT: I just used my brain and my brain says that it will stop looping at returns, any ideas?
EDIT2: testing code