This plugin allows users to become invulnerable to damage, while at the same time being unable to damage other players. Useful for certain servers where PvP is something that some players don't want to partake in.
Command is simply sm_friendly to enter and exit Friendly mode.
Friendly mode does the following:
- Makes friendly players unable to use their weapons to damage any other player.
- Gives friendly players buddha mode
- Makes friendly players invisible to sentries, immune to airblasts, etc.
- sm_friendly_nowait 1 - When enabled a player who leaves Friendly mode will instantly be able to attack other players, and be attacked. When 0, he will have to wait until his next respawn, and sm_friendly_slap will have no function.
- sm_friendly_remember 0 - When enabled, a Friendly player who dies will remain Friendly upon respawning.
- sm_friendly_slap 99999 - When a player attempts to leave Friendly mode and become hostile, he will be slapped for this amount of damage. Used to prevent abuse of this command. Set to 0 to disable. No function if sm_friendly_nowait is 0.
- sm_friendly_killsentry 1 - When enabled, a friendly Engineer will run the command "destroy 2" upon becoming hostile. This should destroy his sentry.
- sm_friendly_blockweps 0 - When enabled, players will be prohibited from using certain weapons.
- tf_weapon_flamethrower (prevent airblasting non friendlies)
- tf_weapon_medigun (prevent healing non friendlies)
- tf_weapon_builder (prevent buliding stuff/sappers)
- tf_weapon_bonesaw (prevent performing ubersaw taunt on non friendlies)
- tf_weapon_compound_bow (prevent performing huntsman taunt on non friendlies)
- tf_weapon_bat_wood (prevent using sandman ball on non friendlies)
- tf_weapon_jar (prevent throwing piss on non friendlies)
- tf_weapon_jar_milk (prevent throwing milk on non friendlies)
- tf_weapon_fireaxe (prevent destroying sappers(homewrecker))
- tf_weapon_lunchbox (prevent healing non friendlies)
- tf_weapon_crossbow (prevent healing non friendlies)
- 2012-09-06 - Original version posted by Dyl0n
- 2013-04-10 - Modifications posted by Wazman
- 2013-04-10 - First set of modifications posted by me
- 2013-04-11 - Second set of modifications posted by me, first edition of this new thread
Plugin reqires SDKHooks. As such, it does not yet compile here on the forums. Ensure that SDKHooks is installed (it is apparently bundled with snapshots of SourceMod 1.5), and place the attached SMX in your plugins folder.
You must reload the map upon installation or updating.
I am mostly using this plugin as a way to learn this stuff. As such, modifications and updates will come slowly, unless I have assistance. That being said, I hope to one day include:
- A way to make Friendly players visibly distinguishable from non-friendly players.
- A way to edit what weapons are blocked by sm_friendly_blockweps, without having to edit the source code of the plugin.
- A way to easily add other sources of damage that can be blocked or whitelisted. (Such as damage from the world, bosses, RTD effects, Goomba Stomp, etc.)
- A way to make the error log spam go away. I don't yet know a thing about SDKHooks, and don't exactly know how to implement the solution shown here.
- A way to limit the amount of time a Friendly player can continuously stay Friendly, and ConVar to set exactly how long that limit should be.
- A way for admins to force the command on other players without needing plugins like Fake And Force.
- sm_friendly 1 will enable friendly mode, and sm_friendly 0 will disable it.
- Extreme error log spam. Iunno.
- The feature of "stopping damage done to [engineer] buildings" does not function anymore.
Wyświetl pełny artykuł