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

CS/CZ Ricochet v2.01


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   Counter-Strike        Category:   Fun Stuff        Approver:   Exolent[jNr] (178)
ot_207
Veteran Member
Join Date: Jan 2008
Location: Romania The Love Country
Old 08-23-2009 , 11:40   CS/CZ Ricochet v2.01
Reply With Quote #1

Description:
It will make the bullets bounce if some properties are met.

Modules:
CStrike
FakeMeta
HamSandWich


Cvars:
ric_damage_percent 75 // The damage percentage dealt to the user if the bullet that ricocheted will hit him
ric_angle 30 // the maximum angle that the bullet will bounce and not get through the wall
ric_tracers 1 // Tracers for the bounced bullet, it will only show the bouncing bullet! It has been made like this to be used in conjunction with advanced bullet tracers
ric_pistols 1 //Pistol bullets will bounce
ric_shotguns 1 // Shotgun bullets will bounce
ric_smgs 1 // Smg bullets will bounce
ric_rifles 1 // Rifle bullets will bounce
ric_snipers 1 // Sniper bullets will bounce
ric_materials 1023 // Materials cvar look at the explanation below.
ric_money 100 // Extra money reward for killing a player with a bouncing bullet

Material cvar:
The materials that we have are:
PHP Code:
#define MATERIAL_CONCRETE     1
#define MATERIAL_DIRT         2
#define MATERIAL_GRATE        4
#define MATERIAL_METAL        8
#define MATERIAL_SNOW         16
#define MATERIAL_COMPUTER     32
#define MATERIAL_SLOSH        64
#define MATERIAL_TILE         128
#define MATERIAL_VENTS        256
#define MATERIAL_WOOD         512
#define MATERIAL_GLASS        1024 
To make bullets bounce when hitting one of the kinds above you need to add them to the ric_materials cvar.
Example:
To make bullets bounce when hitting wood and glass
1024 + 512 = 1536
The ric_materials cvar needs to have this value: ric_materials 1536

Note:
The texture types are defined in the client file "texture.txt" in sound/. If the map is not listed with the texture name and the texture type related, the default texture type will be Concrete. So the default material is CONCRETE!

Useful Links:
Servers using this plugin

Screens/Movie:
http://www.noelshack.com/up/aaa/lawl-286298e158.bmp
http://www.youtube.com/watch?v=WGV_ybTOGRI

To do:
- Make triple ricochet
- Tracers do their job properly
- Angle for every weapon cvars

Changelog:
PHP Code:
2.01 Small fixnow it supports snow material
2.0 
Changed angle cvaradded security checksmaterial checkfunc_breakable influencemoney reward
1.0 
Initial Release 
Attached Files
File Type: sma Get Plugin or Get Source (ricochet.sma - 4234 views - 11.6 KB)
__________________
My approved plug-ins | Good for newbies! | Problems?

Back, will come around when I have time.

Last edited by ot_207; 10-12-2009 at 19:52. Reason: Remade the plugin parts, can be placed at approval
ot_207 is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 08-23-2009 , 11:48   Re: CS/CZ Ricochet
Reply With Quote #2

Nice. ( though some things could be said. :p )

I remember it exists already such plugin but yours sounds more complete.
__________________
Arkshine is offline
lol37
Member
Join Date: Apr 2008
Old 08-23-2009 , 11:48   Re: CS/CZ Ricochet
Reply With Quote #3

Nice plugin, will test it
EDIT : tested work perfectly

Last edited by lol37; 08-23-2009 at 11:52.
lol37 is offline
ot_207
Veteran Member
Join Date: Jan 2008
Location: Romania The Love Country
Old 08-23-2009 , 11:49   Re: CS/CZ Ricochet
Reply With Quote #4

Quote:
Originally Posted by Arkshine View Post
Nice. ( though some things could be said. :p )

I remember it exists already such plugin but yours sounds more complete.
Please say, it is not a problem.
This uses only Ham_TraceAttack. That other plugin did everything in TraceLine forward
__________________
My approved plug-ins | Good for newbies! | Problems?

Back, will come around when I have time.
ot_207 is offline
crazyeffect
Veteran Member
Join Date: Jul 2008
Location: Belgium
Old 08-23-2009 , 11:59   Re: CS/CZ Ricochet
Reply With Quote #5

