1v1 Knife Fight (1.2.1, Updated: 10/17/2008)
2 Attachment(s)
General:
This is my second plugin! This is based off dalto's original plugin as well as the Knifep3n plugin for eventscripts. I did borrow a few snippets from dalto's unapproved plugin. I also borrowed code from the core beacon.sp. Additionally, thanks to FlyingMongoose for letting me steal his lightning effects and sound, and LDuke for his ragdoll dissolver code. =) Info: When a 1 versus 1 situation occurs, the plugin will prompt players asking if they want to knife to the death. This plugin does support music during the fight, however I have not included any at this time. When the knife fight starts, ALL weapons are stripped, and saved. When the fight has concluded, the winner will get their weapons back. The bomb is removed when the knife fight starts, there will be no completing the objective, someone must die! Additionally, the fights won't trigger if the bomb is already planted. Usage: Sit back and have fun. If you would like to see it in action before downloading, you can visit this server: 65.99.193.99:27015 Installation: Download the zip file and extract into your /cstrike/ directory. Manual Installation:
Configuration:
Version 1.2.1: Added CVAR feature request: sm_knifefight_minplayers. Places requirement on the minimum number of players on the server before knife fights will trigger. Version 1.2: You must update your translations file with version 1.2! Added CVAR sm_knifefight_fighttime. This is a generic fight timer. Once the time expires, if there is no winner, the players will be slayed and will not receive their weapons back. Fixed crash scenario with GunGame4. Prevented fights from starting if the map is over (during scoreboard/intermission). Version 1.1: Changed from using GetEntDataEnt to GetEntDataEnt2 - more stable and no errors. Added CVAR: sm_knifefight_locatorbeam This cvar places beams between the two players so that they can easily find each other if they are far apart. Works with and without teleport enabled. Added CVAR: sm_knifefight_stopmusic When enabled, this will stop the fight music as soon as the fight is over. This is useful on gungame servers incase the winner of the knife fight wins the game. It prevents the winner music and fight music from overlapping. Unfortunately, I don't know of any way to reach over and check the "level" the gungame player is on to make this work dynamically. Maybe in the future. You can either erase your knifefight.cfg and let it be re-created, or add these two new cvar's to it manually. Version 1.0.2: I think I've gotten the crash bug fixed now. No, really. Thanks to Tigerox for helping track it down! Please upgrade to this version, or you may still be at risk for server crashes. Also looks for my warmup round plugin. Knife fights will not occur during warmup. Version 1.0.1: Traced crash bug to an error dealing with entity's. Must have been the weapon handler. I completely rewrote the weapon stripping/giving function this evening. Did some minor cleanup. Less PrintToChatAll, more PrintHintTextToAll for shiny purposes. Version 1.0: Fixed a few small timing issues to make things smoother. Please provide feedback on whatever issues you may find! Did some minor code cleanup based on feedback from others. Version 0.8: Fixed a really stupid bug on my part regarding some people reporting weapons not being stripped etc, prior to a knife fight. I accidentally had the code which performs these functions within a conditional statement for the music. If you had no songs defined, you wouldn't get any of the functionality. Oopsie. Please erase your knifefight.cfg file when updating to this version, it needs to be generated automatically from the plugin. Added CVAR sm_knifefight_losereffects Added ragdoll dissolve animation to the losing player's body. Version 0.7: Added CVAR sm_knifefight_countdown timer. If the player has a speed boost going into knife fight, the speed is removed prior to the new fight beginning. Added IsFakeClient logic. If one bot and one human player remain, the bot will always agree to knife. If only two bots are left alive, the knife fight never triggers. It's painful enough watching two bots with guns camp it out. Please erase your knifefight.cfg file when updating to this version, it needs to be generated automatically from the plugin. See GunGame: Python notes below in red. Version 0.6: Fixed some minor bugs I created in 0.5. Moved teleport to be sooner, if needed. This version is very stable! Ran for 16 hours yesterday, error free. Please erase your knifefight.cfg file when updating to this version, it needs to be generated automatically from the plugin. Version 0.5: Fixed various issues with invalid client index 0. Players SHOULD always get a knife now! (probably just jinxed it) Fixed Cvar change notifications. Version 0.4: Fixed issues where dumb admins decide to slay a player during the countdown or knife fight. No file changes except for .smx. I *may* have fixed it not giving a knife. I tried with bots about 40 times in a row and never had an instance without a knife. This may well not be the case with more real players however. Version 0.3: Fixed many dynamic errors today based on various situations. This version is much more stable over the original testing release. No file changes except for .smx. Version 0.1: Public testing release. Known Issues: Gungame: Python Issues: If you use Turbo mode (without respawn), it will strip the knife away from a player during a knife fight due to turbo having a dependency set on gg_dead_strip. To fix this, open addons/eventscripts/gungame/included_addons/gg_turbo/gg_turbo.py. Line 42: gg_turbo.addDependency('gg_dead_strip', 1) Change to: gg_turbo.addDependency('gg_dead_strip', 0) Remove your gg_turbo.pyc file, and restart gungame. This will disable weapon stripping, and turbo will continue to function normally, with the mild exception that in rare instances, a player may walk over a gun and pick it up instead of being given their next weapon as intended. It's also probably a bad idea to try and use this on a deathmatch/respawn server. Additional Comments: Being my second plugin, this was a real learning experience. I'm sure I did a lot of stuff in stupid ways. End result, it works! If you use fast downloads/redirects, don't forget to copy chicken.wav (and your fight songs). This plugin does add the files to the download tables. When running this plugin, please check your log file for errors occasionally and report them back. If you can turn on debugging while testing and post the debug logs, that'd be even better. Enjoy! X |
Re: 1v1 Knife Fight
Will be testing this thoroughly today tomorrow, will let you know if we see any bugs :). Great work!
|
Re: 1v1 Knife Fight
Woot! We have installed it on our GunGame server and it seems to be working great. We have seen 1 bug and 1 error so far.
1. Once in awhile your knife will get stuck and you can't knife. 2. Error Log L 09/24/2008 - 11:09:09: [SM] Native "GetClientTeam" reported: Client index 0 is invalid L 09/24/2008 - 11:09:09: [SM] Debug mode is not enabled for "knifefight.smx" L 09/24/2008 - 11:09:09: [SM] To enable debug mode, edit plugin_settings.cfg, or type: sm plugins debug 32 on |
Re: 1v1 Knife Fight
Quote:
X |
Re: 1v1 Knife Fight
Here is the debug mode:
L 09/24/2008 - 14:34:16: [SM] Native "GetClientTeam" reported: Client index 0 is invalid L 09/24/2008 - 14:34:16: [SM] Displaying call stack trace for plugin "knifefight.smx": L 09/24/2008 - 14:34:16: [SM] [0] Line 399, /home/groups/sourcemod/upload_tmp/textwDkT26.sp::CancelFight() L 09/24/2008 - 14:34:16: [SM] [1] Line 444, /home/groups/sourcemod/upload_tmp/textwDkT26.sp::Countdown() Our gungame has had our 1st crash and we just added this plugin so I am guessing something in this plugin is caushing the crash. Thanks! |
Re: 1v1 Knife Fight
Also at the end of the round and you kill the person before the knife fight triggers (both pressed to fight) it starts the next round but the knife fight starts on that round because it carries over from last round.
|
Re: 1v1 Knife Fight
Here is another error:
L 09/24/2008 - 14:44:36: [SM] [0] Line 399, /home/groups/sourcemod/upload_tmp/textwDkT26.sp::CancelFight() L 09/24/2008 - 14:44:36: [SM] [1] Line 723, /home/groups/sourcemod/upload_tmp/textwDkT26.sp::PanelHandler() |
Re: 1v1 Knife Fight
Thanks, much appreciated.
I threw it on my gungame server as well. Immediately I found a bunch of different scenarios I hadn't envisioned, so I've got more work to do. Instead of updating the plugin every 20 minutes on here, I'll try and get it updated once a day so you have new versions to test with. One thing that came up right away on gungame was the speed at which players join (especially on map change). ie: map starts, players join, start fighting, 1v1 knife starts, more players join and stay alive because its only been say 30 seconds, so the server doesn't join them as dead. I suppose if a knife fight is going on I'll just kill the player as they join. |
Re: 1v1 Knife Fight
Updated to 0.4, please see changelog/notes.
The plugin should be very stable at this point. If you get crashes or any other odd behaviour, please report it! Thanks, X |
Re: 1v1 Knife Fight
We are still getting crashing with the 0.03 as well as this in the error log:
L 09/25/2008 - 09:47:36: [SM] Native "GetClientTeam" reported: Client index 0 is invalid L 09/25/2008 - 09:47:36: [SM] Displaying call stack trace for plugin "knifefight.smx": L 09/25/2008 - 09:47:36: [SM] [0] Line 424, /home/groups/alliedmodders/forums/files/3/7/7/5/1/31782.attach::CancelFight() L 09/25/2008 - 09:47:36: [SM] [1] Line 417, /home/groups/alliedmodders/forums/files/3/7/7/5/1/31782.attach::StartFight() L 09/25/2008 - 09:47:36: [SM] [2] Line 744, /home/groups/alliedmodders/forums/files/3/7/7/5/1/31782.attach::PanelHandler() L 09/25/2008 - 09:47:36: [SM] Native "GetClientTeam" reported: Client index 0 is invalid |
All times are GMT -4. The time now is 08:17. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.