Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void SpawnVehicle(Hash hash)
- {
- if (IS_MODEL_IN_CDIMAGE(hash))
- {
- REQUEST_MODEL(hash);
- while (!HAS_MODEL_LOADED(hash)) WAIT(0);
- /* gets coordinates + 2 on y axis from you */
- Vector3 pos = GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(PLAYER_PED_ID(), 0, 2.0, 0);
- Vehicle veh = CREATE_VEHICLE(hash, pos.x, pos.y, pos.z, GET_ENTITY_HEADING(PLAYER_PED_ID()), 0, 1);
- SET_MODEL_AS_NO_LONGER_NEEDED(hash);
- PrintMessage("Spawned vehicle");
- }
- else
- PrintMessage("Vehicle doesn't exist");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement