Advertisement
Guest User

Untitled

a guest
Aug 29th, 2015
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.03 KB | None | 0 0
  1. void cheat_handle_coordmaster()
  2. {
  3.     static int time=0;
  4.     if(cheat_state->_generic.coordmaster == 1)
  5.     {
  6.         if(GetTickCount()-set.coord_time > time)
  7.         {
  8.             if (*(int *)0xBA6774 != 0)
  9.             {
  10.                 float   mapPos[3];
  11.                 for ( int i = 0; i < (0xAF * 0x28); i += 0x28 )
  12.                 {
  13.                     if ( *(short *)(0xBA873D + i) == 4611 )
  14.                     {
  15.                         GTAfunc_LockActor(1);
  16.                         float   *pos = (float *)( 0xBA86F8 + 0x28 + i );
  17.                         gta_interior_id_set( 0 );
  18.                         mapPos[0] = *pos;
  19.                         mapPos[1] = *( pos + 1 );
  20.                         mapPos[2] = pGameInterface->GetWorld()->FindGroundZForPosition(mapPos[0], mapPos[1]) + 2.0f;
  21.                         float cpos[3] = {pPedSelf->GetPosition()->fX,pPedSelf->GetPosition()->fY,pPedSelf->GetPosition()->fZ};
  22.                         char opa=0;
  23.                         if(cpos[0] > mapPos[0])
  24.                         {
  25.                             if(cpos[0]-mapPos[0] > set.coord_distance) cpos[0] -= set.coord_distance;
  26.                             else
  27.                             {
  28.                                 cpos[0] = mapPos[0];
  29.                                 opa++;
  30.                             }
  31.                         }
  32.                         else
  33.                         {
  34.                             if(mapPos[0]-cpos[0] > set.coord_distance) cpos[0] += set.coord_distance;
  35.                             else
  36.                             {
  37.                                 cpos[0] = mapPos[0];
  38.                                 opa++;
  39.                             }
  40.                         }
  41.                         if(cpos[1] > mapPos[1])
  42.                         {
  43.                             if(cpos[1]-mapPos[1] > set.coord_distance) cpos[1] -= set.coord_distance;
  44.                             else
  45.                             {
  46.                                 cpos[1] = mapPos[1];
  47.                                 opa++;
  48.                             }
  49.                         }
  50.                         else
  51.                         {
  52.                             if(mapPos[1]-cpos[1] > set.coord_distance) cpos[1] += set.coord_distance;
  53.                             else
  54.                             {
  55.                                 cpos[1] = mapPos[1];
  56.                                 opa++;
  57.                             }
  58.                         }
  59.                         if(opa == 2)
  60.                         {
  61.                             cpos[2] = mapPos[2];
  62.                             cheat_state->_generic.coordmaster = 0;
  63.                             GTAfunc_TogglePlayerControllable(0);
  64.                             GTAfunc_LockActor(0);
  65.                         }
  66.                         else cpos[2] = pGameInterface->GetWorld()->FindGroundZForPosition(cpos[0], cpos[1])-20;
  67.                         cheat_teleport(mapPos,0);
  68.                     }
  69.                 }
  70.             }
  71.             else
  72.             {
  73.                 addMessageToChatWindow("Поставьте метку на карте!");
  74.                 cheat_state->_generic.coordmaster = 0;
  75.             }
  76.             time = GetTickCount();
  77.         }
  78.     }
  79.     return;
  80. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement