Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
loadtarget
#1
? 
I want to jan can follow teammate
and if teammate is in range
she will loadtarget for enemy
this is my program but isn't work
How can i correct it?





Code:
void id()
{


    D(0,0);
    A(0,0);
    J(0,0);
    right(0,0);
    down(0,0);
    left(0,0);
    up(0,0);

        for (int i = 0; i < 400; i++){ //target
        if (loadTarget(i) == 0 && target.num != self.num && target.team==self.team){
            break;
        }
    
}



int VARxdst = self.x-target.x;
int VARydst = self.y-target.y;
int VARzdst = self.z-target.z;
int VARzbgu = self.z-bg_zwidth1;
int VARzbgb = bg_zwidth2-self.z;
int VARxbgr = bg_width-self.x;
int VARxabs = abs(VARxdst);
int VARyabs = abs(VARydst);
int VARzabs = abs(VARzdst);
int VARsf; //self facing
int VARtf; //target facing
int VARDirToTargetH; //lawannya di kiri atau kanan
int VARDirToTargetV; //lawannya di atas atau bawah
int VARholdinglgtweapon = 0;

    
if(self.facing == true){VARsf = -1;}
if(self.facing == false){VARsf = 1;}
if(target.facing == true){VARtf = -1;}
if(target.facing == false){VARtf = 1;}
if(VARxdst < 0){VARDirToTargetH = 1;}
if(VARxdst > 0){VARDirToTargetH = -1;}
if(VARzdst < 0){VARDirToTargetV = 1;}
if(VARzdst > 0){VARDirToTargetV = -1;}

  


    if(target.hp>0)
     {
    if(VARzdst<-30)
        down(1,1);
    else if(VARzdst>30)
        up(1,1);
    else if(VARxdst<-200)
        right(1,1);
    else if(VARxdst>200)
        left(1,1);
      }


    if(VARzdst>-30 && VARzdst<30 && VARxdst>-200 && VARxdst<200)
    {

        for (int i = 0; i < 400; i++){ //target
               if (loadTarget(i) == 0 && target.num != self.num && target.team!=self.team){
               break;
        }    
         }

    }




    if(target.hp>0 && VARzabs<= 20 && target.team!=self.team)
        {
        if(VARxdst>-75 && VARxdst<0 )
           {
            if(VARsf==-1)
            right(1,1);
              A();
             }
    else if(VARxdst<75 && VARxdst>=0)
          {
        if(VARsf==1)
        left(1,1);
              A();
          }
    else
          {
        left(0,0);
        right(0,0);
        A(0,0);
    
              }
    
    }

    
}












Reply
Thanks given by:


Messages In This Thread
loadtarget - by 90134123 - 01-14-2014, 09:16 AM
RE: loadtarget - by Boop - 01-14-2014, 03:10 PM
RE: loadtarget - by 90134123 - 01-14-2014, 05:58 PM
RE: loadtarget - by 90134123 - 01-23-2014, 06:42 AM
RE: loadtarget - by YinYin - 01-23-2014, 10:22 AM
RE: loadtarget - by 90134123 - 01-23-2014, 03:54 PM
RE: loadtarget - by YinYin - 01-23-2014, 07:33 PM
RE: loadtarget - by 90134123 - 01-24-2014, 08:20 AM



Users browsing this thread: 1 Guest(s)