Plugin: LocationSnapshot
Here’s an example of using a DataAccess (in this case, AllPlayerLocations) in a new plugin, LocationSnapshot. For this plugin, we’ll provide two new commands:
-
/savelocations
-
/loadlocations
You might want to use this kind of feature as part of a competition, where you can return all players back to their starting points at the end.
The savelocations command, as you’d expect, saves the current locations of all online players to disk. loadlocations reads them back in and teleports everyone back to those saved locations. We’ll use Canary’s Database functions with our AllPlayerLocations DataAccess object to save and load a hash of Players and Locations.
There are two main pieces to this plugin: saveLocations and ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access