Raised This Month: $66 Target: $400
 16% 

Echo 0.7


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   ALL        Category:   Admin Commands        Approver:   Exolent[jNr] (178)
shine771
Senior Member
Join Date: Jun 2007
Location: Latvia
Old 04-07-2009 , 19:08   Echo 0.7
Reply With Quote #1

Echoooo
0.8

- Description -

This plugin automatically makes echoes in large rooms, tunnels, sewers etc.

- Cvars -

Quote:
amx_echo_roomtype <0 - 28> <Echo type> <Def: 3>
- Notes -

It's not perfect. Not even close to perfect. In my opinion, you cant get a perfect echo without placing env_sounds or defining echo zones manually, and to do it automatically, it would take up too much resources. There is a serious bug. If player is in a "echo zone" and leaves it'll still have echo joining other servers. To fix it you have to type "room_type 0" in console. The bad thing with amxx is that you cant catch the disconnect event and execute client commands before user disconnects. I don't care if this gets unapproved, as it probably will, because it messes up client settings. I just wanted to give a try at to make this. Maybe someone will use it though.
It worked perfect in cs_militia sewers, my gf_hellschamber map for GF and de_dust2 tunnels. There were some small bugs in de_dust though.

Inspired by This request.
Attached Files
File Type: sma Get Plugin or Get Source (echo.sma - 1653 views - 3.5 KB)
__________________

Last edited by shine771; 04-07-2009 at 22:13.
shine771 is offline
Old 04-07-2009, 19:10
joaquimandrade
This message has been deleted by joaquimandrade.
alan_el_more
Veteran Member
Join Date: Jul 2008
Location: amxmodx-es.com
Old 04-07-2009 , 20:00   Re: Echo 0.7
Reply With Quote #2

good plugin and idea
__________________
alan_el_more is offline
joaquimandrade
Veteran Member
Join Date: Dec 2008
Location: Portugal
Old 04-07-2009 , 20:01   Re: Echo 0.7
Reply With Quote #3

Tell me one thing:

Didn't you meant, instead of:

PHP Code:
is_sky_above(Float:Origin[3],Float:Dist) { 
PHP Code:
is_sky_above(Float:Origin[3],&Float:Dist) { 
__________________
joaquimandrade is offline
shine771
Senior Member
Join Date: Jun 2007
Location: Latvia
Old 04-07-2009 , 20:22   Re: Echo 0.7
Reply With Quote #4

I have been scripting for a while but i've never came across something like this. Can you explain what it's used for?
__________________

Last edited by shine771; 04-07-2009 at 20:26.
shine771 is offline
joaquimandrade
Veteran Member
Join Date: Dec 2008
Location: Portugal
Old 04-07-2009 , 20:29   Re: Echo 0.7
Reply With Quote #5

Quote:
Originally Posted by shine771 View Post
I have been scripting for a while but i've never came across something like this. Can you explain what it's used for?

Does it do the same thing that this does, or something else?
Code:
is_sky_above(Float:Origin[3],Float:Dist = 0.0)
No. In a function header, having a cell variable declared as &variable, means that the function will be able to change its value. ("Pass by reference". Opposed to "Pass by value")

I asked you because you are doing:

PHP Code:
Dist += SKYCHECK_STEP 
Inside the function so, if you want to change it's value, you have to pass it by reference.
___

I was looking at your code and you seriously need to improve that function (is_sky_above).

Why are you adding SKYCHECK_STEP inside a loop to the Z index instead of doing a long trace?
__________________

Last edited by joaquimandrade; 04-07-2009 at 20:31.
joaquimandrade is offline
shine771
Senior Member
Join Date: Jun 2007
Location: Latvia
Old 04-07-2009 , 20:32   Re: Echo 0.7
Reply With Quote #6

Ok thanks . Updated. About that trace. I didn't thought of that at that moment. I'll update it asap.
__________________
shine771 is offline
joaquimandrade
Veteran Member
Join Date: Dec 2008
Location: Portugal
Old 04-07-2009 , 20:40   Re: Echo 0.7
Reply With Quote #7

Quote:
Originally Posted by shine771 View Post
Ok thanks . Updated.
You must understand what you are doing. Your algorithm has more flaws, and inconsistencies:

PHP Code:
//If distance is smaller
if(Dist MIN_ECHO_DISTANCE) { 
Then

PHP Code:
if(is_sky_above(tEnd,Dist)) { 
(You are calculating if is_sky_above for all traced points that are in a "echo distance")

Why?
__________________
joaquimandrade is offline
shine771
Senior Member
Join Date: Jun 2007
Location: Latvia
Old 04-07-2009 , 20:48   Re: Echo 0.7
Reply With Quote #8

Updated.

To check if player is in some kind of a room. I didn't really thought why i did it. I just made this plugin in ~20-30minutes. Double checked the code, tested and submitted it here. Don't ask why i did it. Tell me a better way.
__________________
shine771 is offline
joaquimandrade
Veteran Member
Join Date: Dec 2008
Location: Portugal
Old 04-07-2009 , 21:28   Re: Echo 0.7
Reply With Quote #9

Quote:
Originally Posted by shine771 View Post
Updated.

To check if player is in some kind of a room. I didn't really thought why i did it. I just made this plugin in ~20-30minutes. Double checked the code, tested and submitted it here. Don't ask why i did it. Tell me a better way.
Here is my try on improving your code.

is_sky_above is still unfixed, and the algorithm is still far from perfect. Anyway, I guess that a perfect algorithm can't be made for this.

Other thing: probably some guy that knows amxmodx better than me can tell you a consistent way of doing this:

PHP Code:
client_cmd(id,"room_type 0"
Attached Files
File Type: sma Get Plugin or Get Source (echoes.sma - 868 views - 3.7 KB)
__________________

Last edited by joaquimandrade; 04-07-2009 at 21:32.
joaquimandrade is offline
shine771
Senior Member
Join Date: Jun 2007
Location: Latvia
Old 04-07-2009 , 22:12   Re: Echo 0.7
Reply With Quote #10

Omg, i posted the wrong .sma.. Updating now. Shouldn't you use Ham or Fakemeta instead of engine? I removed extra sky checks. Now it works great. About those echo points:
__________________
shine771 is offline
Reply


Thread Tools
Display Modes

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:16.


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