AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   KnifeFight (https://forums.alliedmods.net/showthread.php?t=94572)

altex 06-12-2009 17:55

KnifeFight
 
1 Attachment(s)
KnifeFight

Description

-----------
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.

http://forums.alliedmods.net/showthread.php?t=94572

Configuration
-------------
Code:


    sm_knifefight_version
          - KnifeFight version.
   
    sm_knifefight_enabled          - Enables or disables the plugin.
                                      (Default: 1)
    sm_knifefight_useteleport      - Use the built in teleport system before the fight.
                                      This helps ensure that both players find each other quickly.
                                      The Terrorist will always be teleported to the Counter-Terrorist.
                                      Additionally, if the players are already close to each other, no
                                      teleport will take place.
                                      (Default: 1)
                               
    sm_knifefight_forcefight        - Skips asking the players if they want to knife,
                                      and forces a 1v1 knife fight.
                                      (Default: 0)
    sm_knifefight_restorehealth    - Restore both players health to 100 prior to fighting.
                                      (Default: 0)
    sm_knifefight_winnerhealth      - The amount of health to give the winner for the next round only.
                                      (Default: 0)
    sm_knifefight_winnermoney      - The amount of extra money to give the winner for the next round only.
                                      (Default: 0)
    sm_knifefight_winnerspeed      - The amount of extra speed given to the winner for the next round only.
                                      (Default: 0)
    sm_knifefight_winnereffects    - Use lightning and sound effects on the winner after the fight.
                                      (Default: 1)
    sm_knifefight_losereffects      - Dissolve losers body using special effects.
                                      (Default: 1)
    sm_knifefight_locatorbeam      - Use locator beam between players if they are far apart.
                                      (Default: 1)
    sm_knifefight_declinesound      - Sound file to use when a player declines to knife fight.
                                      (Default: knifefight/chicken.wav)
    sm_knifefight_fightsongs        - Sound files to play during the knife fight (random).
                                      (Default: none.)
    sm_knifefight_stopmusic        - Stop music when fight is over. Useful when used with GunGame.
                                      (Default: 0)
    sm_knifefight_countdowntimer    - Number of seconds to count down before a knife fight.
                                      (Default: 3)
    sm_knifefight_fightimer        - Number of seconds to allow for knifing. Players get slayed after
                                      this time limit expires.
                                      (Default: 30)
    sm_knifefight_minplayers        - Minimum number of players before a knife fight will trigger.
                                      (Default: 4)
   
    sm_knifefight_alltalk          - Enable alltalk while knife fight.
                                      (Default: 1)
    sm_knifefight_block            - Enable player blocking (disable sm_noblock) if sm_noblock is enabled while knife fight.
                                    (Default: 0)
                                   
                                    If you are using sm_noblock (http://forums.alliedmods.net/showthread.php?t=91617)
                                    and want to disable noblock plugin automaticaly
                                    every time knife battle is started and enable noblock when knife battle
                                    is finished than you should set sm_knifefight_block to 1.
                                    By default this option is disabled, so sm_knifefight will not affect
                                    sm_noblock by default.

    sm_knifefight_randomkill        - Enable random kill after knife fight time end.
                                      (Default: 0)
    sm_knifefight_beaconsound      - The sound to play when beacon ring shows.
                                      (Default: buttons/blip1.wav)
    sm_knifefight_beaconradius      - Beacon radius.
                                      (Default: 800)
    sm_knifefight_soundprefdefault  - Default sound setting for new users.
                                      (Default: 1)
    sm_knifefight_debug            - Enable debug.
                                      (Default: 0)
    sm_knifefight_botfight          - Allow bot to knife fight with bot.
                                      (Default: 0)

    sm_knifefight_showwinner        - Show winner. 0 - Top left, 1 - Chat.
                                    (Default: 0)
    sm_knifefight_removenewplayer  - Remove player connected when fight is started. 0 - Slay, 1 - Move to spec.
                                    (Default: 0)

    say !kfmenu                    - Show knife fight settings menu.

Requirements
------------
Counter-Strike: Source
SourceMod 1.2.1

Installation

------------
Download the zip file and extract into your /cstrike/ directory.

Manual Installation:

* Copy knifefight.smx to /cstrike/addons/sourcemod/plugins/
* Copy knifefight.phrases.txt to /cstrike/addons/sourcemod/translations/
* Copy knifefight.sp to /cstrike/addons/sourcemod/scripting/
* Copy chicken.wav to /cstrike/sound/knifefight/
* Fight Music goes in /cstrike/sound/ and must be added to your knifefight.cfg file.

The plugin will automatically create your config (knifefight.cfg) file in: /cstrike/cfg/sourcemod/

Credits
-------
* Thanks to tigerox for GG4 DEATHMATCH ADDON version 1.2
http://forums.alliedmods.net/showthread.php?t=87198
Weapon remove on knife fight start is borrowed from its source.

* Thanks to Altex and Liam for GunGame:SM plugin
http://forums.alliedmods.net/showthread.php?t=93977
Colored top left text and colored chat messages
is borrowed from its source.

* Thanks to XARIUS for 1v1 Knife Fight plugin till version 1.2.1
http://forums.alliedmods.net/showthread.php?t=77948

* Thanks to Liam for Weapon Restrictions plugin
http://forums.alliedmods.net/showthread.php?t=69987
Weapon remove on item pick up is based on its source.

* Thanks to dalto for original plugin
http://forums.alliedmods.net/showthread.php?t=60254

* Thanks to Schubaal Knifep3n plugin for eventscripts
http://forums.eventscripts.com/viewtopic.php?t=19090

* Thanks to FlyingMongoose for the lightning effects.

* Thanks to LDuke for the dissolve effects.

Changelog
---------
Code:

    1.3.8:
        * Fixed hint text. Thanks to LordMarqus.

    1.3.7:
        + Added cvar "sm_knifefight_removenewplayer" to move spawned player to spec and not slay
            him if he spawned when knifefight is started. After that plugin removes weapons
            that left from that player.
        + Added cvar "sm_knifefight_showwinner" to not show winner in top left but in chat.

    1.3.6:
        * Fixed bug when players can call !kfmenu and start fight
          even if number of players less then sm_knifefight_minplayers.

    1.3.5:
        + Added cvar sm_knifefight_block to disable noblock when knife fight
          is started. It's behaviour is similar to sm_knifefight_alltalk.
          If you are using sm_noblock (http://forums.alliedmods.net/showthread.php?t=91617)
          and want to disable noblock plugin automaticaly
          every time knife battle is started and enable noblock when knife battle
          is finished than you should set sm_knifefight_block to 1.
          By default this option is disabled, so sm_knifefight will not affect
          sm_noblock by default.

    1.3.4:
        * Fixed error:
            L 06/25/2009 - 11:36:28: [SM] Native "IsPlayerAlive" reported: Client 3 is not in game
            L 06/25/2009 - 11:36:28: [SM] Displaying call stack trace for plugin "knifefight.smx":
            L 06/25/2009 - 11:36:28: [SM] [0] Line 1597, knifefight.sp:anelHandler()

    1.3.3:
        + Added sm_knifefight_botfight cvar.
        * Now hostages are removed when knife fight is started.
          It is needed to not allow CT to rescue all hostages
          after knife fight is started.

    1.3.2:
        * Added color to chat messages.
        * Blue color of winner in the left top corner is unreadable. Changed to light blue.
       
    1.3.1:
        * Fixed error when someone left server within 1 second after spawn and 1 vs 1 situation occures and
          there is a knife fight winner from last round and winner bonuses is on.
            L 06/21/2009 - 17:12:27: [SM] Native "IsClientInGame" reported: Client index 0 is invalid
            L 06/21/2009 - 17:12:27: [SM] Displaying call stack trace for plugin "knifefight.smx":
            L 06/21/2009 - 17:12:27: [SM]  [0]  Line 866, knifefight.sp::ItemsWon()

    1.3.0:
        + Added Always Accept Knife Fight and Never Accept Knife Fight in the !kfmenu
        + Added kfmenu option to bring back up the menu thats asks you to knife when there is only 1left on each team.
        * Updated translations.
        * Fixed not to drop knife after player wins knife fight.

    1.2.1.12:
        * Fixed bug when fight song started (so isFighting == true) but weapons not removed from players
          and health not restored and beacons not started.
          It happens when someone left the server sometimes.
          BTW after fight there are loser and winner effects. (so isFighting == true)
        * Added debug support.

    1.2.1.11:
        * Redesigned knifefight settings menu.

    1.2.1.10:
        * Fixed not to start knife fight if round has ended (round time is up, hostage rescued).

    1.2.1.9:
        + Added the option to allow users to mute/unmute the knife fight song.
          For saving setting clientprefs is used.
        * Maximum fight songs changed from 6 to 20.
        * sm_knifefight_fightsongs top folder location changed from
          /cstrike/sound/knifefight/ to /cstrike/sound/.
          Add "knifefight/" to all songs to update your cfg.
     
    1.2.1.8:
        * Fixed:
            L 06/16/2009 - 13:09:58: [SM] Native "IsClientInGame" reported: Client index 0 is invalid
            L 06/16/2009 - 13:09:58: [SM] Displaying call stack trace for plugin "knifefight.smx":
            L 06/16/2009 - 13:09:58: [SM] [0] Line 799, knifefight.sp::ItemsWon()
        * Fixed:
            L 06/16/2009 - 18:25:34: [SM] Native "GetClientTeam" reported: Client index 0 is invalid
            L 06/16/2009 - 18:25:34: [SM] Displaying call stack trace for plugin "knifefight.smx":
            L 06/16/2009 - 18:25:34: [SM]  [0]  Line 1281, knifefight.sp::EventPlayerDeath()
       
    1.2.1.7:
        * Fixed. Previous version does not work.

    1.2.1.6:
        * Fixed bug when someone connects and two alive players left and have not accepted knifefight yet.
          Knife fight has to be canceled.
     
    1.2.1.5:
        + Added removing weapons from entire the map on knife fight start.
          It is useful for players that have cl_autowepswitch set to 1.

    1.2.1.4:
        + Added colored hint text to show winner.
        * Fixed don't kill everyone on round restart.
        * Fixed stupid bug :) (previous version can not load at all!!!)
       
    1.2.1.3:
        * Fixed on item pick up do not give knife and do not remove knife and just remove picked up weapon.
        * Fixes bug.
            L 05/26/2009 - 15:57:20: [SM] Native "ForcePlayerSuicide" reported: Client 13 is not in game
            L 05/26/2009 - 15:57:20: [SM] Displaying call stack trace for plugin "knifefight.smx":
            L 05/26/2009 - 15:57:20: [SM]  [0]  Line 608, knifefight.sp::KillPlayer()
        * Fixed don't drop knifes on map.
        * If sv_alltalk is already turned on then at the end of the fight it should't be turned off.
   
    1.2.1.2:
        * Bug fix for:
            L 05/23/2009 - 02:18:17: [SM] Native "IsPlayerAlive" reported: Client 9 is not in game
            L 05/23/2009 - 02:18:17: [SM] Displaying call stack trace for plugin "knifefight.smx":
            L 05/23/2009 - 02:18:17: [SM]  [0]  Line 921, knifefight.sp::VerifyConditions()
           
    1.2.1.1:
        * Bug fix for:
            L 05/11/2009 - 17:58:26: [SM] Native "IsPlayerAlive" reported: Client 5 is not in game
            L 05/11/2009 - 17:58:26: [SM] Displaying call stack trace for plugin "knifefight.smx":
            L 05/11/2009 - 17:58:26: [SM]  [0]  Line 1092, knifefight.sp::PanelHandler()
        * When knifefight time is over check players health and kill only player with minimun health
          or both if players has equal health.
        + added sm_knifefight_beaconradius - radius of the beacon
        + added sm_knifefight_beaconsound - sound file for the beacon
        * changed beacon effect (g_beamsprite), now it just like in knifep3n (materials/sprites/lgtning.vmt)
        * start beacon sounds in different moments for players
        + sm_knifefight_alltalk - enable alltalk when knifefight is started
        + sm_knifefight_randomkill - random players kill sequence if knife fight time ended.
          Usefull for gungame beacause only first killed player lost level.
        * Redesigned menu panel.
        * Commented hookusermessage due to bug (server crash on plugin unload)
          So intermission check is disabled.
         
    1.2.1:
        * This is original version of 1v1 Knife Fight by XARIUS.


TODO

----
* Enable HookUserMessage after fix for https://bugs.alliedmods.net/show_bug.cgi?id=3817

Translations
----
German transation - https://forums.alliedmods.net/showpo...&postcount=212

3D-parties
----
KnifeFight with ThrowingKnives support: https://forums.alliedmods.net/showpo...&postcount=276

My plugins | Donations via PayPal

exvel 06-12-2009 18:00

Re: SM KnifeFight
 
Nice one. :)
Quote:

TODO
----
* Remove delay on weapon strip when pick up.
AFAIk this can be done with Hacks extension. Just return 0 in hooked WeaponCanUse function.

altex 06-12-2009 18:05

Re: SM KnifeFight
 
Quote:

Originally Posted by exvel (Post 847539)
AFAIk this can be done with Hacks extension. Just return 0 in hooked WeaponCanUse function.

Actualy the issue is in
Code:

CreateTimer(0.1, DelayWeapon, pack); // Prevent crashes with Gungame4 Turbo
:)

