Donate to the B3 fund!

"even a small donation helps!"
Donate with PayPal!
The creator of these plugins has not shown activity in a while. Posting in this board may not result in a fast reply or a reply at all. [ Read the full Support Disclaimer here ]
Most of the plugins here are made by B3 users and the authors may not visit frequently. If you need support for plugins or if questions remain unanswered, you will have to contact the author directly. Read the full Support Disclaimer here

NOTE: Do not attach plugins to your forumtopics! Attachements are periodically removed by maintenance tasks. Upload your plugins to our Downloads section instead!

Author Topic: Weapon Control Plugin - Antinoob v1.0.7  (Read 171490 times)

Offline Bakes

  • B3 Contrib/Support
  • Hero Member
  • *
  • Posts: 1226
Re: Weapon Control Plugin - Antinoob v1.0.3
« Reply #15 on: January 25, 2009, 11:20:56 PM »
hmm, isn't b3 meant to ban based on warninglength/30?

Offline Anubis

  • Moderator
  • Sr. Member
  • *
  • Posts: 228
    • g4g.pl
Re: Weapon Control Plugin - Antinoob v1.0.3
« Reply #16 on: January 25, 2009, 11:30:30 PM »
Nope... warrning length means that when warning will expire. It's not a ban duration. Just look at the echelon to see the timings.

Offline FatBastard

  • Jr. Member
  • **
  • Posts: 30
Re: Weapon Control Plugin - Antinoob v1.0.3
« Reply #17 on: January 26, 2009, 02:30:57 AM »
The more I post questions here, the more I see the name of the plugin referring to me. LOL

Thanks for the help!

Offline intrebulon

  • Full Member
  • ***
  • Posts: 84
    • Knight Of Fury Clan
Re: Weapon Control Plugin - Antinoob v1.0.3
« Reply #18 on: January 26, 2009, 03:30:26 PM »
it is however set to tempban for too many warnings for a duration = to warninglength/divider.

Offline Bakes

  • B3 Contrib/Support
  • Hero Member
  • *
  • Posts: 1226
Re: Weapon Control Plugin - Antinoob v1.0.3
« Reply #19 on: January 26, 2009, 07:09:04 PM »
Nope... warrning length means that when warning will expire. It's not a ban duration. Just look at the echelon to see the timings.

i got that from here, in the botmanual:
http://www.bigbrotherbot.com/trac/wiki/BotManual/Warnings

so ha!

Offline Anubis

  • Moderator
  • Sr. Member
  • *
  • Posts: 228
    • g4g.pl
Re: Weapon Control Plugin - Antinoob v1.0.3
« Reply #20 on: January 26, 2009, 11:02:46 PM »
ha! you got me!

anyway, thanks for notice.

Offline FatBastard

  • Jr. Member
  • **
  • Posts: 30
Re: Weapon Control Plugin - Antinoob v1.0.3
« Reply #21 on: January 28, 2009, 09:26:46 PM »
Anyone notice issues with the knife?

It's not so bad because so far the only occurrences are when someone knives while possessing a banned weapon. When knifing, while possessing an acceptable weapon, there is no kick/warn.

Offline Bakes

  • B3 Contrib/Support
  • Hero Member
  • *
  • Posts: 1226
Re: Weapon Control Plugin - Antinoob v1.0.3
« Reply #22 on: January 28, 2009, 09:37:10 PM »
until anubis factors in weapon replacements, like xlrstats, then yes, there will be problems with the knives. Sorry!

It happens in one of the communities I play on, has done for the last 10 months.

Offline Anubis

  • Moderator
  • Sr. Member
  • *
  • Posts: 228
    • g4g.pl
Re: Weapon Control Plugin - Antinoob v1.0.3
« Reply #23 on: January 28, 2009, 10:22:49 PM »
Hmmm.. I think I need to add some "MOD" settings.... I'll think about that.

Offline FatBastard

  • Jr. Member
  • **
  • Posts: 30
Re: Weapon Control Plugin - Antinoob v1.0.3
« Reply #24 on: January 29, 2009, 01:54:17 AM »
So the same thing goes for when someone is using a legal rifle but uses an illegal pistol.

This is all very odd. Sometimes it works for certain weapons and other weapons it will not.

