[TF2] ShapeShift (v1.5.5, 2016-7-14)
Note: This plugin uses tf/cfg/sourcemod/plugin.shapeshift.cfg - Edit this to edit permanent settings.
This adds the ability for players (or admins) to 'shapeshift'
into other classes outside of spawn.
I think this could be really fun on some servers. I have had this for years under another name (Omni-Change.) I am releasing it now.
Imagine playing as a scout, but your teammates' medic died. Switch to a medic. Or playing as a demoman, and your friend engie died with his buildings near death. Switch to engineer and heal em.
Of course, i've added things that should make this balanced, such as:
FEATURES
- CHANGE CLASS VIA TF2'S CLASS MENU! No binds/commands necessary (outside of arena mode)
- Ability to disable shapeshifting to and from certain classes.
- sm_shapeshift/shape commands for switching in Arena (class menu not possible)
- Usage Punishments (stuns)
- Cooldown timer
- Ammo / Health scaling
- Optional Sound + Effects (default)
- Custom (OPTIONAL) sounds, by default uses sound that don't need custom DL
- "Negative" condition preservation (such as Jarate, Fire, Mad Milk, & more)
- Optional clip regeneration (you keep ammo, but regenerate clip. Otherwise clip is set to 1 -- zero bugs certain weaps)
- Admin-Only (Or donator) option. Override access with sm_shapeshift_access. Default ADMFLAG_CHEATS
- sm_shapeshift_force command, to force a client's class
- Does not activate in Respawn Rooms
- Shapeshifting to engineer does not give you metal (otherwise was annoying)
- Admin-set Class locking until player disconnects "Permanent Shapeshift"
COMMANDS
Admin commands have the default of ADMFLAG_CHEATS access.
When setting sm_shapeshift_adminonly to 1, override access with sm_shapeshift_access in your overrides cfg. - ADMIN: sm_shapeshift_force <clients> <target class name>
- ADMIN: sm_shapeshift_lock <client> <target class name, or None to disable>
- sm_shapeshift <target class name> - Useful for Arena
- shape <target class name> - Useful for Arena
- joinclass <target class name> -- Just use the Class Menu instead.
CONVARS
- sm_shapeshift_version
- sm_shapeshift_enabled - Default 1
- sm_shapeshift_cooldown - Default 30, in seconds
- sm_shapeshift_adminonly - Default 0. Override sm_shapeshift_access to set flags.
- sm_shapeshift_tag - Default 0 - For server tags, default doesn't add 'shapeshift.'
- sm_shapeshift_effects - Default 1 - Enables/disables sound+graphic effects
- sm_shapeshift_sound - The shapeshift sound *file* played when effects are enabled, for example "npc/ichthyosaur/water_growl5.wav"
- sm_shapeshift_displayready - Default 1 - 0 = disable, 1 = Hint Text, 2 = Chat Text, 3 = like sm_csay
- sm_shapeshift_allowregen - Default 0 - Allows switching to same class or the command "joinclass regen"
- sm_shapeshift_newclip - Default 0 - Allows ammo clip (not reserve) to be regenerated. Otherwise clip is set to 1 (technical reasons)
- sm_shapeshift_punishmode - Default 0 - 0: No punishment 1: Silent Bonk Stun 2: Slowdown, disable forward/backward 3: Big Bonk + Sound 4: Thirdperson 5: Loser state (like round end losers)
- sm_shapeshift_punishtime - Default 6, in seconds
- sm_shapeshift_disable_fromclass - Default "" - A comma separated list of classes to disable shapeshifting from. For example "medic,scout" will disable shapeshifting (changing out of spawnroom) while a medic or scout.
- sm_shapeshift_disable_toclass - Default "" - Same as _fromclass above, except you cannot shapeshift out of spawnrooms *to* these classes.
- sm_shapeshift_no_engie_metal - Default 0 - 0 = Engineers do not have their metal reset - 1 = they do.
NATIVES
- native Float:ShapeShift_Cooldown(client);
- native ShapeShift_ResetCooldown(client);
- native ShapeShift_Force(client, TFClassType:tfclass);
- forward Action:OnShapeShift(client, currentClass, &targetClass);
(see shapeshift_funcs.inc for details)
CHANGELOG
Update July 14th, 2016
- Recompiled (I believe this fixed issues others were having)
- Misc changes/fixes I cannot remember.
Update September 4th 2014
- Fixed a case where players would lose weapons (ShapeShifting inside a solid object such as a friendly sentry/dispenser.) The plugin simply prevents ShapeShifting in solids.
- Added a failure sound
Update August 24th 2014
- Fixed medic healing exploit
- Fixed sm_shapeshift_version from using cfg value
- Fixed plugin error msg
Update April 10th 2014
- Added forward Action:OnShapeShift(client, currentClass, &targetClass);
(see shapeshift_funcs.inc for details)
Allows plugins to control whether or not a user may initiate ShapeShift.
Update Jan 2nd 2014
- Fixed bonk bug/exploit
Update Jan 2nd 2014
- Added force, cooldown natives, by request
Update Dec 29th 2013:
- Added sm_shapeshift_no_engie_metal, default 0
Update Dec 23rd 2013:
- Fixed the breaking of attachment points
Update Oct 5th 2013:
- Added class menu support for Arena game mode, via command !shape/!sm_shapeshift
Update July 23rd 2013:
- Fixed a respawn timer bypass exploit
2013-02-07
- Released v1.0. v1.0 'cause I think it no longer has any major, noticable problems.
- Fixed a weapon regeneration bug. If the client had FL_NOTARGET applied, the client wouldn't get weapons on regeneration.
- sm_shapeshift_tag is now 0 by default.
- Added cvar sm_shapeshift_version
2013-02-02 -- This is to mostly fix a health exploit, but added a cmd a friend requested
- Released v0.3
- Fix health exploit. An oversight on my part. Your health would scale up even if you weren't full health. Now your health ONLY scales up if you're atleast full health.
- Added ability to lock players into a certain class
- Admin cmds now use ShowActivity2
2013-02-02
- Released v0.2
- Added To/From class limitations
- Added _force command
- Addd force switch weaps to fix rare civi bug
- Fixed handle leak
- Added sm_shapeshift and 'shape' commands/binds for Arena mode
2013-02-01
- Released v0.1
REQUIRES: SDKHOOKS