View Single Post
  #2  
Old 04-06-2012, 07:36 AM
ffcmike ffcmike is offline
Banned
Join Date: Jul 2004
Location: London
Posts: 2,029
ffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond repute
Send a message via AIM to ffcmike Send a message via MSN to ffcmike
Quote:
Originally Posted by Gunderak View Post
I am currently making a targeting system and of course I don't want it so you can target yourself. But it seems it doesn't recognize when you are targeting yourself..
Here is the part that is problematic.
PHP Code:
function onMouseDown(bu){
  if(
leftmousebutton){
    for(
temp.players){
      if(
temp.!= player.account){
        if(
mousex in p.xp.| && mousey in p.yp.3|){
          
this.target temp.p;
          
onTimeout();
        }
      }
    }
  }

Does anyone here know why if(temp.p != player.account){ isn't working?
The 'players' array consists of player objects, not account strings, you need to check "temp.p != player".
You should also have a "return;" after establishing the target so it does not continue checking and possibly invoke multiple timeouts.
Reply With Quote