Moved Teleport to TSPlayer and added Spawn

Warn player teleport is not possible if custom spawn point is set.
/home now take you to spawnpoint (custom if set else main spawn point)
This commit is contained in:
ricky 2011-06-21 13:47:31 +10:00
parent 2d9ccb3738
commit aa9d627f69
3 changed files with 42 additions and 31 deletions

View file

@ -417,27 +417,6 @@ namespace TShockAPI
* Useful stuff:
* */
public static void Teleport(int ply, int x, int y)
{
int oldSpawnX = Main.spawnTileX;
int oldSpawnY = Main.spawnTileY;
Main.spawnTileX = x/16;
Main.spawnTileY = y/16;
//Send only that player the new spawn point data
NetMessage.SendData(7, ply, -1, "", 0, 0f, 0f, 0f);
//Force them to respawn
NetMessage.SendData(12, ply, -1, "", ply, 0.0f, 0.0f, 0.0f);
//Reset to old spawnpoint and send spawn data back to player
Main.spawnTileX = (int)oldSpawnX;
Main.spawnTileY = (int)oldSpawnY;
NetMessage.SendData(7, ply, -1, "", 0, 0f, 0f, 0f);
}
public static void Teleport(int ply, float x, float y)
{
Teleport(ply, (int)x, (int)y);
}
public static void StartInvasion()
{
Main.invasionType = 1;