Skip to content

Instantly share code, notes, and snippets.

@MrBluePotato
Created January 10, 2014 03:46
Show Gist options
  • Save MrBluePotato/8346685 to your computer and use it in GitHub Desktop.
Save MrBluePotato/8346685 to your computer and use it in GitHub Desktop.
// Checks if the seeker tagged a player, after they broke the block form
public static void PlayerMoved(object sender, fCraft.Events.PlayerMovingEventArgs e)
{
if (e.Player.isPropHuntSeeker)
{
Vector3I oldPos = new Vector3I(e.OldPosition.X / 32, e.OldPosition.Y / 32, e.OldPosition.Z / 32); // Get the position of the player
Vector3I newPos = new Vector3I(e.NewPosition.X / 32, e.NewPosition.Y / 32, e.NewPosition.Z / 32);
if (oldPos.X != newPos.X || oldPos.Y != newPos.Y || oldPos.Z != newPos.Z) // Check if the positions are not the same (player moved)
{
foreach (Player p in _world.Players)
{
Vector3I pos = p.Position.ToBlockCoords(); // Converts to block coords
if (!p.isPropHuntSeeker)
{
makeSeeker(p);
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment