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!

You are here: Big Brother Bot ForumAdd-OnsPlugins Discussion (Moderator: MordyT)Removing warnings from Team kill plugin
Pages: [1] 2   Go Down
  Print  
Author Topic: Removing warnings from Team kill plugin  (Read 874 times) Bookmark and Share
Beta Testers
*
OS: Linux
Type: Owner dedicated server(s)
Gameservers: UrT
Posts: 244
Offline Offline
« on: April 19, 2011, 07:35:19 AM »

Hi!

I'm new here, but I've been using BBB for few months now. I have an issue related to the team kill plugin. At the moment, users are getting warnings for killing team members. This works fine, however I'd like to remove the warnings for Team kills at all.

I don't know python good enough, so I want to ask if it is safe to comment these two lines in tk.py:

Quote
warning = self._adminPlugin.warnClient(attacker, '^3Do not attack teammates, ^1Attacked: ^7%s ^7[^3%s^7]' % (victim.exactName, points), None, False)
 a.warn(v.cid, warning)
(lines 336 and 337)

Does commenting these two lines influence bans for gaining more TK points set by maxpoints?
And eventually, how to modify the tk.py to make this warning last shorter?

Thanks in advance
Logged


XLRstats dev.
Dev. Team
*
OS: Linux
Type: Home user
Gameservers: COD5, COD7, BF3
Posts: 947
Offline Offline
WWW
Support Specialty: XLRstats webfront
« Reply #1 on: April 19, 2011, 08:10:01 AM »

You can completely disable teamkill plugin via your b3.xml.

Find this line:

Code: xml

and uncomment it like this:

Code: xml

Logged

Beta Testers
*
OS: Linux
Type: Owner dedicated server(s)
Gameservers: UrT
Posts: 244
Offline Offline
« Reply #2 on: April 19, 2011, 08:16:09 AM »

I know such basics, but thanks anyway:)
We need plugin TK on the server, but I want to get rid of warnings for TK, because they have equal value as warnings from badwords or warnings given by admins for breaking other rules.
I can't just modify the plugin and test it, because currently owner of the server restricted access to the ftp account, so I need answers to my questions in the first post.
Logged

Senior Dev.
*
OS: Linux
Type: Home user
Posts: 3484
Offline Offline
WWW
Support Specialty: B3-Core, UrT/SmG/BFBC2 parsers, Plugin development
« Reply #3 on: April 19, 2011, 08:21:58 AM »

see in plugin_tk.xml the line
Code:
<set name="issue_warning">sfire</set>

Then lookup 'sfire' in plugin_admin.xml, you will find that (by default) it points to rule9 which is a warning lasting 3h. I suggest you set 5m instead.

This will make warnings to the 'sfire' keyword last only 5m


OR


you could change 'sfire' to 'tk' in the plugin_tk.xml file  and modify the "tk" warning time in plugin_admin.xml

Code:
<set name="tk">1d, ^7stop team killing!</set>
becomes
Code:
<set name="tk">5m, ^7stop team killing!</set>
« Last Edit: April 19, 2011, 08:23:34 AM by Courgette » Logged

Beta Testers
*
OS: Linux
Type: Owner dedicated server(s)
Gameservers: UrT
Posts: 244
Offline Offline
« Reply #4 on: April 19, 2011, 08:27:20 AM »

I know that also, however rule 9 points to warning titled "Do ^1NOT ^3fire at teammates or within 10 seconds of spawning", and the warnings which users get are titled "Do not attack teammates, ^1Attacked: ^7%s ^7[^3%s^7]' ", which is declared in tk.py file, and I can't see any connection between this second warning and plugin_admin.xml.
Logged

Senior Dev.
*
OS: Linux
Type: Home user
Posts: 3484
Offline Offline
WWW
Support Specialty: B3-Core, UrT/SmG/BFBC2 parsers, Plugin development
« Reply #5 on: April 19, 2011, 09:24:56 AM »

then try the following :

Code: python
warning = self._adminPlugin.warnClient(attacker, '^3Do not attack teammates, ^1Attacked: ^7%s ^7[^3%s^7]' % (victim.exactName, points), timer=False, newDuration="5m")
or

Code: python
warning = self._adminPlugin.warnClient(attacker, '5m, ^3Do not attack teammates, ^1Attacked: ^7%s ^7[^3%s^7]' % (victim.exactName, points), None, False)
Logged

Beta Testers
*
OS: Linux
Type: Owner dedicated server(s)
Gameservers: UrT
Posts: 244
Offline Offline
« Reply #6 on: April 19, 2011, 09:32:34 AM »

Thanks, I'll try that when the owner will be online. And what do you think about commenting out these two lines that I pointed in the first post? Will be players still kicked out after gaining more points than set in maxpoints?
Logged

Senior Dev.
*
OS: Linux
Type: Home user
Posts: 3484
Offline Offline
WWW
Support Specialty: B3-Core, UrT/SmG/BFBC2 parsers, Plugin development
« Reply #7 on: April 19, 2011, 09:34:16 AM »

no it would not be kicked. The tk plugin only gives warnings. then B3 decides to kick once a player has too many actives warnings
Logged

Beta Testers
*
OS: Linux
Type: Owner dedicated server(s)
Gameservers: UrT
Posts: 244
Offline Offline
« Reply #8 on: April 19, 2011, 10:35:14 AM »

no it would not be kicked. The tk plugin only gives warnings. then B3 decides to kick once a player has too many actives warnings

Hmm.. then I don't get it:) What for is the maxpoints setting then? And what does the following lines of code does? Because I can see there, that if player has 150% of Maxpoints he gets banned instantly, and if he has more than maxPoints but less then 150% max points, then the 30 seconds timer starts and after that it checks if points were forgiven - if not, it bans the user. Nothing about warnings in this part of code...

Quote
  if points >= self._maxPoints + (self._maxPoints / 2):
                self.forgiveAll(event.client.cid)
                event.client.tempban(self.getMessage('ban'), 'tk', self.getMultipliers(event.client)[2])
            elif event.client.var(self, 'checkBan').value:
                pass
            else:
            (...)
Logged

Senior Dev.
*
OS: Linux
Type: Home user
Posts: 3484
Offline Offline
WWW
Support Specialty: B3-Core, UrT/SmG/BFBC2 parsers, Plugin development
« Reply #9 on: April 19, 2011, 10:43:28 AM »

oh I forgot that bit  Roll Eyes  this piece of code is for asses killing all the teammates they can right from spawn. In that case, yes the tk plugin kickban
Logged

Beta Testers
*
OS: Linux
Type: Owner dedicated server(s)
Gameservers: UrT
Posts: 244
Offline Offline
« Reply #10 on: April 19, 2011, 12:25:14 PM »

Oh, man, this is totally strange for me:) I don't know python, but I've got plenty of experience in other programming languages, so it's not hard for me to understand most of the code, and I feel like we are talking about two different tk.py files:)

To avoid putting wrong configuration on the main server, I started my own dedicated server with BBB. I deleted the two lines that I mentioned, and it seemed like it worked. Well, almost. For the first TK, I obtained warning (with message ^3Do not attack teammates, ^1Attacked: ^7%s ^7[^3%s^7] , which was strange). However for next team kills I didn't get any warnings and the plugin counted TK points normally. After reaching maxpoints I received forgive_warning message, and after reaching 150% of maxpoints i got insant ban.
So the result was: for 5 TKs (i had maxpoints=600 and kill_multiplier=2), I received 1 warning, and temban of time specified by ban_length). And still I have no idea how tk.py could give this warning when I deleted the line responsible for it:) But it's better than before, when I would receive 5 warnings for 5 TKs Smiley
Logged

Senior Dev.
*
OS: Linux
Type: Home user
Posts: 3484
Offline Offline
WWW
Support Specialty: B3-Core, UrT/SmG/BFBC2 parsers, Plugin development
« Reply #11 on: April 19, 2011, 02:41:00 PM »

glad you got it do (almost) what you want Smiley
To tell the truth, that's a long time I've put my head into understanding how that plugin works and I'm quite busy with the Homefront support and Unicode issues we have with the latest beta.
Logged

Beta Testers
*
OS: Linux
Type: Owner dedicated server(s)
Gameservers: UrT
Posts: 244
Offline Offline
« Reply #12 on: April 19, 2011, 10:32:24 PM »

I'll try to learn and practice some python:)
But I have one more question, if I modify any of the *.py files, to I need to run the b3 in any special way, so that the files are recompiled (do they even have to be compiled)?
Logged

Beta Testers
*
OS: Linux
Type: Owner dedicated server(s)
Posts: 234
Offline Offline
« Reply #13 on: April 19, 2011, 10:44:32 PM »

Python does not compile, it does interprete. That's why you use "python ./b3_run.py" to start interpreting. Hence there is no problem with modifing a plugin, I did it sometimes. But don't change something in the source.
Logged
Senior Dev.
*
OS: Linux
Type: Home user
Posts: 3484
Offline Offline
WWW
Support Specialty: B3-Core, UrT/SmG/BFBC2 parsers, Plugin development
« Reply #14 on: April 19, 2011, 11:07:08 PM »

modify anything you want at your own risk Smiley

A bit of advice : indentation in python is very important and you should use a text editor which uses 4 space characters as an indentation instead of one tab character. Python refuse to work well if you mix tabs and spaces for your indentation
Logged

Tags:
Pages: [1] 2   Go Up
  Print  
 
Jump to:  


Rate this page +1 at Google Search


SimplePortal 2.3.1 © 2008-2009, SimplePortal