03-29-2014, 08:25 AM
Random Chitchat 2012-2016
|
03-29-2014, 06:53 PM
While working on my Paintball plugin I noticed I can't teleport players in the OnPlayerDestroyed hook. I looked in the code and saw that the player first gets removed from the world and then gets destroyed. Is it bad if we change that? First call the destroy function and then remove the player from the world.
03-29-2014, 07:55 PM
Why can't you teleport? Does it cause a crash or it doesn't simply work or ... ?
I can't think of any specific reasons why swapping the two wouldn't work, try it out and see if there are any immediate problems. I think when you change the code you'll be able to identify potential issues.
The player just doesn't teleport. I'll try swapping them and see if it will cause any problems... and if it fixes my problem.
Nope it doesn't fix my problem.
03-30-2014, 07:47 AM
I'm wondering, why do you want to teleport a player who has left the server anyway?
03-30-2014, 07:50 AM
When a player leaves while he joined a paintball arena and then relogs he will login in the arena and not in the lobby of the arena. He then is able to affect the match by breaking and placing blocks.
How about approaching it from the other side - when a player joins and they're in the arena, teleport them to the lobby. It sounds more logical to me, and even will work when the admin reorganizes the world and moves the arenas elsewhere, for players that have disconnected in the new arena space.
Commit ceabb372f083c9f45ab1c05154c780c5092961ec has all the approved prefabs from the Gallery server. It generates nether forts like this: Two things still need to be done: make the prefabs draw their foundations down towards the ground, until the nearest solid block (so that the fort isn't floating) and tweak the probabiilties and sequences of prefabs so that the generator generates longer bridges, less crossings, only a few balconies etc. One thing could be useful, too: add explicit hitboxes to the prefabs, so that a prefab may specify a hitbox different than its image. This should be used by all the "corridor" pieces to avoid corridors-above-bridges.
03-30-2014, 07:04 PM
(03-30-2014, 09:38 AM)xoft Wrote: How about approaching it from the other side - when a player joins and they're in the arena, teleport them to the lobby. It sounds more logical to me, and even will work when the admin reorganizes the world and moves the arenas elsewhere, for players that have disconnected in the new arena space. Well that isn't going to work either because the plugin doesn't know the size of an arena. It's just a spawn for the lobby and multiple spawns for the red, blue and spectator teams.
03-30-2014, 07:15 PM
So how does the plugin know at player's death that they are in an arena?
03-30-2014, 07:21 PM
Each player has a playerstate. In there there is some info about in wich arena the player is and wich arena the player has selected.
|
« Next Oldest | Next Newest »
|
Users browsing this thread: 7 Guest(s)