rikimaru263 Posted March 23, 2010 Posted March 23, 2010 How do i set multiple spawn points for my server. And also is there a program that i can use to find the x y z location.
Xierra Posted March 24, 2010 Posted March 24, 2010 I've been asking the same question and it's solved. here's the code: function spawn(player) local spawns = { { -2030.1610107422, 172.25221252441, 28.8359375, 270.0 }, { -1951.3865966797, 703.58880615234, 46.5625 }, { -1942.5206298828, 486.96841430664, 31.96875 }, { -2648.3989257813, -28.41300201416, 6.1328125, 179.42449951172 }, { -2500.03515625, 127.93914794922, 24.475505828857, 88.557006835938 }, {x,y,z,rotZ} -- You can still add more spawns here. to get your current position ingame, just write /gp and copy it in console. } function spawn( player ) local rnd = math.random( 1, #spawns ) spawnPlayer( player, spawns[rnd][1], spawns[rnd][2], spawns[rnd][3], spawns[rnd][4] ) -- [1] is X, [2] is Y, [3] is Z, and [4] is rotZ. end -- You will spawn randomly from the coordinates up there everytime you start that resource. end addEventHandler("onPlayerJoin", root, function() spawn(source) end ) addEventHandler("onPlayerWasted", root, function() setTimer(spawn, 3000, 1, source) -- You can set when you will spawn again in miliseconds. end ) Good luck!
karlis Posted March 24, 2010 Posted March 24, 2010 add this after spawnplayer: fadeCamera(source, true) setCameraTarget(source, source) and specify root=getRootElement() and delete 1st line,and end at 16 line what will cause error
eAi Posted March 24, 2010 Posted March 24, 2010 Once again, please store your locations in map files. That's what they're for!
Xierra Posted March 25, 2010 Posted March 25, 2010 Thanks eAi, but how can I do that? can you give me an example? sorry
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