Flying Cam [GTA: Online Camera in Clouds]

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

Me too, Added switchout in spawnmanager and switchin in skinchanger. But I’m looking to start the carmera in the sky and not un-zooming when the player spawned like I did.

1 Like

Are you guys looking for something like this?

(in case the embedded video doesn’t work, here’s the original link: Watch Desktop 2018.10.13 - 14.00.40.05 | Streamable)

This is not fair man :wink:
I tried to switch out:

  • in spawnmanager on the event NetworkIsPlayerActive
  • in essentialmode on the event NetworkIsSessionStarted()
  • on the event onClientMapStart
    I’m note able to get this effect.
    Even hardcap wasn’t able to give me all the satisfaction I could get by placing correctly two simple commands…

So, you’re looking for what i showed in that video? I’ll release a customizable version of it soon.

3 Likes

Yes! That it. Thank you so much Vespura. I really want to see the implementation and at the same time understand the whole principle of operation.

here it is.

I hate mecro-ing 2 year old posts, but I saw this, and I’ve seen cool twisty drifty camera movements to focus on the player on a few different servers, but this is the closest thing I’ve found to figuring out how they did it. Any ideas? I think one of the servers that uses my description is known as LostRP (I have no affiliation and am not promoting them by any means, but it’s the only way I can describe what I’m trying to achieve.)

can you maybe explain how it works with multichar?