Search the Community
Showing results for tags 'spawnplayer'.
-
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?
-
Buenas, Estoy teniendo un error al momento de usar spawnPlayer, En el argumento uno no logro hacer que reconozca al jugador para spawnear. function deathspawn () fadeCamera ( getRootElement(), false, 2 ) setTimer( function() fadeCamera ( getRootElement(), true, 2 ) setCameraMatrix ( getRootElement(), 0, 0, 33, 100, 100, 3 ) spawnPlayer ( source, math.random (0,100), math.random (0,100), 10 ) -- Aqui esta el problema, no funciona con source, player o getrootelement end, 4000, 1) end addEventHandler ("onPlayerWasted", getRootElement(), deathspawn) Estaría muy agradecido de que me ayuden a encontrar el error, aun soy bastante novato.