.:HyPeX:. Posted March 16, 2014 Posted March 16, 2014 Well, i can only make this work correctly if i restart the resource while im online and do /Lobby , if i reconnect i get buged up (also the F1 bind isnt working). Lobby = createTeam("#006677 - Lobby | Welcome - ") Missions = createTeam("#006677Missions | Co-Op") function SpawnPlayerToLobby(player,cmd) if source then bindKey(source, "F1", "down", "Lobby") fadeCamera(source, true) setPlayerTeam(source, Lobby) spawnPlayer(source, 493.45208740234, -23.21369934082, 1000, 0, 0, 17, 0) end if isElement(player) and getElementType(player) == "player" then spawnPlayer(player, 493.45208740234, -22.21369934082, 1000, 0, 0, 17, 0) setPlayerTeam(player, Lobby) fadeCamera(player, true) end end addEventHandler("onPlayerLogin", getRootElement(), SpawnPlayerToLobby) addCommandHandler("Lobby", SpawnPlayerToLobby)
DNL291 Posted March 16, 2014 Posted March 16, 2014 Try this: local Lobby = createTeam("#006677 - Lobby | Welcome - ") local Missions = createTeam("#006677Missions | Co-Op") function SpawnPlayerToLobby(player,cmd) if source then bindKey(source, "F1", "down", "Lobby") fadeCamera(source, true) setPlayerTeam(source, Lobby) spawnPlayer(source, 493.45208740234, -23.21369934082, 1000, 0, 0, 17, 0) end if isElement(player) and getElementType(player) == "player" then spawnPlayer(player, 493.45208740234, -22.21369934082, 1000, 0, 0, 17, 0) setPlayerTeam(player, Lobby) fadeCamera(player, true) end end addEventHandler("onPlayerLogin", getRootElement(), SpawnPlayerToLobby) addCommandHandler("Lobby", SpawnPlayerToLobby) addEventHandler( "onPlayerJoin", root, function () addEventHandler("onPlayerLogin", source, SpawnPlayerToLobby) addCommandHandler("Lobby", SpawnPlayerToLobby) end )
.:HyPeX:. Posted March 16, 2014 Author Posted March 16, 2014 How would that help? i'm being spawned but i cant see the bar (interior) and i see all objects "together" (The 2 peds on the bar are joined together infront of me, and i can see it becouse of their dxDrawText on their heads, but only the text, else just air) EDIT: Pic:
Castillo Posted March 16, 2014 Posted March 16, 2014 How would that help him? he wants the player to be in that interior.
manawydan Posted March 16, 2014 Posted March 16, 2014 oh sorry. you can try use setElementInterior, or setElementDimension, if this interiors is in another dimension.
.:HyPeX:. Posted March 19, 2014 Author Posted March 19, 2014 Well after some days of trying came to a question: Why does it work if im online and i restart the script (I'm starting the script via console and then logging in, and it works perfectly), but it doesnt if it is on and i come online (Without starting it with me online)?
.:HyPeX:. Posted March 19, 2014 Author Posted March 19, 2014 Quick bump and update: reading arround found out setCameraTarget was needed Now it works, thanks for the help anyway.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now