PDA

View Full Version : KnifeSyphon


bl4nk
08-13-2007, 21:44
KnifeSyphon

Gives players a health boost when they make a knife kill.

CVars:


sm_knifesyphon_enable - Enables\Disables the KnifeSyphon plugin.

0 = off
1 = on (default)



sm_knifesyphon_announce - Enables\Disables announcing of the plugin at the beginning of the round.

0 = off
1 = on (default)


sm_knifesyphon_life - Amount of life to give to the killer.

Ranges from 0 to 100. (default = 25)




Notes:

This mod currently supports the following mods:

Counter-Strike: Source
Day of Defeat: Source
Half-Life 2: Deathmatch
Any mod that uses knife as it's melee weapon.


If sm_knifesyphon_announce is set to 1 and sm_knifesyphon_enable is set to 0, the plugin will not announce.

Thanks to:

1695 for requesting the plugin.
pRED* | NZ for help with fixing my translation problems.
FlyingMongoose for writing the KnifeMug plugin.
blue zebra for de/hu translations
noPASARAN for ru translations

Changelog:

1.0

Initial Release


1.1

Added support for other mods that use 'knife' as a weapon.
Shortened the length of the announcement.


1.2

Added weapon support for DOD:S and HL2:MP.



Added announcement support for DOD:S.


1.3

Removed unnecessary code.
Changed announcement from each round to the first time the player spawns.


1.4

Cvar changes are hooked regardless of default setting (see this post (http://forums.alliedmods.net/showthread.php?p=538601#post538601) for details).


1.5

Plugin will no longer announce if sm_knifesyphon_announce is set to 1 and sm_knifesyphon_enable is set to 0.


1.6

Fixed announcement problems.
Colorized messages.


1.7

Fixed bug where killing with any weapon netted extra HP.
Fixed bug where shooting somebody gave HP.
Made announcements work properly (without errors!)
Shortened the translations a bit (need new ones please) to fit one one line
Added TF2 support


1.8

Added support for new TF2 weapons:

The Sandman
The Axtinguisher
KGB
Ubersaw

FlyingMongoose
08-13-2007, 23:52
To make this plugin more universal throw this into it instead of CCSPlayer::m_iHealth:

stock SetClientHealth(client, amount)
{
new HPOffs = FindDataMapOffs(client,"m_iHealth");
SetEntData(client,HPOffs,amount,true);
}

Most mods use the word "knife" for their knife identification and usually identifying the weapon only requires part of the name, so "knife" will suffice throughout most mods including dods, and css

bl4nk
08-14-2007, 00:44
Good idea, FlyingMongoose.

Updated to version 1.1

dalto
08-14-2007, 00:57
If it's helpful, here is what quakesounds defines as a "knife"

CS:S
knife

DOD:S
spade
amerknife
punch

HL2:DM
stunstick
crowbar

bl4nk
08-14-2007, 02:50
Thanks for that, dalto. It seems that it wouldn't have worked very well with "knife" as the only weapon afterall (at least for those two mods).

Updated to version 1.2

1695
08-14-2007, 03:16
Woah, quick lol :P !

thx a lot !

bolinux
08-14-2007, 04:33
sm_knifesyphon_announce is set to 0 but still shown in chat!


cvarlist sm_knifesyphon_announce
cvar list
--------------
sm_knifesyphon_announce : 0 : : Enables/Disables the KnifeSyphon announcement at the beginning of the round.



btw nice plugin

bolinux
08-14-2007, 10:00
same at sm_knifesyphon_enable 0 announce is still shown in chat!

--------------
sm_knifesyphon_enable : 0 : : Enables/Disables the KnifeSyphon plugin.
--------------

^BuGs^
08-14-2007, 14:56
Update StrEqual with strcmp. StrEqual is old school checking. :)

Kaschenko
08-14-2007, 15:18
correct please
"dod_round"? :)

FlyingMongoose
08-14-2007, 15:25
don't base on round_start, base on player_spawn and then if it's been displayed to the player once don't display it again.

Kaschenko
08-14-2007, 15:34
don't base on round_start, base on player_spawn and then if it's been displayed to the player once don't display it again.
I think - I not one, who prefers job of plug-ins - without errors.

