Raised This Month: $ Target: $400
 0% 

Amx_Hiteffects


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   Counter-Strike        Category:   Admin Commands       
Gadzislaw007
Senior Member
Join Date: Nov 2009
Old 08-15-2012 , 05:06   Amx_Hiteffects
Reply With Quote #1

Hello!

This is my first released plugin, so I hope I won't get smashed to the ground.
I think that there has already been similiar plugin developed, but not the same. At least, I hope.

This simple plugin adds few effects, when you get shot by someone:
• Your screen shakes a little.
• Your screen is being covered with black-red, bloodlike fade.
• You emit a random groan hitsound.

The power of shake or fade is laying on the damage you've took.

Cvars:

- amx_hitsoundchance (0-100) Default: 50 - sets the percent chance of emitting sound on hit
- amx_blinddamage (0-100) Default: 25 - sets the minimal damage you must take to make your screen be covered with bloodlike fade.
- amx_shakedamage (0-100) Default: 50 - sets the minimal damage you must take to make your screen shake

Setting amx_hitsoundchance to 0 will disable hitsounds.
Setting amx_blinddamage to 101 (or more) will disable fading.
Setting amx_shakedamage to 101 (or more) will disable screen shaking.

I posted this in Counter-Strike Addons sections. Since I never tried to do plugins for any other modifications, but I think it will work for other games too.
Attached Files
File Type: sma Get Plugin or Get Source (amx_hiteffect.sma - 676 views - 2.9 KB)
File Type: zip sound.zip (72.7 KB, 248 views)

Last edited by YamiKaitou; 08-15-2012 at 10:06.
Gadzislaw007 is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 08-15-2012 , 05:37   Re: Amx_Hiteffects
Reply With Quote #2

- you need to use cvar pointers.
- you hook TakeDamage as pre, so you can't know real damage; to know real damage, hook it as post and check dmg_take value, or hook "Damage" event.
- Blind fonction should be more explicit about blind hold time, remember 1 second is 4096 (1<<12) and max value is max unsigned short value (0xFFFF).
Also, 3rd argument of ScreenFade message is wrong, you can see my include screenfade_util for more details.
- You don't need to use floatround with damage value, just check that value against get_pcvar_float instead of get_pcvar_int (actually you used get_cvar_num but you gonna use pcvars).
- functions hitsound, twist and blind don't need to be public, also should directly be integrated in Damage function because they are not be used anywhere else.
- emit_sound code could be shortened as we discussed in the other thread.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
PyPKjE20
Member
Join Date: Dec 2010
Location: Lithuania
Old 08-15-2012 , 06:05   Re: Amx_Hiteffects
Reply With Quote #3

Good effects ;)

Pleas add cvar ff off effects!
__________________

CS:GO Open Chest MOD IP: csgo.slimi.lt
New CS 1.6 CSGO IP: pub.slimi.lt
CS 1.6 Slimi RPG MOD http://rpg.slimi.lt

Last edited by PyPKjE20; 08-15-2012 at 06:12.
PyPKjE20 is offline
Send a message via Skype™ to PyPKjE20
Gadzislaw007
Senior Member
Join Date: Nov 2009
Old 08-15-2012 , 07:06   Re: Amx_Hiteffects
Reply With Quote #4

Deeply thanks for feedback and cc.
I just have few sentences, since I'm kinda new in making plugins. I hope you will help me.

• What exactly are cvar pointers? How do I use them, why do I use them. Tried to use google, but I didn't find anything. Any link from your side?

• Why you think I need to know real damage?

• I think that blind/fade addon is enough explicit and making it even longer could annoy player, cause of limit on his seeing.

• Tried to shorten emit_sound code, somehow doesn't work for me.
Gadzislaw007 is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 08-15-2012 , 07:39   Re: Amx_Hiteffects
Reply With Quote #5

http://wiki.amxmodx.org/Optimizing_P...#Cvar_Pointers (you can read this page from the begining though)

• Administrators may want to set min damage related cvars according to real damage done...

• Because administrators may want to be able to set the fade time, also flags (3rd arg) are wrong. (anyway, max duration with your values is 2.6 seconds on 100 HP damage, if real damage of course, else it gonna be more).

• Try again then
__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 08-15-2012 at 07:44.
ConnorMcLeod is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 08-15-2012 , 10:06   Re: Amx_Hiteffects
Reply With Quote #6

AMXX file removed, do not upload it again
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
necox
Member
Join Date: Feb 2008
Old 08-15-2012 , 14:47   Re: Amx_Hiteffects
Reply With Quote #7

I think it's beautiful
__________________
necox is offline
PyPKjE20
Member
Join Date: Dec 2010
Location: Lithuania
Old 08-16-2012 , 12:45   Re: Amx_Hiteffects
Reply With Quote #8

Add cvar friend fire off self prevents play
__________________

CS:GO Open Chest MOD IP: csgo.slimi.lt
New CS 1.6 CSGO IP: pub.slimi.lt
CS 1.6 Slimi RPG MOD http://rpg.slimi.lt
PyPKjE20 is offline
Send a message via Skype™ to PyPKjE20
sidahmed
Member
Join Date: May 2012
Old 08-16-2012 , 22:04   Re: Amx_Hiteffects
Reply With Quote #9

plz if you can
give us some pics
__________________
i'm in love with amxmodx
<3 allied modders <3
sidahmed is offline
necox
Member
Join Date: Feb 2008
Old 08-17-2012 , 01:00   Re: Amx_Hiteffects
Reply With Quote #10

Quote:
Originally Posted by sidahmed View Post
plz if you can
give us some pics
http://youtu.be/2wYbEGZxk2k
__________________
necox is offline
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 05:42.


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