#SMG WARZ Game Mode
#by BOYuXRAY
#version 2
#inspired by Kuma`s script
#Fixed a silly mistake and fixed by Kuma
 
from pyspades.constants import *
 
SMG_ONLY = "You cannot kill with Rifle or Shotgun. Use the SMG!"
 
def apply_script(protocol, connection, config):
 
    class SMGwarConnection(connection):
        def spawn(self):
            self.weapon = SMG_WEAPON
            return connection.spawn(self)
 
        def on_weapon_set(self, weapon):
            if weapon in [RIFLE_WEAPON, SHOTGUN_WEAPON]:
                self.send_chat(SMG_ONLY)
                self.set_weapon(SMG_WEAPON)
            return False
 
    class SMGwarProtocol(protocol):
        game_mode = CTF_MODE

    return SMGwarProtocol, SMGwarConnection
