| closedBot Apology for TK |
| Started by Fysiks on 02-17-2009, 05:09 PM |
Threads: 3
Joined: Aug 2007
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.
Threads: 75
Joined: Nov 2007
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
Threads: 3
Joined: Aug 2007
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 :).
Threads: 23
Joined: Aug 2007
Will try it out!
Threads: 3
Joined: Aug 2007
Updated. See Changelog.
Threads: 24
Joined: Oct 2006
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".
Threads: 3
Joined: Aug 2007
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
Threads: 12
Joined: Aug 2005
cool!nbots always tk us xD
Threads: 3
Joined: Aug 2007
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

