Skip to content

Instantly share code, notes, and snippets.

Created August 23, 2012 21:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/3442243 to your computer and use it in GitHub Desktop.
Save anonymous/3442243 to your computer and use it in GitHub Desktop.
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