Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Vector3 get_blip_marker()
- {
- static Vector3 zero;
- Vector3 coords;
- bool blipFound = false;
- // search for marker blip
- int blipIterator = UI::_GET_BLIP_INFO_ID_ITERATOR();
- for (Blip i = UI::GET_FIRST_BLIP_INFO_ID(blipIterator); UI::DOES_BLIP_EXIST(i) != 0; i = UI::GET_NEXT_BLIP_INFO_ID(blipIterator))
- {
- if (UI::GET_BLIP_INFO_ID_TYPE(i) == 4)
- {
- coords = UI::GET_BLIP_INFO_ID_COORD(i);
- blipFound = true;
- break;
- }
- }
- if (blipFound)
- {
- return coords;
- }
- set_status_text("Map marker isn't set");
- return zero;
- }
- void get_chauffeur_to_marker()
- {
- Vector3 coords = get_blip_marker();
- if (coords.x + coords.y == 0) return;
- // get entity to teleport
- Entity e = PLAYER::PLAYER_PED_ID();
- if (PED::IS_PED_IN_ANY_VEHICLE(e, 0)) //kick out of current veh
- {
- AI::CLEAR_PED_TASKS_IMMEDIATELY(PLAYER::PLAYER_PED_ID());
- }
- GAMEPLAY::GET_GROUND_Z_FOR_3D_COORD(coords.x, coords.y, coords.z, &coords.z);
- coords.z += 3.0;
- Hash V_hash = GAMEPLAY::GET_HASH_KEY("STRETCH");
- Hash P_hash = GAMEPLAY::GET_HASH_KEY("A_C_CHIMP");
- STREAMING::REQUEST_MODEL(V_hash);
- STREAMING::REQUEST_MODEL(P_hash);
- while ((!STREAMING::HAS_MODEL_LOADED(V_hash)) || (!STREAMING::HAS_MODEL_LOADED(P_hash))) WAIT(0);
- Vector3 spawn_coords = ENTITY::GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(PLAYER::PLAYER_PED_ID(), 0.0, 5.0, 0.0);
- FLOAT lookDir = ENTITY::GET_ENTITY_HEADING(PLAYER::PLAYER_PED_ID());
- Vehicle veh = VEHICLE::CREATE_VEHICLE(V_hash, spawn_coords.x, spawn_coords.y, spawn_coords.z, lookDir, 1, 0);
- Ped ped = PED::CREATE_PED(25, P_hash, spawn_coords.x, spawn_coords.y, spawn_coords.z, 0, false, false);
- while (!NETWORK::NETWORK_HAS_CONTROL_OF_ENTITY(veh))
- {
- NETWORK::NETWORK_REQUEST_CONTROL_OF_ENTITY(veh);
- WAIT(0);
- }
- VEHICLE::SET_VEHICLE_ENGINE_ON(veh, TRUE, TRUE);
- VEHICLE::SET_VEHICLE_COLOURS(veh, 0, 0);
- VEHICLE::SET_VEHICLE_NUMBER_PLATE_TEXT(veh, "ENT VIP");
- PED::SET_PED_INTO_VEHICLE(ped, veh, -1);
- for (int i = 1; i <= 8; i++)
- {
- if (!VEHICLE::IS_VEHICLE_SEAT_FREE(veh, i)) continue;
- AI::TASK_WARP_PED_INTO_VEHICLE(PLAYER::PLAYER_PED_ID(), veh, i); break;
- }
- //AI::TASK_VEHICLE_MISSION_COORS_TARGET(ped, veh, coords.x, coords.y, coords.z, 4, 7.0f, 0xC0027, 5.0f, -1.0f, 1);
- AI::TASK_VEHICLE_DRIVE_TO_COORD(ped, veh, coords.x, coords.y, coords.z, 100, 1, ENTITY::GET_ENTITY_MODEL(veh), 4, 0xC00AB, -1);//DRIVING MODE 4
- /* DRIVING MODES :
- 0 = Normal behaviour but doesnt recognize other cars on the road, should only be used without pedcars in world.
- 1 = Drives legit and does no overtakes.Drives carefully
- 2 = Normal behaviour but doesnt recognize other cars on the road, should only be used without pedcars in world.
- 3 = Drives legit and does normal overtakes.Ignores traffic lights, and avoids other cars
- 4 = Drives legit and does normal overtakes.Ignores traffic lights, and avoids other cars(fast accelerate, chase ? )
- 5 = Drives legit and does normal overtakes.Ignores traffic lights, and avoids other cars
- 6 = Drives legit and does normal overtakes.Ignores traffic lights, and avoids other cars
- 7 = Drives legit and does overtakes depending on speed ? Drives carefully
- 8 = Normal behaviour but doesnt recognize other cars on the road, should only be used without pedcars in world.
- 9 = Drives legit and does no overtakes.Drives carefully
- 10 = Normal behaviour but doesnt recognize other cars on the road, should only be used without pedcars in world.
- */
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement