Day of Defeat Plugins Community
This site is an archive — everything is readable and downloadable, nothing can be posted. Admin
Archive › Old Forum Threads › DoD Plugins › Non Developer Plugins › Bot Apology for TK
9 posts, 5 people · 7,072 views Thread Rating: ★★★★★
closedBot Apology for TK
Started by Fysiks on 02-17-2009, 05:09 PM
F Fysiks
started this thread
Posts: 108
Threads: 3
Joined: Aug 2007
02-17-2009, 05:09 PM #1

Bot Apology for TKrn rnMany servers that I play on have friendly fire turned on and many also "require" an apology for team kills. If you have bots, why not let them set a good example?rn rnDescription:rnThis plugin will make a bot apologize, in chat, for it's team kills.rn rnCvars:rnamx_bot_apology <1|0> - Turn Plugin On or Off.rnamx_bot_apology_prob <0-100> - The probability that the bot will apologize for a TK.rnamx_bot_apology_method <0-100> - Probability that team chat will be used. (0 -> public, 100 -> team)rnamx_bot_apology_delay <#> - The time between the TK and the apology (from last TK if there was another within the delay time of the previous TK).rnrnLatest update available here.

Dr.G
posted here
Posts: 776
Threads: 75
Joined: Nov 2007
02-18-2009, 06:19 PM #2

1st off all nice to see new ppl thats jumped in to coding around here, but there are things that i dont understand in your code...rnrn1 - it would be great to have and on and off cvar, so e.g its starting to spam out some message, you can stop it.rnrn2 - the plugin_cfg() part isnt needed, and its not good to lock some pointers, cuz if u do so u will need to restart the server for them to change value.rnrn3 - in the ham_player_death func. you should start by checking if its a bot or not, there are no need to run thru alot of "if's" is its not a bot that did something. and iam not sure that a bot even can get disconnected :)rnrnrncheers

F Fysiks
started this thread
Posts: 108
Threads: 3
Joined: Aug 2007
02-19-2009, 01:22 AM #3
1 - it would be great to have and on and off cvar, so e.g its starting to spam out some message, you can stop it.
rnrnI thought about that but figured if you didn't want it on you wouldn't install the plugin. But I can put it in there. Why would it start spamming?rnrn
2 - the plugin_cfg() part isnt needed, and its not good to lock some pointers, cuz if u do so u will need to restart the server for them to change value.
rnrnI figure it's not really a setting that you would be needing to change instantaneously. But I can switch it. I guess, at the time, I was trying to not use so many native calls in the death function. I don't know enough to know if it is significantly slower or not. Also, it would only require a map change.rnrn
3 - in the ham_player_death func. you should start by checking if its a bot or not, there are no need to run thru alot of "if's" is its not a bot that did something.
rnrnI was told, at AlliedModders, to do non-native checks first but I don't know that I agree. What I told them was that I should check for the most likely case to return true first. I would check for it not being a TK first then check if it's a bot second. But now that I think of it I would check for bots first then tks.rnrn
and iam not sure that a bot even can get disconnected :)
rnrnIf a bot's id is 12 and gets kicked for tking is_user_connected(12) should return false. But then again, if you use max_bots, the bot will be replaced and the new bot will say sorry :).

meathead
posted here
Posts: 337
Threads: 23
Joined: Aug 2007
02-19-2009, 08:50 AM #4

Will try it out!

F Fysiks
started this thread
Posts: 108
Threads: 3
Joined: Aug 2007
02-19-2009, 04:58 PM #5

Updated. See Changelog.

Vet
posted here
Posts: 229
Threads: 24
Joined: Oct 2006
02-20-2009, 09:11 PM #6
P.S. I was told I was not creative with my phrases by a friend. Change as you please.
rnlol; How 'bout my favorite... "Sorry, I didn't know it was loaded".

F Fysiks
started this thread
Posts: 108
Threads: 3
Joined: Aug 2007
02-20-2009, 09:18 PM #7

Updated.rnrn

lol; How 'bout my favorite... "Sorry, I didn't know it was loaded".
rnrnYeah, but that's a lie everytime! :)rnrnEDIT: Updated to 1.5rnEDIT: Updated to 2.0

D dannyowan
posted here
Posts: 54
Threads: 12
Joined: Aug 2005
02-24-2009, 04:12 AM #8

cool!nbots always tk us xD

F Fysiks
started this thread
Posts: 108
Threads: 3
Joined: Aug 2007
04-10-2009, 11:19 PM #9

I added the use of bot_apology.ini for phrases to be used. It can be found here:rnrnhttp://forums.alliedmods.net/showthread.php?t=85581

Archive › Old Forum Threads › DoD Plugins › Non Developer Plugins › Bot Apology for TK
DoD Plugins Archive · Repository · Old Forum Threads · Maps · Admin · built 14 Sep 2026 00:34 UTC