AlliedModders

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

bl4nk 12-31-2007 16:02

VariableFF
 
1 Attachment(s)
VariableFF

Changes the amount of damage done by friendly fire.

Commands:

sm_variableff_amount <Amount to scale FF damage by>
sm_variableff_selfdamage <0\1>

Examples:
  • sm_variableff_amount
    • 0 = No damage (same as FF off)
    • .5 = Half damage
    • 1 = Default damage (plugin halts)
    • 2 = Double damage
  • sm_variableff_selfdamage
    • 0 = Self damage isn't scaled
    • 1 = Self damage is scaled
Notes:
  • This plugin should work with any mod. If any problems arise, don't hesitate to post them.
  • Setting the amount to 1 will halt the plugin, as that wouldn't change the damage at all.
  • The "new" damage amount is rounded to the nearest integer to avoid problems with displaying health percentages.
  • Setting the amount to 0 is exactly the same as turning FF off (minus players reacting to being shot).
  • You can't set the amount to anything below 0.
Installation:
  • Download the .zip file and extract it to your ~/addons/sourcemod folder. If asked, choose to overwrite any file that exists.
  • Check to make sure that ~/addons/sourcemod/plugins/variableff.smx exists.
  • Change the map, manually load the plugin, or restart the server to use the plugin.
Compiling/Downloading Notes:

This plugin uses the "Get Damage in TF2" extension, provided by naris. I didn't upload the .sp file directly since the webserver wouldn't be able to compile it due to missing includes. Instead, I put all of the needed files inside of the .zip for you to download. Use the .smx I provided, or compile it yourself.

Thanks to:
  • naris for the extensions.
  • EKS & teame06 for helping with my float/integer incompetance.
  • joe.to community for requesting the plugin.
Changelog:
  • 1.0.0
    • Initial release
  • 1.0.1
    • Fixed a typo that could have caused problems.
  • 1.0.2
    • Added new cvar to Enable\Disable scaling of self damage (sm_variableff_selfdamage).
    • Cleaned up the coding a bit.
  • 1.0.3
    • Fixed a problem that could cause errors when used with certain plugins.
  • 1.0.4
    • Reverted changes from 1.0.3 - they were not the problem. Instead, I added an extra check to make sure that players are in-game before the plugin checks to see if they're alive.

bl4nk 01-01-2008 17:53

Re: VariableFF
 
Updated to Version 1.0.1

bl4nk 01-15-2008 20:38

Re: VariableFF
 
Updated to Version 1.0.2

RAAP 01-16-2008 17:42

Re: VariableFF
 
Do you know if it is at all possible to make it so your own teamates do not react when you shoot them?? That would be awsome.

bl4nk 01-17-2008 12:19

Re: VariableFF
 
It might be possible, but I'm unsure of how to do it.

RAAP 01-22-2008 19:01

Re: VariableFF
 
Oh well thanks for your help anyways I really appreciate it:)

<DieSel> 01-22-2008 23:39

Re: VariableFF
 
Trying in Insurgency, I'll let you know how it does.

Apex_ 01-23-2008 23:14

Re: VariableFF
 
I'm getting some nasty debug message spam from the plugin, and it's inflating my logs like crazy.

Code:

L 01/23/2008 - 23:13:48: [SM] Native "IsPlayerAlive" reported: Client 2 is not in game
L 01/23/2008 - 23:13:49: [SM] Displaying call stack trace for plugin "variableff.smx":
L 01/23/2008 - 23:13:49: [SM]  [0]  Line 31, D:\servers\sourcemod\addons\sourcemod\scripting\include\damage.inc::SaveAllHealth()
L 01/23/2008 - 23:13:49: [SM]  [1]  Line 58, D:\servers\plugins\variableff.sp::OnGameFrame()

I'm not sure if it's the combination of mods I have or what, but I only have the base SM stuff plus the Medipacks and Ammopacks plugins installed right now. I could very well be screwing something up but I have no idea what it could be.

Thanks in advance for any help!

*Edit: I also have ATAC 2.0.0 installed, if that has any bearing on the above issue*

bl4nk 01-24-2008 00:01

Re: VariableFF
 
1 Attachment(s)
Try the version attached to my post. I made it so it only saves player's HP when they take damage, instead of saving it every game frame. That way it only updates when needed, instead of many times a second. It should work fine, but if any problems arise, please post them ASAP and I'll try to fix it. If all is well, I'll update the first post with it for others to download.

Apex_ 01-24-2008 01:09

Re: VariableFF
 
Quote:

Originally Posted by bl4nk (Post 577759)
Try the version attached to my post. I made it so it only saves player's HP when they take damage, instead of saving it every game frame. That way it only updates when needed, instead of many times a second. It should work fine, but if any problems arise, please post them ASAP and I'll try to fix it. If all is well, I'll update the first post with it for others to download.

Thanks for the quick reply! Your changes seem to have done the trick. I updated the files and reloaded the plugin, and it seems to have stopped spamming the log with messages. I made sure to cause some team damage to ensure it would trigger the plugin's features, and no log flooding occurred. That's quite a relief, keeping up with the log file's growth was a chore :wink:

Cheers, and thanks again!


All times are GMT -4. The time now is 07:22.

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