Actualy this issue is fixed by new pick item function. In previous version on item pick up player was dropping knife and got new one, so he was not able to attack for about 0.1-0.2 seconds, so this was a big problem. In new item pick up function it just did not drop knife and still can continue to attack.

altex 06-12-2009 23:02

Re: SM KnifeFight
 
Release 1.2.1.4:
+ Added colored hint text to show winner.
* Fixed don't kill everyone on round restart.
* Fixed stupid bug :) (previous version can not load at all!!!)

shustas 06-13-2009 07:28

Re: SM KnifeFight
 
There is exactly the same plugin already

altex 06-13-2009 09:29

Re: SM KnifeFight
 
Quote:

Originally Posted by shustas (Post 847877)
There is exactly the same plugin already

I don't think so.

shustas 06-13-2009 10:30

Re: SM KnifeFight
 
Man, you even said that in your credits:
* Thanks to XARIUS for 1v1 Knife Fight plugin till version 1.2.1
http://forums.alliedmods.net/showthread.php?t=77948

So I guess you just fix some minor problems in that plugin and thats all.
Why claim it yours then? You could post that in that plugin forum and thats it...
You even copied the same intro from that plugin

altex 06-13-2009 11:04

Re: SM KnifeFight
 
1 Attachment(s)
Quote:

