View Single Post
  #1  
Old 07-12-2010, 12:41 AM
xAndrewx xAndrewx is offline
Registered User
xAndrewx's Avatar
Join Date: Sep 2004
Posts: 5,260
xAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud of
allplayers global var

Having a bit of a problem...

I'm choosing a random player that isn't the player on another client, but its not optimizing as it should, any ideas?
HTML Code:
function onActionGrab() {
  temp.list = allplayers;
  echo(temp.list);
  while (temp.pl == null) {
    temp.pl = temp.list[int(random(0, temp.list.size()))];
    
    echo("testing" SPC temp.pl);
    echo("times" SPC temp.pl.computerfirstlogin SPC player.computerfirstlogin);
    
    if (temp.pl.computerfirstlogin = player.computerfirstlogin) {
      temp.list.remove(temp.pl);
      echo("REMOVED" SPC temp.pl);
      temp.pl = null;
    }
  }
  
  echo("found" SPC temp.pl);    
}
gives this result
HTML Code:
allplayers
testing Graal707396
times 1250035986 1250035986
REMOVED Graal707396
testing Graal707396
times 1250035986 1250035986
REMOVED Graal707396
testing Graal707396
times 1250035986 1250035986
REMOVED Graal707396
testing WanDaMan
times 1250035986 1250035986
REMOVED WanDaMan
testing Sp_lit
times 1262628732 1250035986
found Sp_lit
when really it shouldn't be checking the same account more than once.
__________________
Reply With Quote