thankyou
Donate to the B3 fund!

"even a small donation helps!"
Donate with PayPal!
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: CoD4 Mute  (Read 11013 times)

Offline MordyT

  • Support Hero
  • Hero Member
  • *
  • Posts: 3644
  • Over $300 Donated to B3!
    • MordyT
Re: CoD4 Mute
« Reply #15 on: September 26, 2011, 06:50:54 PM »
Quick glance at the code (I don't run COD server myself), and I believe MordyT, that you should try "!mute name 1 test" - that should ban for one minute. Unless the error is connected to something else (you could have paste this one line of error message:P )

I can test that, but I was looking for a persistent mute... I thought the code spoon gave would keep him muted until I unmuted the player...
Help will be given to those with a b3.log

If drop off the map it is due to RL becoming busy :)

System: Python 2.7.3 - Deb 7 - B3 Source Code - 128MB RAM box (rented at $5 a year) - remote MySQL - Remote Web Services

Offline Garreth

  • Sr. Member
  • ****
  • Posts: 279
Re: CoD4 Mute
« Reply #16 on: September 26, 2011, 07:29:21 PM »
Hmm... It would be easy to do such perm-mute in this plugin, however I don't want to mess with the code that I can't really test.

To spoon: For perm-mute, just put into the database Timeexpire= -1, That would also should look nicely in echelon, when such perm-mute would be given to the user.

Offline MordyT

  • Support Hero
  • Hero Member
  • *
  • Posts: 3644
  • Over $300 Donated to B3!
    • MordyT
Re: Re: CoD4 Mute
« Reply #17 on: September 26, 2011, 07:32:59 PM »
What I was saying though is since spoon gave code that was suppose to perma mute, I should not need to specify a time. I am modding the code myself now, so I will see what damage I can do

Via my HTC Thunderbolt
Help will be given to those with a b3.log

If drop off the map it is due to RL becoming busy :)

System: Python 2.7.3 - Deb 7 - B3 Source Code - 128MB RAM box (rented at $5 a year) - remote MySQL - Remote Web Services

Offline Spoon

  • Moderator
  • Sr. Member
  • *
  • Posts: 255
    • EHD Gaming
Re: CoD4 Mute
« Reply #18 on: September 27, 2011, 11:56:27 PM »
If what Garreth said doesn't work please post a bit of your your log showing the error.

Offline MordyT

  • Support Hero
  • Hero Member
  • *
  • Posts: 3644
  • Over $300 Donated to B3!
    • MordyT
Re: CoD4 Mute
« Reply #19 on: September 27, 2011, 11:58:17 PM »
I tired yesterday, and got "!mute @9 1 cause" to work.
I was unable to use client names, just lookups/ids
I was unable to remove the mute in game as well, !unmute @id produced no response in game.
I was unable to test it yet.

This weekend I will do all the tests, but at least somewhat it appears to be working.
Will get back to you.
Help will be given to those with a b3.log

If drop off the map it is due to RL becoming busy :)

System: Python 2.7.3 - Deb 7 - B3 Source Code - 128MB RAM box (rented at $5 a year) - remote MySQL - Remote Web Services

Offline Spoon

  • Moderator
  • Sr. Member
  • *
  • Posts: 255
    • EHD Gaming
Re: CoD4 Mute
« Reply #20 on: September 28, 2011, 01:15:21 PM »
It works fine on my server with names. I forgot to put a message in to tell you if the person was unmuted.

Offline Spoon

  • Moderator
  • Sr. Member
  • *
  • Posts: 255
    • EHD Gaming
Re: CoD4 Mute
« Reply #21 on: October 14, 2011, 08:35:09 PM »
Double Post:
Changed the mute command (built off tempban command) now has no reason, and can use rule1 to show full reason.
Code: [Select]
    def cmd_mute(self, data, client=None, cmd=None):
        """\
        <name> <duration> [<reason>] - temporarily mute a player
        """
        m = self._adminPlugin.parseUserCmd(data)

        if not m:
            client.message('^7Invalid parameters')
            return False

        cid = m[0]
        m = re.match('^([0-9]+[dwhsm]*)(?:\s(.+))?$', m[1], re.I)
        if not m:
            client.message('^7Invalid parameters')
            return False

        duration, keyword = m.groups()
        duration = functions.time2minutes(duration)       
        reason = self._adminPlugin.getReason(keyword)

        if not reason and client.maxLevel < self._adminPlugin.config.getint('settings', 'noreason_level'):
            client.message('^1ERROR: ^7You must supply a reason')
            return False
        elif not duration:
            client.message('^7You must supply a duration to mute for')
            return False

        sclient = self._adminPlugin.findClientPrompt(cid, client)
        timeadd = (int(time.time()))
        timeend = (int(time.time()) + (duration*60))

        if sclient:
            if sclient.cid == client.cid:
                client.message('You cant mute yourself')
                return True
            elif sclient.maxLevel >= client.maxLevel:
                if sclient.maskGroup:
                    client.message('^7%s ^7is a masked higher level player, can\'t mute ' % client.exactName)
                else:
                    client.message('You cant mute %s' % (sclient.exactName))
                return True
            else:
                cursor = self.console.storage.query("""
                    INSERT INTO penalties ( type, client_id, admin_id, duration, inactive, reason, time_add, time_edit, time_expire )
                    VALUES ('mute', '%s', '%s', '%s', '0', '%s', '%s', '%s', '%s')
                    """ % (sclient.id, client.id, duration, reason, timeadd, timeadd, timeend)) #Have to escape quotes (')
                self.getmute(sclient)
                return True

        else:
            return False
also added message to unmute command to say the user has been unmuted.
Code: [Select]
    def cmd_unmute(self, data, client=None, cmd=None):
        """\
        <player> - unmutes a player
        """
        m = self._adminPlugin.parseUserCmd(data)
        if not m:
            client.message('^7Invalid parameters')
            return False

        sclient = self._adminPlugin.findClientPrompt(m[0], client)
        if sclient:
            cursor = self.console.storage.query("""
            SELECT id, client_id, inactive, time_expire
            FROM penalties
            WHERE client_id = '%s' AND type = 'mute'
            ORDER BY id DESC LIMIT 1
            """ % (sclient.id))

            r = cursor.getRow()

            if cursor.rowcount > 0:
                id = r['id']
       
                cursor = self.console.storage.query("""
                    UPDATE penalties
                    SET inactive = '%s'
                    WHERE id = '%s'
                    """ % (1, id))
                self.getmute(sclient)
                client.message('%s has been unmuted' % (sclient.exactName))
            else:
                client.message('This user is not muted')
        else:
             return False

 


Rate this page +1 at Google Search

anything