Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #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
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 01:49 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.