Search the Community
Showing results for tags 'plusplus'.
-
I'm daring myself to add more little things to the tutorials shown here. It's of great pleasure to announce that the following code works. I know it is not much, but it's one more step closer to my dream server. So, function joinHandler() spawnPlayer(source, 2023, 1008, 10.83, -90, math.random (1,288)) fadeCamera(source, true) setCameraTarget(source, source) outputChatBox("¡Bienvenido!", source) end addEventHandler("onPlayerJoin", getRootElement(), joinHandler) You can skip the spanish words. The result is as expected: when the player joins, the chatbox shows the text, the player is looking at the east, and the skin is randomized between 1 and 288. However, the camera is aiming at its default value: 0. The result has a rather inconvenient detail: the camera is looking at the right side of the character's body. UPDATE: I added setPedCameraRotation. There are no errors being detected, but the camera is not changing at all. function joinHandler() spawnPlayer(source, 2023, 1008, 10.83, -90, math.random (1,288)) fadeCamera(source, true) setCameraTarget(source, source) setPedCameraRotation(source, 90) outputChatBox("¡Bienvenido!", source) end addEventHandler("onPlayerJoin", getRootElement(), joinHandler) How can I modify where the camera is looking at when a player joins, so that way it looks at the same place the character is looking?