kuuuwl!
__________________
crazyeffect is offline
Send a message via MSN to crazyeffect
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 08-23-2009 , 12:18   Re: CS/CZ Ricochet
Reply With Quote #6

It's only minor things.

- Instead of hardcoding decals and getting game, you should use EngFunc_DecalIndex. All is you need is to retrieve the first decal in a global var : gShot1Decal = engfunc( EngFunc_DecalIndex, "{shot1" );, then doing : gShot1Decal - random( 5 ); .
- To be more readable, use an enum with the sounds array. :p
- Use const instead of #define for the bitsums. The reason is using const the value will be calculated one time at the compilation, using #define not.
- I don't understand the first trace line you do. Is it really need ? I mean the trace is already done ( thdl ). Explain, please :p
- Why do you use blood_spray() ? Using TraceAttack, the victim should get some blood already.
- "hitgroup == 8" ; Why don't you create a define : const HIT_SHIELD = 8;
- Also, using a switch for "hitgroup" would be more neat and you could use one emit_sound(); armor == CS_ARMOR_VESTHELM ? sounds[5] : sounds[random(3)]
- I would use MSG_PVS for TE_TRACER too.

That's all.
__________________

Last edited by Arkshine; 08-23-2009 at 12:24.
Arkshine is offline
Old 08-23-2009, 12:24
Arkshine
This message has been deleted by Arkshine. Reason: lag.
KadiR
Unnecessary Member
Join Date: Aug 2008
Location: Zürich / Switzerland
Old 08-23-2009 , 12:27   Re: CS/CZ Ricochet
Reply With Quote #7

can you give us a picture or video ?
KadiR is offline
ot_207
Veteran Member
Join Date: Jan 2008
Location: Romania The Love Country
Old 08-23-2009 , 12:29   Re: CS/CZ Ricochet
Reply With Quote #8

Quote:
Originally Posted by Arkshine View Post
It's only minor things.

- Instead of hardcoding decals and getting game, you should use [i]EngFunc_DecalIndex(/i]. All is you need is to retrieve the first decal in a global var : gShot1Decal = engfunc( EngFunc_DecalIndex, "{shot1" );, then doing : gShot1Decal - random( 5 ); .
- To be more readable, use an enum with the sounds array. :p
- Use const instead of #define for the bitsums. The reason is using const the value will be calculated one time at the compilation, using #define not.
- I don't understand the first trace line you do. Is it really need ? I mean the trace is already done ( thdl ). Explain, please :p
- Why do you use blood_spray() ? Using TraceAttack, the victim should get some blood already.
- "hitgroup == 8" ; Why don't you create a define : const HIT_SHIELD = 8;
- Also, using a switch for "hitgroup" would be more neat and you could use one emit_sound(); armor == CS_ARMOR_VESTHELM ? sounds[5] : sounds[random(3)]
- I would use MSG_PVS for TE_TRACER too.

That's all.
1. I didn't know about that, Thanks! Could you give me an example of the usage.
2. LoL, true, but I think that I won't do it.
3. That I didn't know, will do it!
4. The first traceline is to determine whether the bullet goes through wall. That is made to make the bullet deflect not go through it if the properties are met.
5. On my no-steam server it didn't appear so I've placed it in the code. If it is a problem I will remove it.
6. Lol again, but will do
7. Ok ...
8. Ok.

Quote:
Originally Posted by KadiR View Post
can you give us a picture or video ?
Will do, in the following day you will have a video.
__________________
My approved plug-ins | Good for newbies! | Problems?

Back, will come around when I have time.

Last edited by ot_207; 08-23-2009 at 12:34.
ot_207 is offline
lol37
Member
Join Date: Apr 2008
Old 08-23-2009 , 12:30   Re: CS/CZ Ricochet
Reply With Quote #9

Quote:
Originally Posted by KadiR View Post
can you give us a picture or video ?
http://www.noelshack.com/up/aaa/lawl-286298e158.bmp
lol37 is offline
ot_207
Veteran Member
Join Date: Jan 2008
Location: Romania The Love Country
Old 08-23-2009 , 12:32   Re: CS/CZ Ricochet
Reply With Quote #10

Quote:
Originally Posted by lol37 View Post
Lol, that was fast. Added in the first post .
__________________
My approved plug-ins | Good for newbies! | Problems?

Back, will come around when I have time.
ot_207 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 19:25.


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