Originally Posted by shustas (Post 847985)
So I guess you just fix some minor problems in that plugin and thats all.
Why claim it yours then? You could post that in that plugin forum and thats it...

1) First of all XARIUS was there more than one month ago (Last Activity: 10th May 2009). Last plugin update was 17th Oct 2008. My first plugin update that i posted to his topic was 10th May 2009.

2) Second of all lets see some satistics. Original plugin source size is 31 Kb (after my changes it is now 46 Kb), my diff size is 30 Kb (attached), do you realy think it is just "fixing minor problems"? Original 1.2.1 version has 1132 lines, i have added 416 lines, 57 lines was deleted. Original dalto's plugin has 456 lines.

3) Third of all we have different beacons. I do not know what do XARIUS think about it, may be my changes is not what he wanted to implement. And if so - i need only to start new branch of this plugin.

4) Forth of all i did not claim any rights, ITS GPL (isn't it?).

5) Fifth of all i did not claim any rights, because of
Code:

    author = "XARiUS, Otstrel.Ru Team",
    url = "http://www.the-otc.com/, http://otstrel.ru"

6) Sixth of all and it is the main reason - lets XARIUS do make desicion by himself about my changes. If he will add all of them to trunk, than i will agree with you - second plugin is not needed at all. If he will not - than it is a diffent branch of his plugin.

7) Seventh of all people do not like to get through 18 pages to get latest version. Most people like to find latest version of plugin on the first page.

Quote:

You even copied the same intro from that plugin
Does GPL licence deny that? :shock:

PStar 06-13-2009 12:22

Re: SM KnifeFight
 
I agrre with altex at least he is keeping popular plugins up to date, and this is what only counts.

It not only a copy-paste of the base plugin and he even gave creadits to the original authors.

Xp3r7 06-13-2009 22:01

Re: SM KnifeFight
 
The weapon pickup bug still happens.

I have the latest version on a couple of my servers and when you run over a gun thats laying on the ground during the fight, you still act like your picking it up and lose your knife all together for a sec or 2.

btw altex - keep up the good work on updating these plugins!

Good job!


All times are GMT -4. The time now is 09:21.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.