I did a while back, I found an unknown native which did the trick. It’s now been documented (SwitchInPlayer) and you can use it as follows.
SwitchOutPlayer(PlayerPedId(), 0, 1) Will put you up into the clouds and leave you there then SwitchInPlayer(PlayerPedId()) (_0xD8295AF639FD9CB8)Takes you back down to your ped and moves the camera if the ped is in a different location.
@Jaymo already provided the answer… not sure why there’s so much confusion.
Of course nobody’s going to give you the full script completed, jaymo gave you the natives that you needed to use and now it’s up to you to put those to use in your script wherever you want to put them.
Right, I just wanted to put something here to avoid confusion.
The native’s _SWITCH_OUT_PLAYER and START_PLAYER_SWITCH both “start” something called a “player switch”. (as per the native’s)
A player switch, as I understand it, is the action of changing the active ped (in single player) from one of the 3 playable characters to another in a way which is unobtrusive to the gameplay.
Rockstar created a native to accomplish this specific task for singleplayer use. This is START_PLAYER_SWITCH and basically does the following actions.
First, step out the camera to the manually specified level (the 4rd argument) when it is ≥1 and ≤3 or, automatically calculate the correct camera level by using the distance between the two given peds (1st and 2nd args) then, move the camera to the x and y position of the ped specified by the 2nd argument and set the active player ped to that ped and finally, step the camera back down when the terrain around the ped is properly loaded.
The forth argument of START_PLAYER_SWITCH is a flags argument that modifies the player switch behaviour in different ways (like skipping the first camera step out sequence or hanging the camera at the last step coming down)
_SWITCH_OUT_PLAYER and _SWITCH_IN_PLAYER are like the two parts/camera movements in a player switch. You can think of _SWITCH_OUT_PLAYER being the 1st, 3rd and 4th arguments of START_PLAYER_SWITCH with _SWITCH_IN_PLAYER being the 2nd.
From what I understand _SWITCH_OUT_PLAYER does the camera step out and sets up the current player switch and _SWITCH_IN_PLAYER does the the camera moving and stepping in.
So basically,
SwitchOutPlayer(PlayerPedId(), 0, 1)
-- move the player ped somewhere
SwitchInPlayer(PlayerPedId())