Created
January 10, 2014 03:46
-
-
Save MrBluePotato/8346685 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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