FlyingMongoose
08-21-2007, 13:01
I was telling bl4nk how to modify his plugin to work with any mod.

bl4nk
08-23-2007, 09:38
Sorry for the delay with the update all, I've been having internet troubles lately and they're coming to fix it later today. I'll see if I can get it updated for you guys by tomorrow.

bl4nk
09-21-2007, 02:15
Updated to version 1.3

Sorry for the long wait, everyone. I got my internet back about two weeks ago, but I completely forgot about this plugin. Anyways, I didn't really change much with it:

The announcement is no longer round based.
It's announced to a player the first (and only the first) time they spawn.
Removed unnecessary coding.
UntestedBesides those few things, that's about it. Notice how I said that this version was Untested. That's because back when I wrote it, I didn't have internet so I couldn't really go online to try it out. It should work perfectly fine, but if it doesn't, please report back and I'll fix it ASAP.

bl4nk
10-04-2007, 02:07
Updated to version 1.4


Changes:

If a cvar was set to '0' upon map start, and changed, the plugin would not catch the change. This was fixed.
Example of what was fixed:
sm_knifesyphon_enable is set to 0 in a .cfg file.
The map starts and someone sets sm_knifesyphon_enable to 1.
The plugin wouldn't hook the change and wouldn't work properly.

bl4nk
10-04-2007, 02:26
Updated to version 1.5

Woo, two updates in one night. I noticed something that I previously missed, so I'd fix it really quick.

I also forgot to note that back with the 1.3 update, the announcement part of the plugin should work with every mod that uses player_spawn.

Stingbyte
10-05-2007, 19:32
I really like KnifeSyphon...but I am having some problems with it.
I am using latest version of your Plugin and the latest of SourceMod too.

I can't see the Announce (cvars correctly set) and I am getting some errors in servers cmd:

L 10/06/2007 - 01:21:34: [SM] Plugin encountered error 15: Array index is out of bounds
L 10/06/2007 - 01:21:34: [SM] Debug mode is not enabled for "knifesyphon.smx"
L 10/06/2007 - 01:21:34: [SM] To enable debug mode, edit plugin_settings.cfg, or type: sm plugins debug 47 on

Greetz
Stingbyte

ferret
10-05-2007, 19:36
If you turn debug on, it will help bl4nk find the exact line that's having a problem.

Stingbyte
10-05-2007, 21:23
Thx for the info ferret.

No problem, here is the output:

L 10/06/2007 - 03:16:01: [SM] Plugin encountered error 15: Array index is out of bounds
L 10/06/2007 - 03:16:01: [SM] Displaying call stack trace for plugin "knifesyphon.smx":
L 10/06/2007 - 03:16:01: [SM] [0] Line 119, /home/groups/alliedmodders/forums/files/2/8/8/5/0/19087.attach::event_PlayerSpawn()

Additional Info: I was testing with 2 bots an myself as admin.

bl4nk
10-06-2007, 01:06
Updated to Version 1.6

Fixed announcement problems (hopefully).
Colorized messages.

Stingbyte
10-06-2007, 10:23
Tested with new version:
Following errors in output:

L 10/06/2007 - 16:21:29: [SM] Native "FindDataMapOffs" reported: Entity 8 is invalid
L 10/06/2007 - 16:21:29: [SM] Displaying call stack trace for plugin "knifesyphon.smx":
L 10/06/2007 - 16:21:29: [SM] [0] Line 105, /home/groups/alliedmodders/forums/files/2/8/8/5/0/19087.attach::event_PlayerDeath()

Announcement not displayed.
[edit]
plugin is working a bit crazy, if I shoot the bot with a weapon, i get the health bonus!
Announcement is not displayed, but healt bonus message is shown.

Greetz
Stingbyte

Isias
10-07-2007, 09:43
Added german language support

bl4nk
10-29-2007, 15:02
Updated to version 1.7
Fixed bug where killing with any weapon netted extra HP.
Fixed bug where shooting somebody gave HP.
Made announcements work properly (without errors!)
Shortened the translations a bit (need new ones please) to fit one one line
Added TF2 support** I just added in the TF2 weapon check, so it might not exactly work. I'll do a bit of testing and see how it turns out.

[edit]

Update on TF2 support:

