Created
August 23, 2012 21:41
-
-
Save anonymous/3442243 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pyspades.constants import * | |
def apply_script(protocol, connection, config): | |
class EverythingSucksConnection(connection): | |
def on_weapon_set(self, wpnid): | |
if wpnid == RIFLE_WEAPON or wpnid == SMG_WEAPON: | |
self.send_chat("This weapon is forbidden on this server because it sucks.") | |
return False | |
return connection.on_weapon_set(self, wpnid) | |
def set_weapon(self, weapon, local = False, no_kill = False, *args, **kwargs): | |
if weapon == RIFLE_WEAPON or weapon == SMG_WEAPON: | |
self.send_chat("This weapon is forbidden on this server because it sucks.") | |
self.send_chat("You've been given a real man's gun.") | |
weapon = SHOTGUN_WEAPON | |
if local: | |
no_kill = True | |
local = False | |
return connection.set_weapon(self, weapon, local, no_kill, *args, **kwargs) | |
return protocol, EverythingSucksConnection |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment