Jump to content

Isn't This right?!?!


hihohihohiho

Recommended Posts

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

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
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
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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...