[TF2] Dodge & Resist
4 Attachment(s)
TF2 Dodge & Resist (Requires SDKhooks!)
Thanks to L.Duke for his particles via tempents thread and [AAA]Thrawn for the updated list of effects in this post Description: Set dodge chance and/or damage resistance of a target(s), specific classes, or all players Cvars(default values shown): sm_dodgeresist_version "1.1.6" sm_dodgeresist_chat "1" - Enable/Disable (1/0) Showing dodge/resist changes in chat sm_dodgeresist_log "1" - Enable/Disable (1/0) Logging of dodge/resist changes IMPORTANT: Class specific cvars override base dodge/resist for that class For both dodge and resistance priority order is Admin Command>Class Cvar>Base Cvar All following cvars are limited from 0-100(Just like the admin commands) sm_basedodge "0" - Set the default dodge chance for all players sm_baseresist "0" - Set the default damage resistance for all players sm_scoutdodge "0" - Set dodge chance of all scouts sm_scoutresist "0" - Set damage resistance of all scouts sm_soldierdodge "0" - Same as sbove,but for soldier sm_soldierresist "0" - Same as above, but for soldier sm_pyrododge "0" - Yeah, still the same, but for pyro sm_pyroresist "0" - Still the same, blah blah sm_demomandodge "0" - See the pattern yet? sm_demomanresist "0" sm_heavydodge "0" sm_heavyresist "0" sm_engineerdodge "0" sm_engineerresist "0" sm_medicdodge "0" sm_medicresist "0" sm_sniperdodge "0" sm_sniperresist "0" sm_spydodge "0" sm_spyresist "0" Commands: sm_dodge <target> <0-100> - Set dodge chance of a target(s), use -1 to reset to default- Default Slay Flag Will show "Miss" text when an attack misses sm_resist <target> <0-100> - Set damage resistance of a target(s), use -1 to reset to default -Default Slay Flag Examples: sm_dodge Thetarget 50 - 50% of attacks will miss Thetarget sm_resist Thetarget 75 - Attacks that hit Thetarget will only do 25% damage sm_dodge @me 100 - All attacks will miss you sm_resist @me 100 - Attacks that hit will not damage you sm_dodge @bots 75 - Bots will dodge 75% of attacks sm_resist @humans 100 - players won't take damage sm_dodge @red 25 - Red team will dodge 25% of attacks sm_resist @blue - Blue team will take 75% damage sm_dodge @all 10 - everyone will dodge 10% of attacks sm_dodge @all -1 - reset everyones dodge chance to default sm_resist @all -1 - reset everyones damage resistance to default Changelog: Code:
Version 1.0.0 - December 5, 2010 Allow resistance values above 100 that heal the target hit, and values below 0 to increase the damage done to the target Will probably need to move resetting to an admin command instead of -1 on sm_resist, or maybe strcmp to allow something like sm_resist @all reset List of things I'm not adding: Admin Menu Integration I tried this out on my Set Class Plugin(for practice), and it ended up using more code than the actual plugin. Use the Custom Admin Menu, it's muuuuuuch easier. :) Allow the cvars for base dodge/resistance and classes to be admin only That's what the admin commands are for! Besides, it's open source. If you want it that badly noone is stopping you from coding it in for your server. :wink: |
Re: [TF2] Dodge & Resist
" TF2only()
CreateConVar("sm_dodgeresist_version", PLUGIN_VERSION, "Set dodge chance and/or damage resistance of a target(s)", FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_REPLICATED|FC VAR_NOTIFY);" looks like you're missing a semicolon after TF2only() ? |
Re: [TF2] Dodge & Resist
Quote:
(Or at least I've never had to do it before so I don't see why I'd need to here) If it's an error you're getting I don't know what to tell you. It's not giving me any errors when I compile it. |
Re: [TF2] Dodge & Resist
Plugin updated for an error I was getting
|
Re: [TF2] Dodge & Resist
God damn those RPG addicts.
|
Re: [TF2] Dodge & Resist
@ Tylerist
Before it can be approved, you need to load the common phrases translation file on plugin start or there will be errors if the target cannot be found. Code:
Some less-important stuff: Consider adding lateload support for when the plugin is (re)loaded mid game (should just have to add looping through all clients at plugin start, adding the hook for those that are InGame). Another suggestion, maybe add cvars for default dodge and default resistance (maybe even per class?) Code:
Code:
Code:
I think it should be: Code:
|
Re: [TF2] Dodge & Resist
Quote:
Quote:
Quote:
Quote:
Quote:
Just to make sure, do you mean like this? PHP Code:
Unfortunately, my video card died last week, so I won't be able to test these changes for a little while, but I'll have it ready anyway. |
Re: [TF2] Dodge & Resist
Quote:
|
Re: [TF2] Dodge & Resist
1 Attachment(s)
I made some changes a bit back.
Psy, if I use MAXPLAYERS + 1 instead of MaxClients, then I'm still good, right? Also, I renamed the smx so it has no spaces (for using /rcon to load/reload it) And when a client connects/disconnects, his dodge/resist settings are set back to 0 (so a client doesn't somehow gain another previous client's stuff). |
Re: [TF2] Dodge & Resist
Quote:
Code:
stock Float:operator/(oper1, Float:oper2) |
All times are GMT -4. The time now is 22:24. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.