Flying Cam [GTA: Online Camera in Clouds]

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.

8 Likes
StartPlayerSwitch(PlayerPedId(), PlayerPedId(), 255, 1)

This starts the camera in the clouds and zooms you into your ped

the native you’re looking for is https://runtime.fivem.net/doc/reference.html#_0xD8295AF639FD9CB8 this one

1 Like

Why are you reiterating what I’ve already said?
It adds nothing to the topic…

sorry mr president didn’t read your post

2 Likes

okay thats my script right now

SwitchOutPlayer(PlayerPedId(), 0, 1)

SwitchOutPlayer(PlayerPedId(), 255, 1)

1 Like

hmm it didnt work :confused:

show your full script

where to put this StartPlayerSwitch(PlayerPedId(), PlayerPedId(), 255, 1)?

In the client side / in a thread

hey can you explain me where to put StartPlayerSwitch(PlayerPedId(), PlayerPedId(), 255, 1)?

what thread in what folder to put it

I found another topic to “SwitchOutPlayer” - I want to link this for reference:


Maybe these two topics could be useful together

@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.

Anyone know how to set camera to deafult or stop this native? Because my camera hangs on the third blink =(

Nana did you tried “SwitchInPlayer”?

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())
3 Likes

Where exactly do I add this piece of native?

Try using 0 in the flags argument

Thank for your response. I try make it and this is work, but until I figured out how to make it start before the ped spawns.

AddEventHandler("playerSpawned", function(spawn)
StartPlayerSwitch(PlayerPedId(), PlayerPedId(), 255, 1)
Citizen.Wait(10000) 
StopPlayerSwitch()
end)```
2 Likes