Advertisement
Guest User

Untitled

a guest
May 22nd, 2015
200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.78 KB | None | 0 0
  1. static void cornerKickDef(Client * thisclient) {
  2.         // http://youtu.be/93F43ppEQ2g
  3.  
  4.         char buf[1024];
  5.  
  6.         int time = thisclient->bl.get_time();
  7.         int mez_szam = thisclient->bl.get_squad_number() -1;
  8.         int lr = thisclient->bl.get_lr();
  9.  
  10.        
  11.         int tx = ( lr = 'l' ) ? (thisclient->bl.get_flag(Flag::GL).getX()) : (thisclient->bl.get_flag(Flag::GR).getX());
  12.         int ty = 6 - mez_szam;
  13.    
  14.     int current_x = thisclient->bl.estx;
  15.     int current_y = thisclient->bl.esty;
  16.    
  17.     int tavolsag = std::sqrt(((tx - current_x) * (tx - current_x)) + ((ty - current_y) * (ty - current_y)));
  18.                
  19.         if (tavolsag > 2)
  20.         {
  21.         std::snprintf(buf, 64, "(pos %d %d 100)\0", tx, ty);
  22.             thisclient->sndCmd(buf);
  23.         }
  24.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement