Discussion in 'Plugin Development' started by legostarwarszach, Jun 8, 2013.
How would I make it where players cannot leave a certian region defined in a config?
I would do something like this:
1. Two location coordinates (X,Y,Z) would be defined somewhere, showing two (diagonally opposite?) vertices of a rectangle
2. Using the PlayerMove event, get their moveTo location from the event.
3. Separate the two config locations into a min and max value for each axis. Min X, Max X, etc.
4. Check each axis of the moveTo location to check if it's >= the min and =< the max.
5. if it fails the check, cancel the event.
Separate names with a comma.