Sure my list is very long, I'm running a sniper only server. Basically everything is illegal except for sniper class weapons, pistols, grenades, and C4.

Anubis,

If you need any help at all, let me know. I'll do anything to get this to work.

FB

Offline Lolzumad

  • Full Member
  • ***
  • Posts: 50
Re: Weapon Control Plugin - Antinoob v1.0.3
« Reply #25 on: January 31, 2009, 09:35:17 PM »
Is there a way to set up this plugin so that it kicks people who use our list of banned weapons (all noob tubes and marty) on the first offense?  Then maybe have it temp ban after a set number of kicks?

Offline Bakes

  • B3 Contrib/Support
  • Hero Member
  • *
  • Posts: 1226
Re: Weapon Control Plugin - Antinoob v1.0.3
« Reply #26 on: January 31, 2009, 10:31:13 PM »
Code: [Select]
                        self._adminPlugin.warnClient(event.client, self._warningrule , None, False)

Change that line to:
Code: [Select]
                        self._adminPlugin.kickClient(event.client, self._warningrule , None, False)
                        self._adminPlugin.warnClient(event.client, self._warningrule , None, False)

that should work. If it doesn't, please say why.

Offline Lolzumad

  • Full Member
  • ***
  • Posts: 50
Re: Weapon Control Plugin - Antinoob v1.0.3
« Reply #27 on: January 31, 2009, 11:03:46 PM »
Now it doesn't warn nor kick.  Also...I noticed that this new version of antinoob doesn't display a "don't use" message at the start of a round and a "you can use" message after a set time like it used to...

Here is my py:
Quote
class WeaponInfo:
    _weaponName = None
    _permanent = "0"
   
class MapInfo:
    _mapName = None
    _duration = 10   

#--------------------------------------------------------------------------------------------------
class AntinoobPlugin(b3.plugin.Plugin):
    _adminPlugin = None
    _currentMap = None
    _weapons = []
    _bannedweapons = []
    _maps = []
    _warnduration = 10
    _warndurationdefault = 10
    #default
    _warningrule = 'rule10'
    _unlockmessage = '%s ^3seconds passed ^7- ^3all weapons unlocked^7!!!'
    _infomessage = '^1NO ^2air strikes^7, ^2helis^7 or ^2RPGs for ^7%s seconds. ^1NO ^2martyrdom^7, ^2last stand ^7or ^2launchers allowed^7.'

    def onStartup(self):
        self.registerEvent(b3.events.EVT_CLIENT_KILL)
        self.registerEvent(b3.events.EVT_CLIENT_DAMAGE)
        self.registerEvent(b3.events.EVT_GAME_ROUND_START)
        self._adminPlugin = self.console.getPlugin('admin')

    def onLoadConfig(self):
        self.debug('Loading Configuration Started')
        self._warndurationdefault = self.config.getint('settings', 'warn_duration')
        self.debug('_warndurationdefault: ' + str(self._warndurationdefault))
        self._warningrule = self.config.get('settings', 'warning_rule')
        self._unlockmessage = self.config.get('settings', 'unlock_message')
        self._infomessage = self.config.get('settings', 'info_message')       
       
        for e in self.config.get('weapons/weapon'):
            #name  = setting.get('name')
            self.debug('Weapon parsed: ' + e.text + ' perm: ' + e.get('perm'))
            _wi = WeaponInfo();
            _wi._weaponName = e.text.strip();
            self.debug('Weapon loaded: ' + _wi._weaponName)
            _wi._permanent = e.get('perm');
            if(_wi._permanent == "0"):
                self._weapons.append(_wi)
            else:
                self._bannedweapons.append(_wi)
        _maps = []
        for e in self.config.get('maps/map'):
            #name  = setting.get('name')
            _mi = MapInfo();
            _mi._mapName = e.get('name')
            _mi._duration = int(e.text.strip())
            self.debug('Map parsed: ' + _mi._mapName + ' duration: ' + str(_mi._duration))
           
            self._maps.append(_mi);
       
        self.debug('Loading Configuration Finished')
        return
               
    def _usingWeaponsAllowed(self):
           self.debug(self._unlockmessage % self._warnduration)
           self.console.say(self._unlockmessage % self._warnduration)
           return
       
    def onEvent(self, event):
        if event.type == b3.events.EVT_CLIENT_KILL or event.type ==  b3.events.EVT_CLIENT_DAMAGE:
            weaponname = event.data[1]
            if self.console.game.roundTime() <= self._warnduration:
                #self.debug(weaponname + ' in warnduration: ' + str(self.console.game.roundTime()))
                for weaponInfo in self._weapons:
                    if weaponInfo._weaponName == weaponname:
                        #self.debug('[WARN] - Temporary Restricted Weapon: ' + str(weaponname) + '- Round time: ' + str(self.console.game.roundTime()))
                        self._adminPlugin.warnClient(event.client, self._warningrule , None, False)
                        return
            for bannedweaponInfo in self._bannedweapons:
                if(bannedweaponInfo._weaponName == weaponname):
                    #self.debug('[WARN] - Banned Weapon: ' + str(weaponname))
                    self._adminPlugin.kickClient(event.client, self._warningrule , None, False)
                    self._adminPlugin.warnClient(event.client, self._warningrule , None, False)
                    return
        elif event.type == b3.events.EVT_GAME_ROUND_START:
            if self._currentMap == None or self.console.game.mapName != self._currentMap:
                self._currentMap = self.console.game.mapName
                self.debug('New Map: ' + str(self._currentMap))
                self._warnduration = self._warndurationdefault
                for mapinfo in self._maps:
                    if(mapinfo):
                        if self._currentMap == mapinfo._mapName:
                            self._warnduration = mapinfo._duration
                            self.debug('New Duration: ' + str(self._warnduration))
                            break
            if len(self._weapons) > 0:
                self.debug(self._infomessage % self._warnduration)
                self.console.say(self._infomessage % self._warnduration)
                t = threading.Timer(self._warnduration+1, self._usingWeaponsAllowed)
                t.start()
            return

And here is my xml:
Quote
<configuration plugin="antinoob">
   <settings name="settings">   
      <set name="warn_duration">20</set>
      <set name="warning_rule">rule11</set>
      <set name="unlock_message">%s ^3seconds passed ^7- ^3all weapons unlocked^7!!!</set>
      <set name="info_message">^1NO ^2air strikes^7, ^2helis^7 or ^2RPGs for ^7%s seconds. ^1NO ^2martyrdom^7, ^2last stand ^7or ^2launchers allowed^7.</set>
   </settings>
   <weapons>
      <!-- Tubes -->
        <weapon perm="1">gl_ak47_mp</weapon>
        <weapon perm="1">gl_g3_mp</weapon>
        <weapon perm="1">gl_g36c_mp</weapon>
        <weapon perm="1">gl_m4_mp</weapon>
        <weapon perm="1">gl_m14_mp</weapon>
        <weapon perm="1">gl_m16_mp</weapon>
        <weapon perm="1">gl_mp</weapon>       
        <!-- Nades -->   
        <!-- Airstike -->       
        <weapon perm="0">artillery_mp</weapon>
    <!-- RPG -->
    <weapon perm="0">rpg_mp</weapon>
        <!-- Heli -->       
        <!-- <weapon perm="0">helicopter_mp</weapon>        -->   
        <!-- Martyr -->
        <weapon perm="1">frag_grenade_short_mp</weapon>
   </weapons>
</configuration>
« Last Edit: February 03, 2009, 12:42:44 AM by Lolzumad »

Offline Anubis

  • Moderator
  • Sr. Member
  • *
  • Posts: 228
    • g4g.pl
Re: Weapon Control Plugin - Antinoob v1.0.3
« Reply #28 on: February 01, 2009, 12:06:21 AM »
As said in the very first post in this thread:
unlock_message - message announcing unlocking weapons - MUST CONTAIN %s which will be replaced by number of seconds
info_message - message informing about duration of weapons restriction  - MUST CONTAIN %s which will be replaced by number of seconds

Offline Lolzumad

  • Full Member
  • ***
  • Posts: 50
Re: Weapon Control Plugin - Antinoob v1.0.3
« Reply #29 on: February 01, 2009, 12:22:40 AM »
Sorry...I knew I still had to change that but I didn't think it would stop it from working.

However, I still do not get a message on round start and another a set time into the round.  I also do not get a warn or a kick when a noob tube is used.

 


Rate this page +1 at Google Search