SHARE
TWEET

Untitled

a guest Nov 9th, 2019 71 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.         case Superr:
  2.         {
  3.             Menu::Title("");
  4.  
  5.             for (int i = 0; i < ARRAYSIZE(Super); i++)
  6.             {
  7.                 if (Menu::Option(Super[i]))
  8.                 {
  9.                     DWORD cars = GAMEPLAY::GET_HASH_KEY(Super[i]);
  10.                     STREAMING::REQUEST_MODEL(cars);
  11.                     while (!STREAMING::HAS_MODEL_LOADED(cars)) WAIT(0);
  12.                     autovehi(Super[i]);
  13.                 }
  14.             }
  15.         }
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23. autovehi:
  24.  
  25.  
  26. void autovehi(char* toSpawn) {
  27.     Hash model = GAMEPLAY::GET_HASH_KEY(toSpawn);
  28.     if (STREAMING::IS_MODEL_VALID(model))
  29.     {
  30.  
  31.         STREAMING::REQUEST_MODEL(model);
  32.         while (!STREAMING::HAS_MODEL_LOADED(model)) WAIT(0);
  33.         Vector3 ourCoords = ENTITY::GET_ENTITY_COORDS(PLAYER::PLAYER_PED_ID(), false);
  34.         float forward = 5.f;
  35.         float heading = ENTITY::GET_ENTITY_HEADING(PLAYER::PLAYER_PED_ID());
  36.         float xVector = forward * sin(degToRad(heading)) * -1.f;
  37.         float yVector = forward * cos(degToRad(heading));
  38.         Vehicle veh = VEHICLE::CREATE_VEHICLE(model, ourCoords.x + xVector, ourCoords.y + yVector, ourCoords.z, heading, true, true);
  39.         RequestControlOfEnt(veh);
  40.         VEHICLE::SET_VEHICLE_ENGINE_ON(veh, true, true, true);
  41.         VEHICLE::SET_VEHICLE_ON_GROUND_PROPERLY(veh);
  42.         NETWORK::NETWORK_FADE_IN_ENTITY(veh, 0);
  43.         DECORATOR::DECOR_SET_INT(veh, "MPBitset", 0);
  44.         auto networkId = NETWORK::VEH_TO_NET(veh);
  45.         ENTITY::_SET_ENTITY_REGISTER(veh, true);
  46.         BypassOnlineVehicleKick(0);
  47.         if (NETWORK::NETWORK_GET_ENTITY_IS_NETWORKED(veh))
  48.             NETWORK::SET_NETWORK_ID_EXISTS_ON_ALL_MACHINES(networkId, true);
  49.     }
  50. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top