Solved SurvivalGames Type Spawn Points

Discussion in 'Plugin Development' started by Regablith, Apr 22, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    Regablith

    Hello! I am in need of assistance with the spawn point system that survival games uses where each player gets their own podium. I've been trying to think in my head how to work this but I can't seem to solve it.
     
  2. Offline

    IdiotBoxGuyMC

    Regablith

    I'm on a tab, so I can't provide code.

    But to brief you...
    store locations in config files like so, sg.spawn.1.X , sg.spawn.1.Y , sg.spawn.1.Z .
    Replace 1 with 2, 3, 4... as you make more spawns.
    Do a random search between the amount of spawns you have. (Eg. If u have 5 spawns, make a search between 1 and 5)
    Assign the number a name, like randomNumber = random.nextInt () .
    Finally, when the player joins, do the random search and get his spawn point from he config files like so...
    Sg.spawn. + randomNumber + X
    Since the random number is different everytime, you will get a random spawn point for each player.

    You might wanna check if it has given a spawn already, and if so, don't use that number. We don't want 2 people at 1 spawn lol.

    Hope I helped, thag me if you want any further assistance. Mark it as solved if you understood. :)
     
  3. Offline

    Regablith

    Ill mess around with it. Thanks for the answer!

    Worked, Thanks! IdiotBoxGuyMC

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 7, 2016
  4. Offline

    IdiotBoxGuyMC

    Regablith
    No problem! I'm happy I could give back to the community, in the same way they helped me. :)
     
Thread Status:
Not open for further replies.

Share This Page