PDA

View Full Version : DoD Nade Exploit Fix


dodsynthetic
01-29-2009, 05:46 PM
Syn's Nade Exploit Fix v1.002

This plugin is a spawn off of my dod_avalanche and dod_purple nade exploit fix plugins. This is
designed to be used with any map. All you need is a defintion file for a particular map. You can
also create your own or modify existing ones with the built in editor. The reason I made a universal
plugin for all maps is simple. Less to deal with. It would be a redunant to have to get different
plugins to cover multiple maps. It also creates less mess on the dodplugins.net forums. XD

Currently comes with the following definitions:

dod_avalanche
dod_purple

===========================
v1.002 Changes
===========================
- Fixed non working player blocks.

===========================
v1.001 Changes
===========================
- Added missing admin flag check for console commands. Allowed anyone to use the editor! o.O
- Per request, added menu to access all console commands via menu.

===========================
Features & Notes
===========================
- Deflects nades from marked exploit locations on maps. Can block Allied, Axis, or all grenades.

- Blocks can be set to deflect players instead of nades on either or both teams as well. This is
good for spawn protection or anywhere you don't want players getting to.

- Built in editor for creating and editing your own custom blocks.

- Supports as many maps as you want.

- Each map definition file supports up to a maximum of 64 blocks.

- Want to have a map fixed? Let me know and I'll create a definition file for it or you can use the
built in editor to make your own!

- Credit goes out to the following people for helping me test, improve the original plugin to this
final refined, unified plugin and provide exploit locations for dod_avalance:
| Tank | Diamond-Optic | OnEHiTwOnDeR | Dr.G |

- Block locations whose vector is 0.0 / 0.0 / 0.0 (X/Y/Z) are ignored. The chances of placing a
block at these coordinates are very slim but just incase I'm mentioning it.

- Unlike my previous dod_avalanche nade exploit fix map, I have not added an Axis player block into
Allied appartments from the penguin room. You can add it if you want.

===========================
Editor Mode
===========================
Because this is a more in depth function of the plugin, it gets it's own section. I've tried to
make it so creating your own block points are as less of a pita as possible.

[> Setting up <]
- First you are going to join sectators and turn on the editor by typing: nade_exploit_edit
into your console. This toggles the editor on and off and anytime the map changes or the server
restarts, it will always default off. Once you have enabled editor mode (console will show a message
to this effect) you can begin placing your blocks.

[> Keys <]
Attack - Place a new or select a highlighted block location for editing.

Attack2 - Cycle's through a selected entity's block modes, nade/allied/axis/all/remove.

Jump - Increment block location size.

Duck - Decrement block location size.

Turn Left - Rotate deflection direction to the left. This is not strafe left.

Turn Right - Rotate deflection direction to the right. This is not strafe right.

Run - Delete block location when editing it.

Use - This will instantly warp you back to the last spot you were editing from so you can check your
blocks quicker after spawing instead of walking all the way back. This location is saved only
temporarily and does not save between map changes.

If you don't know the binds for these keys, here they are in the same order:

+attack
+attack2
+jump
+duck
+turnleft
+turnright
+run
+use

If you don't know what to do and don't know how to bind keys this example will help. Let's say you
want to bind cancel to your I key. You would go into the console and type:

bind i +cancel

So by looking at that you can see first we are using the bind command, then the first argument is
the key you want, I in this case, and the last part is the action command we are binding to the I
key. It's really simple. You can do this with any of your keys and any command.

