Raised This Month: $12 Target: $400
 3% 

Death Smoke Effect


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   Counter-Strike        Category:   Fun Stuff       
Pastout
Senior Member
Join Date: Dec 2010
Location: 1337 Street LeetTown
Old 01-26-2011 , 14:48   Death Smoke Effect
Reply With Quote #1

Death Smoke Effect
.: v1.0
Description

This plugin allows you to add a Smoke Effect when a player dies. This can be used on any mod, but its really cool for zombie mod. There are cvars to control if you want sound or how big you want the smoke affect to be or just to enable or disable the plugin its self.

CVars

  • deathsmoke_enable - Self explanatory.
    • Default: 1
      • ( 0=disabled || 1=enabled )
  • deathsmoke_size - You can change the size of the smoke Effect.
    • Default: 50
      • ( 20=small || 100=big )
  • deathsmoke_sound - Turns on and off sound.
    • Default: 1
      • ( 0=disabled || 1=enabled )
  • deathsmoke_color - Changes The color of the smoke depending on the CVar setting.
    • Default: 1
      • ( 0=Black || 1=Victims Teamcolor || 2=red || 3=blue || 4=random || 5=killers Teamcolor )
  • deathsmoke_team - Allow any teams or a team.
    • Default: 1
      • ( 1=T || 2=CT || 3=EVERYONE )
  • deathsmoke_adminsonly - Allow only admins can have this effect.
    • Default: 0
      • ( 0=AnyPlayer || 1=Admins only )
  • deathsmoke_time - How long the smoke stays before it goes away.
    • Default: 15
      • ( 1=Fast || 15=Slow )
Modules
  • Fakemeta
  • Cstrike
  • Engine
ScreenShot
[IMG]http://img97.**************/img97/7523/11954619.png[/IMG]




ChangeLog
  • 0.1
    • Initial release
  • 0.2
    • Added Color smoke
    • Added More CVars
  • 0.3
    • Optimized Code
    • Added Random Color
  • 0.4
    • Optimized Even More Thanks to ConnorMcLeod
    • Change the CVar Values for deathsmoke_team
  • 0.5
    • Small Changes to the code
  • 0.6
    • Added a new Value to deathsmoke_color
      • Killer Color
  • 0.7
    • Added New removal of color smoke Credit to ConnorMcLeod
  • 0.8
    • Added Black smoke again deathsmoke_color 0 Enables it
  • 0.9
    • Updated code
  • 1.0
    • Updated! Fix Run time error
  • #.#
    • Coming Soon Damage Death smoke Effect
      • Depending on the reviews on this
Notes
  • Just a side Note: steam1.spr is the same file as default valve/sprites/ one
Todo
Damage Death smoke Effect
Attached Files
File Type: zip sprites.zip (7.4 KB, 357 views)
File Type: sma Get Plugin or Get Source (DeathSmokeEffect_v10.sma - 1012 views - 7.6 KB)

Last edited by Pastout; 02-02-2011 at 20:54.
Pastout is offline
reinert
Veteran Member
Join Date: Feb 2007
Old 01-26-2011 , 16:45   Re: Death Smoke Effect
Reply With Quote #2

Well, that looks pretty cool, How much was deathsmoke_size when you took screen, It looks pretty big and not so awesome ;D
reinert is offline
Pastout
Senior Member
Join Date: Dec 2010
Location: 1337 Street LeetTown
Old 01-26-2011 , 16:59   Re: Death Smoke Effect
Reply With Quote #3

It was at 100 which is default, but you can certainly change that a lower value
Pastout is offline
ANTICHRISTUS
kingdom of weird stuff
Join Date: Jun 2010
Location: My kingdom is not in thi
Old 01-26-2011 , 17:27   Re: Death Smoke Effect
Reply With Quote #4

very nice, it reminded me this: https://forums.alliedmods.net/showthread.php?t=5709
__________________
ANTICHRISTUS is offline
Pastout
Senior Member
Join Date: Dec 2010
Location: 1337 Street LeetTown
Old 01-26-2011 , 22:34   Re: Death Smoke Effect
Reply With Quote #5

Updated:
v0.2
Added more stuff to it 100 time better Yeaa!
Pastout is offline
nikhilgupta345
Veteran Member
Join Date: Aug 2009
Location: Virginia
Old 01-26-2011 , 22:50   Re: Death Smoke Effect
Reply With Quote #6

Suggestions:

-Clarify some of the cvars more (the adminsonly one and the teams one also). Does that mean that only admins see the effect when they kill somebody else? Or does that mean that other people see the effect when the admins die? WOuld be very helpful if clarified

-Why are you using set_cvar_string( "Smoke_Death", VERSION ), when you already register the cvar to be VERSION?

-Don't get the values of the pcvars in the plugin_init, so that server owner's/admins with CVAR flag can change it mid-game.

-In the DeathMsg, when checking the teams, use a switch statement instead of 3 ifs for both g_iSpriteColor AND for g_iSpriteTeam. Also use switch to check g_iSpriteTeam.
__________________
Quote:
Originally Posted by DarkGod View Post
nikhilgupta generates his plugins using sheer awesome.
If you like my work, please

Last edited by nikhilgupta345; 01-26-2011 at 22:58.
nikhilgupta345 is offline
Send a message via ICQ to nikhilgupta345 Send a message via Yahoo to nikhilgupta345
Pastout
Senior Member
Join Date: Dec 2010
Location: 1337 Street LeetTown
Old 01-26-2011 , 23:32   Re: Death Smoke Effect
Reply With Quote #7

Quote:
Originally Posted by nikhilgupta345 View Post
Suggestions:

-Clarify some of the cvars more (the adminsonly one and the teams one also). Does that mean that only admins see the effect when they kill somebody else? Or does that mean that other people see the effect when the admins die? WOuld be very helpful if clarified

-Why are you using set_cvar_string( "Smoke_Death", VERSION ), when you already register the cvar to be VERSION?

-Don't get the values of the pcvars in the plugin_init, so that server owner's/admins with CVAR flag can change it mid-game.

-In the DeathMsg, when checking the teams, use a switch statement instead of 3 ifs for both g_iSpriteColor AND for g_iSpriteTeam. Also use switch to check g_iSpriteTeam.
deathsmoke_adminsonly 1
Everyone can still see it, but only admins would have this effect on them when they die....
deathsmoke_adminsonly 0
Everyone has this effect on them when they die...

As For the cvars i left it like that so it wouldn't change the game play that intill map change....

For the deathmsg event i put switches instead...

I hope this help you answer your question on all of this...
Pastout is offline
nikhilgupta345
Veteran Member
Join Date: Aug 2009
Location: Virginia
Old 01-26-2011 , 23:44   Re: Death Smoke Effect
Reply With Quote #8

Oh, I don't think you uploaded the fixed version yet, but also in UTIL_SMOKE or w/e the function is called, you should REALLY use a switch there instead of 4 if statements. Also, FYI, when you are checking different things like checking what number a num is. instead of:

if( num == 0 )
if( num == 1 )

You could either do:
switch( num )
{
case 0:
case 1:
}

OR

if( num == 0 )
else if( num == 1 )

put the else there so that if one of them is true, it skips the other checks.

The switch is more efficient, but if you're checking that for strings for instance, you should use the if/else if combination.
__________________
Quote:
Originally Posted by DarkGod View Post
nikhilgupta generates his plugins using sheer awesome.
If you like my work, please
nikhilgupta345 is offline
Send a message via ICQ to nikhilgupta345 Send a message via Yahoo to nikhilgupta345
Pastout
Senior Member
Join Date: Dec 2010
Location: 1337 Street LeetTown
Old 01-27-2011 , 00:33   Re: Death Smoke Effect
Reply With Quote #9

Updated Optimizing the Code a bit.
Added Cvars now load on round start instead of map change...
Pastout is offline
nikhilgupta345
Veteran Member
Join Date: Aug 2009
Location: Virginia
Old 01-27-2011 , 00:44   Re: Death Smoke Effect
Reply With Quote #10

Why are you using cs_get_user_team in teh deathmsg after you already set it to variable 'Team'? You can just use 'Team' now instead of cs_get_user_team.
BTW: Im talking about the switch( g_iSpriteTeam )
__________________
Quote:
Originally Posted by DarkGod View Post
nikhilgupta generates his plugins using sheer awesome.
If you like my work, please
nikhilgupta345 is offline
Send a message via ICQ to nikhilgupta345 Send a message via Yahoo to nikhilgupta345
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 07:18.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode