SHOW:
|
|
- or go back to the newest paste.
| 1 | - | """ |
| 1 | + | # Free for all script written by Yourself |
| 2 | - | This removes Rascism and Religous statements |
| 2 | + | # With scripts from: Jail.py and arena.py |
| 3 | # And btw I doubt this works; Ninja Pig | |
| 4 | - | BASE BY : Influx |
| 4 | + | |
| 5 | - | Very minor edits by Ninja Pig |
| 5 | + | |
| 6 | from random import randint | |
| 7 | - | """ |
| 7 | + | from pyspades.common import to_coordinates, coordinates |
| 8 | - | import string |
| 8 | + | from commands import add, admin, get_player, join_arguments, name, alias |
| 9 | - | |
| 9 | + | from pyspades.constants import * |
| 10 | ||
| 11 | - | |
| 11 | + | jail_location = 0, 0, 0 # x, y, z of the spectator room |
| 12 | - | class abrvConnection(connection): |
| 12 | + | jail_coords = [ ] # e.g. ["B4", "B5"] |
| 13 | - | global abrvdict |
| 13 | + | |
| 14 | # If ALWAYS_ENABLED is False, free for all can still be enabled in the map | |
| 15 | - | abrvdict = {
|
| 15 | + | # metadata by setting the key 'free_for_all' to True in the extensions dictionary |
| 16 | - | 'nigger', |
| 16 | + | ALWAYS_ENABLED = True |
| 17 | - | 'chink', |
| 17 | + | |
| 18 | - | 'ching chong', |
| 18 | + | # If WATER_SPANS is True, then players can spawn in water |
| 19 | - | 'jew', |
| 19 | + | WATER_SPAWNS = False |
| 20 | - | '10% off', |
| 20 | + | |
| 21 | - | '51st Stater', |
| 21 | + | HIDE_POS = (0, 0, 63) |
| 22 | - | '7-11', |
| 22 | + | |
| 23 | - | 'abba-dabba', |
| 23 | + | |
| 24 | - | 'natzi', |
| 24 | + | class FreeForAllProtocol(protocol): |
| 25 | - | 'slave', |
| 25 | + | free_for_all = False |
| 26 | - | 'africant', |
| 26 | + | old_friendly_fire = None |
| 27 | - | 'slave', |
| 27 | + | def on_map_change(self, map): |
| 28 | - | 'africoon', |
| 28 | + | extensions = self.map_info.extensions |
| 29 | - | 'amerikkklan', |
| 29 | + | if ALWAYS_ENABLED: |
| 30 | - | 'kluxer', |
| 30 | + | self.free_for_all = True |
| 31 | - | 'japanigger', |
| 31 | + | else: |
| 32 | - | 'jew jew bee', |
| 32 | + | if extensions.has_key('free_for_all'):
|
| 33 | - | 'jew killer', |
| 33 | + | self.free_for_all = extensions['free_for_all'] |
| 34 | - | 'beiber', |
| 34 | + | else: |
| 35 | - | 'swag', |
| 35 | + | self.free_for_all = False |
| 36 | - | 'yolo', |
| 36 | + | if self.free_for_all: |
| 37 | - | '666', |
| 37 | + | self.old_friendly_fire = self.friendly_fire |
| 38 | - | 'satan', |
| 38 | + | self.friendly_fire = True |
| 39 | - | 'jesus', |
| 39 | + | else: |
| 40 | - | 'god', |
| 40 | + | if self.old_friendly_fire is not None: |
| 41 | - | 'noah ark', |
| 41 | + | self.friendly_fire = self.old_friendly_fire |
| 42 | - | 'ching' |
| 42 | + | self.old_friendly_fire = None |
| 43 | - | 'chong' |
| 43 | + | return protocol.on_map_change(self, map) |
| 44 | - | 'bible' |
| 44 | + | |
| 45 | - | 'terrorist' |
| 45 | + | def on_base_spawn(self, x, y, z, base, entity_id): |
| 46 | - | 'terrorism' |
| 46 | + | if self.free_for_all: |
| 47 | return HIDE_POS | |
| 48 | - | } |
| 48 | + | return protocol.on_base_spawn(self, x, y, z, base, entity_id) |
| 49 | - | |
| 49 | + | |
| 50 | - | def on_chat(self, value, global_message): |
| 50 | + | def on_flag_spawn(self, x, y, z, flag, entity_id): |
| 51 | - | message = string.lower(value) |
| 51 | + | if self.free_for_all: |
| 52 | - | for punc in string.punctuation: |
| 52 | + | return HIDE_POS |
| 53 | - | message = message.replace(punc,"") |
| 53 | + | return protocol.on_flag_spawn(self, x, y, z, flag, entity_id) |
| 54 | - | if any(rascist in message for rascist in germandict): |
| 54 | + | |
| 55 | - | self.send_chat('%s is a rascist bitch.')
|
| 55 | + | class FreeForAllConnection(connection): |
| 56 | score_hack = False | |
| 57 | - | return connection.on_chat(self, value, global_message) |
| 57 | + | def on_spawn_location(self, pos): |
| 58 | - | |
| 58 | + | if not self.score_hack and self.protocol.free_for_all: |
| 59 | - | return protocol, noabrvConnection |
| 59 | + | while True: |
| 60 | x = randint(0, 511) | |
| 61 | y = randint(0, 511) | |
| 62 | z = self.protocol.map.get_z(x, y) | |
| 63 | if z != 63 or WATER_SPAWNS: | |
| 64 | break | |
| 65 | # Magic numbers taken from server.py spawn function | |
| 66 | z -= 2.4 | |
| 67 | x += 0.5 | |
| 68 | y += 0.5 | |
| 69 | return (x, y, z) | |
| 70 | return connection.on_spawn_location(self, pos) | |
| 71 | ||
| 72 | def on_refill(self): | |
| 73 | if self.protocol.free_for_all: | |
| 74 | return False | |
| 75 | return connection.on_refill(self) | |
| 76 | ||
| 77 | def on_flag_take(self): | |
| 78 | if self.protocol.free_for_all: | |
| 79 | return False | |
| 80 | return connection.on_flag_take(self) | |
| 81 | ||
| 82 | def on_kill(self, by, type, grenade): | |
| 83 | # Switch teams to add score hack | |
| 84 | if by is not None and by.team is self.team and self is not by: | |
| 85 | self.score_hack = True | |
| 86 | pos = self.world_object.position | |
| 87 | self.set_team(self.team.other) | |
| 88 | self.spawn((pos.x, pos.y, pos.z)) | |
| 89 | self.score_hack = False | |
| 90 | return connection.on_kill(self, by, type, grenade) | |
| 91 | ||
| 92 | def on_spawn(self, pos): | |
| 93 | returned = connection.on_spawn(self, pos) | |
| 94 | protocol = connection.protocol # Meh | |
| 95 | player = get_player(protocol, value) # Get player | |
| 96 | ||
| 97 | ||
| 98 | return FreeForAllProtocol, FreeForAllConnection |