[> Working with blocks <]
This editor takes a simple approach to editing locations. All you have to do is aim where you want
the block to go and press your primary attack button. To make things even easier, there is a
temporary placement rabbit model for reference. Where this temp model is, is where your block will
be. The new block is also represented with a rabbit model. After placing a block, make sure you are
aiming at it. You will know your on it because you will see a white highlight box around it and an
implosion effect. The implosion effect is a general representation of the block radius, that is,
the range at which you want to cover for blocking something. So now that you have your new block
highlighted press your primary attack again. This time the rabbit will turn red and the
highlight box will dissapear indicating that this block locations is currently being edited. You can
move around the map and place it in another location or you can change it's block type. There are
6 block types you can choose from. These are Allied nades, Axis nades, all nades, Allied players,
Axis players or all players. To cycle through each block type, have your block location bunny
glowing red and press your secondary fire button. It will take you through all the modes. Also, if
you want to delete a block location, have it in the red and hit your run key. This will remove it
completely. Now on to the deflection. Setting this up is just as easy. Look at the way the rabbit
model is facing. He is pointing in the direction which objects will be deflected in. You can rotate
the deflection angle with your turn left, and turn right keys. Generally you want to always deflect
away in the opposite direction of where something shouldn't go. All that is left now is the radius
of the deflection. The radius is how big of an area you want to cover. Keep in mind that this radius
is the shape of a sphere. After playing around and setting up your block locations, test them out.
To make things easier after you spawn, press your use key and it will take you to the location of
the last block you edited. Once you are satisfied, go into the console and type: nade_exploit_save
and it will save all of your current work to a file for the corresponding map your on. You can then
exit editor mode by typing: nade_exploit_editor into the console again. This will resume normal
operation. There is also a menu to access all console commands and can be gotten to by typing:
nade_exploit_menu in console.

[> Additional info <]
- Remember that depending on the location you may need a few smaller radius block locations to cover
an area while others will suffice with a larger single block. Too big of a radius and it could block
parts of the map you don't want blocked and too small could lead to gaps that aren't fully covered.

- If you need to start over to the last time you saved, just type: nade_exploit_load into the
console.

- Using the console command: nade_exploit_wipe will completely wipe all block data from memory if
you want to start all over. This does not wipe a saved map file though.
.
===========================
Console Commands:
===========================
nade_exploit_editor
- Toggles editor mode on or off for creating/editing exploit definition files.

nade_exploit_status
- Displays info in the console as to the status of the plugin such as the total exploit blocks
running or any errors the plugin encountered.

nade_exploit_save
- Will attempt to save the current exploit definition data to the map's corresponding file. This
process can take a few seconds to complete.

nade_exploit_load
- Will attempt a load or reload of the current map's exploit definition file if available.

nade_exploit_wipe
- Use this to completely start over with no block locations. Use this with nade_exploit_save to
clean the map definition file as well.

nade_exploit_menu
- Allows access to all the console commands via manu.

===========================
CVARs
===========================
nade_exploit_fix | 0 = off | 1 = on
- Enables or disables the Map Exploit Fix plugin. Default on.

nade_exploit_scan_time | x.x
- Allows changing the delay between every scan. This will let you adjust the plugin's CPU usage.
While it doesn't take alot of work to check these locations, you might have a slower server or wish
to optimize your server if you have lots of plugins running. The higher the number, the more time
there will between each global check but if it's too high, you run the risk of a blockee getting
past a block location. For the most part you want to keep this under 1 second. You can enter an
integer or real number here. For example, a value of one would just be 1 second and a value of 1.5
would be 1 and a 1/2 seconds. Also, this only is for nade block locations. Players have to be
checked much faster in prethink. Default 0.5.

===========================
Installation
===========================
- Compile the .sma file | An online compiler can be found here:
http:www.amxmodx.org/webcompiler.cgi
- Copy the compiled .amxx file into your addons\amxmodx\plugins folder
- Add the name of the compiled .amxx to the bottom of your addons\amxmodx\configs\plugins.ini
- Copy the desired map definition files to a new folder named nade_exploits inside of your amxmodx
config folder. For example most people's setups would look like this:
addons\amxmodx\configs\nade_exploits
- Change the map or restart your server to start using the plugin!

diamond-optic
01-29-2009, 07:12 PM
looks good :)

