.: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) My ingame nick is ~HyPeX~ BF3 Gamemode Progress: ~30% - Currently working on AI & MapManager
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 ) Please do not PM me with scripting related question nor support, use the forums instead.
.: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: My ingame nick is ~HyPeX~ BF3 Gamemode Progress: ~30% - Currently working on AI & MapManager
Castillo Posted March 16, 2014 Posted March 16, 2014 And, are you sure the problem is in that code? San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
manawydan Posted March 16, 2014 Posted March 16, 2014 interior 17 try change to 0 "Querer não é poder, mas tentar é avançar"!
Castillo Posted March 16, 2014 Posted March 16, 2014 How would that help him? he wants the player to be in that interior. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
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. "Querer não é poder, mas tentar é avançar"!
.: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)? My ingame nick is ~HyPeX~ BF3 Gamemode Progress: ~30% - Currently working on AI & MapManager
.: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. My ingame nick is ~HyPeX~ BF3 Gamemode Progress: ~30% - Currently working on AI & MapManager
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