Adjust item drop

This commit is contained in:
VegaZ
2018-12-24 15:18:22 +01:00
parent 202311ea40
commit 76c11152f2
2 changed files with 15 additions and 1 deletions

View File

@@ -66,5 +66,17 @@ namespace reallife_gamemode.Server.Extensions
{
return player.HasData("isLoggedIn") ? player.GetData("isLoggedIn") : false;
}
public static Vector3 GetPositionFromPlayer(Client player, float distance, int offset = 0)
{
var pos = player.Position;
var a = player.Heading + offset;
var rad = a * Math.PI / 180;
var newpos = new Vector3(pos.X + (distance * Math.Sin(-rad)),
pos.Y + (distance * Math.Cos(-rad)),
pos.Z);
return newpos;
}
}
}