[SCRIPT] map_roof

Intended for use on live public servers.
1 post Page 1 of 1
Kuma
Scripter
Scripter
Posts: 758
Joined: Fri Mar 22, 2013 10:05 am


This script was made to prevent people from flying over the limit of z. Doing this may crash the client(Ace of spades). You can add the max height people can fly to in config. By default the value is -4 (4 blocks more than the limit) Add it like this
Code: Select all
"map_roof" : -4 (Change -4 with some other number, for eg -5)
The code itself
Code: Select all
#Map_roof by Kuma

from pyspades.server import position_data

def apply_script(protocol, connection, config):

  class roofConnection(connection):
    def on_position_update(self):
      protocol = self.protocol
      obj = self.world_object
      position = obj.position
      x, y, z = position.x, position.y, position.z
      if z <= protocol.ROOF:
        obj.set_position(x, y, protocol.ROOF)
        position_data.x = x
        position_data.y = y
        position_data.z = protocol.ROOF
        self.send_contained(position_data)
        return connection.on_position_update(self)

  class roofProtocol(protocol):
    ROOF = config.get('map_roof', -4.0) #I recommed less than -4.0

  return roofProtocol, roofConnection
Attachments
map_roof.py
(751 Bytes) Downloaded 37 times
1 post Page 1 of 1
Return to “Completed Releases”

Who is online

Users browsing this forum: No registered users and 1 guest