Skip to content

Instantly share code, notes, and snippets.

@iamgreaser
Created July 17, 2012 09:00
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 iamgreaser/3128198 to your computer and use it in GitHub Desktop.
Save iamgreaser/3128198 to your computer and use it in GitHub Desktop.
smgsucks.py - disable SMG on a pyspades server
"""
Disables the SMG
Author: GreaseMonkey
Thanks to:
- LinktersHD for fixing a bug where the SMG flame message goes to EVERYONE,
and not just the culprit
Public Domain
"""
from pyspades.constants import *
def apply_script(protocol, connection, config):
class SMGSucksConnection(connection):
def on_weapon_set(self, wpnid):
if wpnid == SMG_WEAPON:
self.send_chat("SMG 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 == SMG_WEAPON:
self.send_chat("You've been given a real gun (Rifle)")
self.send_chat("SMG forbidden on this server because it sucks")
weapon = RIFLE_WEAPON
if local:
no_kill = True
local = False
return connection.set_weapon(self, weapon, local, no_kill, *args, **kwargs)
return protocol, SMGSucksConnection
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment