UPDATED: 3rd August 2013
This is just a quick little script I whipped up which adds a couple of new features to the map extensions script that comes with PySnip/PySpades, since I'd noticed a few people asking how to do them. I am aware that there are other ways of achieving the features I've added, but they're now located in one handy script.
The features it adds are;
- Custom spawns
- Block Protection
- 'No Build' Protection
- 'No Destroy' Protection
For the protection zones, admins can still bypass the protection by entering God mode and building/destroying in the protected zone.
To use these features, add the following commands to your map.txt file (as applicable)
'blue_spawn': [(x, y, (z))] - z value is optional, will spawn at the map's ground height if not included
'blue_spawn_offset': (value) - Max offset in any direction from the location provided above. Optional, if not included, defaults to 50.
'green_spawn': same as blue_spawn
'green_spawn_offset': same as blue_spawn_offset
'protected': [ [ (x, y, z), (x, y, z) ] ] - NOTE: 2 square brackets must be used before the very first set of co-ordinates and after the very last set. First set of co-ordinates are one corner of the protection box, the second set are the opposite corner
'nobuild':[ [(x, y, z), (x, y, z)] ] - Same as above - forbids building only
'nodestroy':[ [(x, y, z), (x, y, z)] ] - Same as above - forbids destroying blocks only
Here's an example of a map.txt;
Code: Select all
Now I've only done the slightest of testing to confirm it works on localhost. I can't imagine there being anything in there to crash your game, but if there is, let me know and I'll get on it ASAP. Also, if there's any other feature you'd like to see added, let me know and I'll see what I can do!extensions = {
'blue_spawn': [(0, 0)], #Spawns blues at 0, 0
'blue_spawn_offset': 10, #Blues can spawn a maximum of 10 blocks from 0, 0
'green_spawn':[(512, 0), (512, 512, 20)] #Greens have two spawns which they can randomly spawn at. Second one will force players to spawn at height 20
#No green_spawn_offset. The script will default to 50 blocks in all directions.
'protected': [ [(0, 0, 0), (10, 10, 63)], [(10, 20, 0), (0, 10, 63)] ] #This contains two protected areas; One goes from (0, 0, 0) to (10, 10, 63), and the second one goes from (10, 20, 0) to (0, 10, 63).
#Note that the values in the second bracket can be lower than the first bracket
'nobuild': [ [250, 250, 0], [260, 260, 63] ]
'nodestroy': [ [280, 250, 0], [220, 250, 0] ]
}Other than that, have fun.
UPDATE: Fixed bug Lostmotel pointed out, added new feature requested.

