hihohihohiho Posted February 6, 2008 Share Posted February 6, 2008 function spawnThePlayer ( player ) local b = spawnPlayer ( player, -711+randInt(1,5), 957+randInt(5,9), 12.4, 90, randInt(9,288) ) local b = spawnPlayer ( player, -359.26382446289+randInt(1,5), 1094.6861572266+randInt(5,9), 12.4, 90, randInt(9,288) ) if not b then spawnThePlayer ( player ) return end fadeCamera(player,true) end i use this and i go in my server and it only goes to the second one, then i killed my self to see if it swichs off but it only goes the the second one, but i want them to swich off every time u die so.... whats wrong?!?!? Link to comment
mabako Posted February 7, 2008 Share Posted February 7, 2008 you would need to have to make it a random selection. right now, both spawnplayers are executed and the later one is the only one really important, as it overwrites the before info. You should maybe do it like the following: local spawnSet = randInt( 1, 2 ) if( spawnSet == 1 ) then spawnPlayer ( player, -711+randInt(1,5), 957+randInt(5,9), 12.4, 90, randInt(9,288) ) else ... end , or with more spawnsets: local spawnPositions = { { posX=-711, posY=957, posZ=12.4, rotation=90 }, { posX=-359, posY=1094.6, posZ=12.4, rotation=90 } } function spawnThePlayer ( player ) local spawnset = randInt( 1, #spawnPositions ) spawnPlayer ( player, spawnPositions[spawnset].posX+randInt(1,5), spawnPositions[spawnset].posY+randInt(5,9), spawnPositions[spawnset].posZ, spawnPositions[spawnset].rotation, randInt(9,288) ) end Link to comment
hihohihohiho Posted February 7, 2008 Author Share Posted February 7, 2008 So the second one you put would be for 1 here and 1 here so it swichs off every time you die right? because i just tried that second one and all it had was a black screen.... and since i have admin i can seee that x y and z i killed myself and i was still at the -711 Link to comment
norby89 Posted February 7, 2008 Share Posted February 7, 2008 because i just tried that second one and all it had was a black screen.... and since i have admin i can seee that x y and z don't forget the fadeCamera ( player, true ) on start Link to comment
50p Posted February 7, 2008 Share Posted February 7, 2008 because i just tried that second one and all it had was a black screen.... and since i have admin i can seee that x y and z And don't forget that random value can be the same even 100 times one after another, since there are only 2 values that randInt can choose from, so be patient and try killing yourself more times. Link to comment
hihohihohiho Posted February 7, 2008 Author Share Posted February 7, 2008 where do i put "fadeCamera ( player, true )" Link to comment
50p Posted February 8, 2008 Share Posted February 8, 2008 where do i put "fadeCamera ( player, true )" There where you spawnPlayer, so you spawn player and show him the "world". Link to comment
50p Posted February 8, 2008 Share Posted February 8, 2008 huh? Jeeeez function spawnThePlayer ( player ) local spawnset = randInt( 1, #spawnPositions ) spawnPlayer ( player, spawnPositions[spawnset].posX+randInt(1,5), spawnPositions[spawnset].posY+randInt(5,9), spawnPositions[spawnset].posZ, spawnPositions[spawnset].rotation, randInt(9,288) ) fadeCamera( player, true ) end Link to comment
hihohihohiho Posted February 8, 2008 Author Share Posted February 8, 2008 oh ok i'll try that ------------------------------------------------------------- k cool thanks it works Link to comment
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