View Single Post
Author Message
Jindo
AlliedModders Donor
Join Date: May 2009
Location: England, UK
Old 10-05-2009 , 17:34   [TF2] It's Raining Men 0.1 (07/10)
Reply With Quote #1

It's Raining Men v0.1

Description: This plugin spawns ragdolls of random classes and teams at a height/distance defined by cvars, their spawning location is relative to a live player.

Screenshots:




---

Usage:

sm_rainmen: <optional target> - Activates Raining Men, if a target is not specified, the person running the command is used. (Use of @red/@blue/@all is highly discouraged if you want a nice and smooth running server), but just incase:

sm_rm_panic: - Removes all ragdolls and disables the plugin for 5 seconds.

sm_rm_stop: - Stops spawning ragdolls but doesn't remove previously spawned ragdolls.

Both of these commands require the ROOT admin flag, if there is a preference I'm happy to change it.

CVars: (Default settings should be safe (no insane lagging/crashes))

rainingmen_version: 0.1 - Current version of the plugin.
sm_rainmen_enable: 1 - Enable/Disable the plugin (1 = Enabled, 0 = Disabled)
rm_message_enable: 1 - Enable/Disable the "It's Raining Men" message
sm_rainmen_radius: 100.0 - Distance around the target to spawn ragdolls
sm_rainmen_height: 500.0 - Distance above the target to spawn ragdolls
sm_rainmen_frequency: 1 - Ragdolls to spawn per second (Anything higher than 10 is highly discouraged, higher than 5 discouraged on busy servers)
sm_rainmen_burn: 2 - Spawn burning ragdolls (0 = off, 1 = on, 2+ = random)
sm_rainmen_elec: 0 - Spawn electrocuted ragdolls (0 = off, 1 = on, 2+ = random)
sm_rainmen_remove: 6.0 - Time after a ragdoll has spawned in which it is removed.

So that above config:

Code:
sm_rainmen_enable    1
rm_message_enable 1
sm_rainmen_radius    100.0
sm_rainmen_height    500.0
sm_rainmen_frequency    1
sm_rainmen_burn        2
sm_rainmen_elec        0
sm_rainmen_remove    6.0
Should be safe on any server without lag issues. I managed to get as far as having a frequency of 20 without lag on an empty server, but on a full server it is not recommended.

If you do manage to lag your server to the point that it may crash (due to a high frequency setting most likely), you can use the aforementioned sm_rm_panic to kill the plugin temporarily and restore order.

The plugin can be used to have a trail of ragdolls following a player, or fall around them, or fall all over the place.

Code:
sm_rainmen_radius    2500.0
sm_rainmen_height    500.0
The above config would spawn ragdolls pretty much anywhere near to the player (feel free to increase the radius). You could also define the height and radius in map-specific configs to prevent ragdolls getting stuck in the ceilings on certain maps.

If I made this right, the plugin should auto-created a config containing the default values titled 'plugin.rainingmen.cfg' found in your cfg/sourcemod folder.

---

Version History:

  • Public release


TO DO:

  • Allow for control over the ragdolls' class/team skins
  • Tidy the code where necessary (if necessary)
  • Perhaps put a video together of it
  • Attach a default config
  • Add an additional argument to the sm_rainmen command to specify the duration of 'human precipitation' (where no argument = permanant until death).


---

I believe that's everything, enjoy the plugin, if there are any huge issues with it, I will attempt to correct them when I can (and of course if there is any thing I'm doing wrong in terms of general SourcePawn scripting, feel free to correct me!)

(The plugin has been tested and worked successfully on a Linux server running a 1.3 build, and a Windows server running a 1.2.4 build of Sourcemod)

Have fun!
Attached Files
File Type: sp Get Plugin or Get Source (rainingmen.sp - 3722 views - 5.3 KB)
__________________

Last edited by Jindo; 12-13-2009 at 10:09.
Jindo is offline