Thread: KnifeFight
View Single Post
Author Message
altex
Veteran Member
Join Date: May 2009
Location: Russia
Old 06-12-2009 , 17:55   KnifeFight
Reply With Quote #1

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
Attached Files
File Type: zip sm_knifefight-1.3.8.zip (52.1 KB, 16864 views)
__________________

Last edited by altex; 04-18-2012 at 10:49. Reason: Release 1.3.8
altex is offline