one thing im confused about is in the avalanche edf file.. im assuming the entries with all zeros are just placeholders (as you stated above that using all 0's basically means that index wont be used)

Index: 53
0.000000
0.000000
0.000000
0.000000
0.000000
0.000000
0.000000
0but whats with these ones:
Index: 49
0.000000
0.000000
0.000000
0.000000
0.000000
0.000000
20.000000
0
Index: 50
0.000000
0.000000
0.000000
0.000000
0.000000
0.000000
20.000000
0
Index: 51
0.000000
0.000000
0.000000
0.000000
0.000000
0.000000
20.000000
1
Index: 52
0.000000
0.000000
0.000000
0.000000
0.000000
0.000000
40.000000
0when i check the status it says theres 50 blocks being used, so that would mean indexes 0-49

well whys 49 get used and not 50 or 51 when they are the same, and not 52 when its just slightly different

im sure im most likely mistaken about something with it


*EDIT*

i also noticed the last one that |OnEHiTwOnDeR|SoCal pointed out in the old ava nade fix thread can still be used (not sure if you did put in a fix for that and its just not blocking it or if maybe you forgot)

*EDIT #2*

ok using the editor i notice you did put one in there, but i just used it to kill 3 ppl lol

*EDIT #3*

word to the wise lol.. dont go into editor mode with bots in the server hahha.. otherwise everytime they shoot and whatnot they trigger the editor functions

dodsynthetic
01-29-2009, 07:31 PM
Ahh, that was leftover data from testing. I didn't bother cleaning it up since it will get ignored anyway. XD The ones that have zeros are just place holders for each of the blocks. As for that roof block, I'll have to adjust that lol. It probably needs to be pushed back more or the radius increased.

LOL @ edit #3
That had to be a mess. Good thing it caps at the limit. XD

Oh and it determines a block entry in if the first three lines (block origin) of the block are all zeros or not. It doesn't bother checking the rest of the data in the entry if they are zeros.

diamond-optic
01-30-2009, 03:07 AM
is there a way, if not would it be possible to add one, where you could set a block point to not push back when set to block players and not nade.

i understand this plugin is mainly for blocking nades, but since it also can block players it would be nice to be able to have it just block the player and not push back on them (not sure how the plugin totally works so for all i know you might have to push back on the player to block them)

dodsynthetic
01-30-2009, 06:47 AM
Basically I'm just checking objects within x distance of block origin and using velocity to deflect them. Since there isn't anything really there at a block location the only ways I can think of is to use entities or create some collision / movement code. Entities would be easy but they are too slow so I could probably come up with some simple collision math that makes it just like a wall.

dodsynthetic
01-30-2009, 11:56 AM
Updated the Avalanche def for the block up above the W crack. It was set to only block Allied nades. XD

diamond-optic
01-30-2009, 08:24 PM
yeah it would probably be easier and make more sense for me to just make a tiny little plugin myself to do what i need (since theres only one spot i really want it for at the moment) and just use this one to handle the nade exploits

Dr.G
02-02-2009, 12:01 PM
Dude this is really cool GJ, just loaded this so i have no error log for.. yet lol... however it wont take u long to great a menu for this so have one command, that should be imo... But if u wanna make a menu system please use the "new" menu system. Its really easy and its dynamic with other menus... like if u have amxmodmenu open and u open a new say one for this menu its will auto close the other one etc.... http://forums.alliedmods.net/showthread.php?t=46364&highlight=menu

Cheers! again good job!

dodsynthetic
02-02-2009, 04:52 PM
Now with menu and an important fix. Yeah, I never really bothered with the old menu system too much.

Tank
03-25-2009, 12:54 AM
Syn, I need your help on this. I left the cvar default, placed the amxx file and the map definition file for Avalanche. But if I throw a nade into blue room it still glitches. What cvar do I need to set?

dodsynthetic
04-05-2009, 04:33 AM
Wow I'm outdated. Sorry for the delay in getting back with you Tank. Type nade_exploit_status into the console and see if it reports any problems. If all is good, I may have accidentally set it to only a certain type of block I.G. allied only or axis only like I did with the ceiling block above the W crack house. XD I'll check it out though.

dodsynthetic
12-06-2009, 09:28 PM
New update. Was setting up some blocks for a map and realized that they weren't working in non-editor mode because player origins were only being stored in editor mode. Now they work like they should.