As far as I can tell, everything works fine. The only thing I noticed is that when you get a kill and gain HP over the default max, it slowly degrades as if you overhealed.

Inflikted
02-01-2009, 11:35
this knifesyphon mod for TF2 only works for spies? or all melee weapons?

bl4nk
02-01-2009, 16:09
All melee weapons.

lsps
02-26-2009, 10:34
I am ensuring I have done this right, the cvars go in ANY cfg file, such as server.cfg? Or do I need to create a knifesyphon.cfg file and put it in the sourcemod/configs directory?

CrimsonGT
02-26-2009, 10:53
server.cfg is fine.

lsps
02-26-2009, 14:55
Thanks man, thought so.

firebone
03-23-2009, 19:04
Hello,

I put the knifesyphon.smx in the plugin folder and the knifesyphon.phrases.txt in the gamedata folder.

How can I get the plugin to load and show it in the sourcemod admin menu?

bl4nk
03-24-2009, 00:25
*.phrases.txt files go into your translation folder, not gamedata. The plugin will load properly once you do that (and change the map/restart the server). Nothing will be added to the admin menu though. You can add stuff yourself using the custom admin menu (http://wiki.alliedmods.net/Dynamic_Admin_Menu_(SourceMod)) features built into SM.

n4rc0sis
05-02-2009, 10:55
can you add a kind of timer, so that the announcement will be shown for example every 300 seconds or somethin like that

santaclaus
05-02-2009, 12:43
Hi,

Is it possible to increase the health bonus ?

For a zombie mod server , the bonus i would like would be like 300 to 500.

Thx

bl4nk
05-02-2009, 16:56
Feel free to change the source of the plugin and recompile it yourself.

The line you would want to change would be 25:
cvarLife = CreateConVar("sm_knifesyphon_life", "25", "Sets the amount of health to give to a player after they kill someone with a knife.", FCVAR_PLUGIN, true, 0.0, true, 100.0);

Change the "100.0" at the end of the line to whatever you want the maximum to be.

santaclaus
05-02-2009, 20:59
Thx.

The zombie's weapon is "zombie_claws_of_death" so i've swapped knife with it

if(strcmp(weapon, "zombie_claws_of_death") == 0)
{
return 1;
}


And i've changed another value :

decl String:weaponName[32]

I hope it would be enough.

Thx

n4rc0sis
05-08-2009, 16:20
can you add a kind of timer, so that the announcement will be shown for example every 300 seconds or somethin like that
hm?

santaclaus
05-08-2009, 20:36
hm?

You should use one of the advert plugin out there and add your sentences inside :

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

bl4nk
06-18-2009, 18:30
Updated to Version 1.8

This adds support for TF2 unlockable melee weapons.

spicytuna
12-20-2009, 13:59
I put sm_knifesyphon_announce 0 server.cfg and It's still announcing
when you join. Any way to fix this? I have to use everything default.

bl4nk
12-20-2009, 23:31
I put sm_knifesyphon_announce 0 server.cfg and It's still announcing
when you join. Any way to fix this? I have to use everything default.

Could you check your server for what the value is set to when it's happening? Also what version are you using?

NoS
06-01-2010, 02:12
Hes right, it does still announce with it set to 0. Latest version too.

bl4nk
06-01-2010, 14:09
Someone get me a full list of melee weapon names, and I'll update this plugin. I'll fix the announce error while I do that as well.

JiggyBalls
10-21-2010, 18:33
I added this onto a server and it seemed as if it conflicted with the 1v1 knife fight. Anyone else having this issue?

]LoC[DeFiaNT
03-27-2011, 15:04
Not crashing the server or anything just getting errors.

L 03/27/2011 - 13:48:04: SourceMod error session started
L 03/27/2011 - 13:48:04: Info (map "gg_khgw_shotty_v1") (file "errors_20110327.log")
L 03/27/2011 - 13:48:04: [SM] Warning(s) encountered in translation file "knifesyphon.phrases.txt"
L 03/27/2011 - 13:48:04: [SM] Ignoring translation to invalid language "#format" on line 5.
L 03/27/2011 - 13:48:04: [SM] Ignoring translation to invalid language "#format" on line 10.
L 03/27/2011 - 13:48:04: Error log file session closed.

bl4nk
03-27-2011, 15:31
Looks like it's trying to use a translation that doesn't exist in the translation file. What language is your server? Can you provide proper translations for me to update it with?

]LoC[DeFiaNT
03-27-2011, 18:47
Using english...

Maybe old version of knifesyphon?

Current settings:

// Enables\Disables the KnifeSyphon plugin.
// --
// 0 = off
// 1 = on (default)
sm_knifesyphon_enable 1

// Enables\Disables announcing of the plugin at the beginning of the round.
// 0 = off
// 1 = on (default)
sm_knifesyphon_announce 0

// Amount of life to give to the killer.
// --
// Ranges from 0 to 100. (default = 25)
sm_knifesyphon_life 25

bl4nk
03-27-2011, 18:57
Do you have the translation file in the proper place?

]LoC[DeFiaNT
03-27-2011, 21:36
/orangebox/cstrike/addons/sourcemod/translations

Correct?

bl4nk
03-27-2011, 23:55
Yes, that's right. When does it give you this error? Did you modify the translation file any?

]LoC[DeFiaNT
03-28-2011, 07:05
No mods, just download and installed. Although the knifesyphon.smx was already on the server, possible that it's older?

bl4nk
03-28-2011, 11:34
Type 'sm plugins info knifesyphon' to find the version.

]LoC[DeFiaNT
03-28-2011, 20:16
"KnifeSyphon" (1.8) by bl4nk

]LoC[DeFiaNT
03-30-2011, 15:51
LoC[DeFiaNT;1440940']"KnifeSyphon" (1.8) by bl4nk

Smiley face in the way, supposed to read 1.8 version.

blue zebra
04-09-2011, 02:33
Hi.
Here is the new phrases file in German (Isias) and Hungarian languages.
UTF-8 based txt file.
Anyone can translate this to another langs?

Update 1:
The roundsay dont work for me correctly. Only shown only in the first round.
Maybe the UTF-8 coded knifesyphon.phrases.txt is the reason?

noPASARAN
04-13-2011, 09:27
RUS:

"Phrases"
{
"Life Syphoned"
{
"#format" "{1:d},{2:s}"
"en" "You gained {1} health for killing {2} with a melee weapon."
"ru" "Вы получили {1} hp за убийство {2} ножом."
}
"Announce"
{
"#format" "{1:d}"
"en" "Killing someone with a melee weapon gives you a {1} health boost."
"ru" "Убийство ножом, дает вам {1} hp."
}
}

bl4nk
04-13-2011, 13:01
Updated the first post with the de/hu/ru translations, as well as noted you two for providing them. Thanks, guys! :)

blue zebra
04-13-2011, 15:14
bl4nk.
Ooops. The German translation is not my work. Provide that Isias in this post:

http://forums.alliedmods.net/showpost.php?p=539629&postcount=23

Thanks for him.
Please can you see why dont work the roundsay in this plugin?
The roundsay dont work for me correctly. Only shown only in the first round.
Maybe the UTF-8 coded knifesyphon.phrases.txt is the reason?
Thanks in advance.
My conditions:
Game: CSS (OB)
Linux based server
mm and sm: last snapshots

Br.

DaRk56
05-10-2011, 03:11
Bl4nk, Please you can go here I have a request about your plugin. http://forums.alliedmods.net/showthread.php?t=156640

sinblaster
05-11-2011, 04:52
just subscribing for update notification

A.Bigbud
07-16-2011, 13:42
everything seems to be working except when i kill with the knife i get no health added. i added smx file to pluggins folder and phrases file to translations folder....did i miss something?
and when i type in console any of the cvars i get an uknown command response

A.Bigbud
07-16-2011, 13:43
did i miss something when installing? i added the smx to pluggins folder and phrases to translations folder.

Corneus
07-20-2012, 11:21
Could You add admin flag convar, that plugin works only for players with custom flag

Disco Stu
07-28-2012, 06:21
*edit* nvm figured it out. Sorry. You can delete this post.

apothegm
08-24-2012, 03:25
Possible to add CS:GO support? It says the plugin loads sucessfully and I can set convars but doesn't seem to take affect.

bl4nk
08-24-2012, 08:40
Buy me (http://steamcommunity.com/id/bl4nk) CS:GO and I'll happily update it. As of right now, I have no way to test any changes I make, so unless someone else does it, you'll have to wait for me to get the game.

apothegm
08-24-2012, 17:24
Sorry, I'm rather poor at the moment.

But good news is that I got it working with CS:GO.

I changed the bit of code towards the end of the .sp file and re-compiled. That's all that was needed. Works great!


if (strcmp(gameFolder, "cstrike") == 0 || strcmp(gameFolder, "csgo") == 0) // Counter-Strike: Source or Counter-Strike: Global Offensive
{
if(strcmp(weapon, "knife") == 0 || strcmp(weapon, "knifegg") == 0)
{
return 1;
}
}


-OR- Here is FlyingMongoose's version to account for any added weapons with knife in their name:


if (strcmp(gameFolder, "cstrike") == 0 || strcmp(gameFolder,"csgo") == 0) // Counter-Strike: Source or csgo
{
if(StrContains(weapon, "knife", false) != -1)
{
return 1;
}
}

Nirvana59
08-31-2012, 07:05
It's possible to upload the .sp file please?

Warbucks
08-31-2012, 09:16
It's possible to upload the .sp file please?

Here you go.

Avo
09-24-2012, 13:43
I added support of CS:GO, with taser configurable (=> version 1.9b)

htcarnage
10-24-2012, 21:58
Is it possible to cap the health to 100, so that players can only knife to regenerate health, but not to surpass 100.

*edit: perhaps add a cvar sm_knifesyphon_limit XXX where XXX is the max health a player can have?

Kathle55en
10-24-2012, 23:59
Update StrEqual with strcmp.
http://www.rdox.info/01.jpghttp://www.rdox.info/02.jpghttp://www.rdox.info/8.jpghttp://www.rdox.info/04.jpg
http://www.rdox.info/9.jpghttp://www.rdox.info/0.jpg

Blakes7
12-05-2012, 15:32
Great work!! Capping the Health at 100 Hit Points would be a fantastic addition keeping with the rest of the game ;)

apothegm
08-19-2013, 20:41
Anyone else having issues with this problem after the recent cs:go update? I thought it was, but now I don't see any health gains. I think it started happening after I updated to new gungame version. Hm.

shalnath
09-14-2013, 23:19
Anyone else having issues with this problem after the recent cs:go update? I thought it was, but now I don't see any health gains. I think it started happening after I updated to new gungame version. Hm.
It doesn't appear to be working at all for me either in classic competitive CS:GO. Has anyone been able to get this to work?

shalnath
09-18-2013, 08:49
Looks like I got it working thanks to FlyingMongoose's code here:

Here is FlyingMongoose's version to account for any added weapons with knife in their name:


if (strcmp(gameFolder, "cstrike") == 0 || strcmp(gameFolder,"csgo") == 0) // Counter-Strike: Source or csgo
{
if(StrContains(weapon, "knife", false) != -1)
{
return 1;
}
}

SC]-[LONG_{HoF}
11-30-2014, 02:58
I see a few different versions of this plugin but which one actually works with CSGO.


Edit: Fixed with the FlyingMongoose code.

utaker
02-23-2015, 08:52
csgo errors for fluyingmoongoos edition

SourcePawn Compiler 1.6.4-dev+4618
Copyright (c) 1997-2006, ITB CompuPhase, (C)2004-2008 AlliedModders, LLC
knifesyphon.sp(38) : error 017: undefined symbol "cvarTaser"
1 Error.

Raggdoll
01-08-2017, 00:30
Bump for a CS:GO fix please.

slap
10-04-2017, 19:16
the cvars do not work, I have this issue with many of the addons I have. am I supposed to add them somewhere? I am running a source server currently.

slap
10-04-2017, 19:17
the addon works, but I cannot seem to be able to change the syphon amount in console or rcon. I will try to change the config.

slap
10-04-2017, 19:20
yeah, I cannot find the cfg. it isnt in the cstrike/cfg or cstrike/cfg/sourcemod. it also isnt in cstrike/addons/sourcemod.

slap
10-12-2017, 03:10
yeah, I am unable to change amount of syphon.

Mitchell
10-12-2017, 10:50
This plugin doesn't actually auto create the cfg file, you'll have to set the convars inside the server.cfg or sourcemod.cfg folder.