View Single Post
Author Message
DarthNinja
SourceMod Plugin Approver
Join Date: Mar 2009
Location: PreThinkHook()
Old 08-24-2010 , 04:28   [Any] Smoke Bomb!
Reply With Quote #1

[Any] Smoke Bomb
Version 2.1.0




Description:
Give players smoke bombs/grenades in any game!
When activated a large cloud of smoke appears around the player.
See below for settings!

Screenshots:
(Random colors): | Pic 1 | Pic 2 |

Commands:
Client:
sm_smokebomb - uses 1 smokebomb
Admin:
sm_givesmoke <client> <quantity> - sets <client>'s number of bombs to <quantity>.

Cvars:
sm_smokebomb_version -- plugin version

Settings:
sm_smokecolorhandler "1" - Changes smoke color processing, 1 = default color set in sm_smokecolor, 2 = team colors, 3 = random colors.
sm_smokecolor "255 255 255" - sets the RGB color mix of the smoke. (default color is white)
sm_smokecolor_team2 "255 0 0" - Smoke color for Team2 (default color is red)
sm_smokecolor_team3 "0 0 255" - Smoke color for Team3 (default color is blue)
sm_smoketime "8" - How long the smoke lasts in seconds.
sm_smoketrans "255" - Smoke transparency 0 to 255.
sm_smokedensity "30" - How thick/how much smoke is created.
sm_smokecarry "3" - How many smoke bombs a player can carry at a time. Returning to a resupply grants more bombs.
New! sm_smoke_helptext_handler - Sets how text is displayed, 0 = all text is shown, 1 = pickup text is hidden, 2 = pickup and use texts are hidden, 3 = pickup, use, and out of bombs texts are hidden. Text from the admin command is always shown to the player/admin.

Teams Color Cvars:
TF2 TeamIDs: Red = Team 2, Blue = Team 3 | CS:S TeamIDs: T = 2 CT = 3
Note! Team color cvars are only used if sm_smokecolorhandler is set to "2"

Install Instructions:
  1. Place SmokeBomb.smx into your addons/sourcemod/plugins/ folder.

Notes:
I used strontiumdog's Gas Plugin as an example to work from, so credit/thanks to him for that.

Disclaimer: The bombs produce very thick smoke which is somewhat expensive to render. Spamming lots of smoke in the same area will cause FPS drops, so don't use a ton of it!

You can set the smoke color to "0 0 0" and have an epic black smoke monster, although the black smoke really kills FPS for some reason.


ToDo:
  • Done! Less spammy texty (cvar)
  • Done! Don't print text if player picks up 0 bombs
  • Bomb cooldown



Version History:
  • V1.0.0
    • Initial Release
  • V1.1.0
    • Added sm_givesmoke
  • V2.0.0
    • Added more smoke options:
      • Normal: all one color; default=white
      • Team: red/blue, can be changed via cvars
      • Random: Random color for each smoke (blatantly stolen from strontiumdog's gas plugin)
    • Fixed bug with givesmoke command text printing wrong value to client
    • Added reply text to admin command
    • Fixed support for non-tf2 games (I hope).
  • V2.1.0
    • Added a cvar to change how much the plugin prints to chat
    • Fixed it printing to chat when player's "picked up" 0 bombs.
Attached Files
File Type: sp Get Plugin or Get Source (SmokeBomb.sp - 3518 views - 8.3 KB)
__________________

Last edited by DarthNinja; 10-29-2011 at 04:56.
DarthNinja is offline