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

TFC No Nades


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   Team Fortress Classic        Category:   General Purpose        Approver:   twistedeuphoria (82)
pizzahut
Senior Member
Join Date: Oct 2004
Old 05-14-2005 , 13:16   TFC No Nades
Reply With Quote #1

This plugin was requested by Ancient.

Credits: Zor for helping me with this plugin.

Description: By default, this plugin turns off all grenades except for concussion. Via menu you can configure primary and secondary grenades for each class separately. The configuration is stored in cvars.

Atm there are two flavours:
- tfcnonades_cpt is CPU intense, but should be 100% reliable.
- tfcnonades_event should have minimal (if any) CPU usage, but you might be able to prime a single grenade.
Attached Files
File Type: sma Get Plugin or Get Source (tfcnonades_cpt.sma - 1900 views - 5.3 KB)
File Type: sma Get Plugin or Get Source (tfcnonades_event.sma - 1913 views - 5.5 KB)
__________________
My AMXX plugins (content date 2007-03-29, link check 2017-04-26)

Plugins for the Royston Vasey TFC server - These are UNSUPPORTED, except those which have been published at AMX Mod X.

Last edited by pizzahut; 05-27-2007 at 11:54. Reason: Changed variable name "state" to "state_" because in new AMXX versions this seems to be a reserved name.
pizzahut is offline
turtles
Junior Member
Join Date: Mar 2005
Old 05-16-2005 , 12:57  
Reply With Quote #2

hi, this plug-in appears to work very well. although upon some testing of my own i've come across a way to partially get around it. upon acquiring grenades a user is able to "prime" a restricted grenade before it gets removed, thus allowing them to use a restricted grenade. however with maps where grenades can be acquired in quick succession (ex: conc maps) a user exploiting the above method is able to lag or possibly crash the server using specific grenades, such as the soldiers nail grenades. i have come across in the past a few servers where actually using a restricted grenade simply doesn't work followed by a message of it being restricted, however it seems such a plug-in is private to said server(s) for after much searching for such plug-ins for adminmod and amxx i've come up empty (until now). thanks for a great plug-in so far.
turtles is offline
ancient1
Senior Member
Join Date: Jul 2004
Location: UK
Old 05-18-2005 , 05:57  
Reply With Quote #3

There is a new improved version currently under testing, It will get posted here once its working correctly. Use pizzahuts version for now.

Yes you can prime a nade if your quick enough, but the new version gets around that problem. It not working correctly as yet, so be patient ;)

Ancient
__________________
ancient1 is offline
pizzahut
Senior Member
Join Date: Oct 2004
Old 05-19-2005 , 19:55  
Reply With Quote #4

Small update, did some optimisation on the code. Especially the cpt version should be a lot faster now.
pizzahut is offline
turtles
Junior Member
Join Date: Mar 2005
Old 05-21-2005 , 01:09  
Reply With Quote #5

hi, thanks for the replies . i'll try to get around to playing with the new version sometime next week, have a busy weekend with relatives ;).

thanks again

-bryan
turtles is offline
pizzahut
Senior Member
Join Date: Oct 2004
Old 05-23-2005 , 20:45  
Reply With Quote #6

Quote:
Originally Posted by turtles
i have come across in the past a few servers where actually using a restricted grenade simply doesn't work followed by a message of it being restricted
I found out how to achieve this. It's possible to block client commands if they are executed server side.
Code:
#include <amxmodx> public plugin_init() {   register_clcmd("+gren1", "block_grenade")   register_clcmd("primeone", "block_grenade")   register_clcmd("+gren2", "block_grenade")   register_clcmd("primetwo", "block_grenade") } public block_grenade(id) {   client_print(id, print_chat, "Sorry.^n")   return PLUGIN_HANDLED }
pizzahut is offline
Lt Llama
Senior Member
Join Date: Aug 2004
Old 01-29-2006 , 16:38  
Reply With Quote #7

This plugin has to be updated.

The cvar

Code:
state

gives an error 020: invalid symbol name "".

When the cvar name is changed it compiles and the plugin works as its supposed to.
Lt Llama is offline
watch
Senior Member
Join Date: Sep 2005
Old 05-01-2006 , 13:18  
Reply With Quote #8

Something simple i wrote a while ago for my server before i even saw this thread. I thought i'd post it as noone really wants to have to use a high cpu plugin and the other lets grenades through so people can still crash the server on concmaps :(

Cvars are: gr_gren, gr_caltrop, gr_conc, gr_nail, gr_mirv, gr_napalm, gr_gas and gr_emp
1 = grenade disabled 0 = grenade allowed(default)

Requires the engine module :O
Attached Files
File Type: sma Get Plugin or Get Source (tfc_grenade.sma - 1865 views - 1.9 KB)
__________________
Code:
#include <amusing_small_signiture>
watch is offline
pizzahut
Senior Member
Join Date: Oct 2004
Old 05-27-2007 , 11:57   Re: TFC No Nades
Reply With Quote #9

I recommend the plugin which watch made, but in case anyone still wants to use the ones I posted, I've updated them as Lt Llama suggested.
__________________
My AMXX plugins (content date 2007-03-29, link check 2017-04-26)

Plugins for the Royston Vasey TFC server - These are UNSUPPORTED, except those which have been published at AMX Mod X.
pizzahut is offline
Weasel
AlliedModders Donor
Join Date: Apr 2004
Location: Undisclosed / Secure
Old 05-17-2008 , 17:37   Re: TFC No Nades
Reply With Quote #10

Sorry to bump an old thread but might be relevant to some people ...

Setup various grenade-suppression scripts on my TFC server, only to find that while it prevented players from having/using grenades, the bots still did. I'm my case I'm using BotMan's old "HPB-Bot" bot's. Don't know if that's an issue with other bots (like Fox-Box) or not.

So, I had to come up with an alternate method. Having some HL & TFC mapping experience, I new there was a "func_nogrenades" entity that mappers can use to create an invisible field which prevents grenades from exploding and doing any damage. This is typically used in respawn rooms and resupply rooms to prevent them from being continuously spammed - particularly on friendly-fire servers. There is also a "func_nobuild" entity that is used to prevent Engineers from building sentries and dispensers in undesirable places as well.

Anyway, for years I've used an old BotMan mod called "Stripper2" on my HL server to strip-out some weapons at run-time - effectively preventing them from spawning without having to modify the BSP map file itself. Well, "Stripper2" can also spawn entities into a game a run-time. So, I've created Stripper2 configuration files for each default TFC map (and a custom map that I run) to essentially spawn a func_nogrenades entity over the entire playable area of the map.

I wasn't sure how the game engine would react to a func_nogrenades entity (or any other entity for that matter) that used the entire possible world coordinates. So when I created these configuration files, I made sure they only covered the space in the coordinate system that each map actually uses.

Doing that was a bit of a challenge. I had to use a utility out there called BSP2Map to essentially dump the map's source-code (in .MAP format) to a file, open it in Hammer (the old formerly-WorldCraft version, not the Source engine version), create the "brush-based entity" that covered the entire usable area, etc. I never saved anything back into the BSP file itself, just used the data from it as a reference to get the size and position of the func_nogrenades entity right. Then exported to .MAP from Hammer a resultant .MAP file, containing only the func_nogrenades brush-based entity. Then I had to translate those coordinates into the format that Stripper2 wanted in it's configuration file. Of course, that process was repeated for each map because they each use different areas of the "world" coordinates.

As an example, here's the Stripper2 configuration information for 2Fort:

Code:
[strip]

[add]
{
   classname/func_nogrenades
   origin/0 0 0
   bbox_min/-1792 -4096 -1408
   bbox_max/1792 4096 128
}
Anyway, so the net effect of all this is that grenade power-ups spawn as normal, players can gather and throw them as normal, but they do not explode or do any damage. You just see a little explosion sprite, but no sound is played or damage is imposed - just as if they had been thrown into a respawn room. The bots also try to use the grenades as normal, they just have no effect. Of course, Stipper2 must be installed as a server-side "meta-mod".

I've packaged-up the Stripper2 configuration files and such and posted them on the web for anyone interested. The file is available at the URL listed below:

http://www.ladt.us/files/TFCNoGrenades.ZIP

References:
Stripper2: http://hpb-bot.bots-united.com/stripper2.html
HPB-Bot: http://hpb-bot.bots-united.com
Attached Files
File Type: zip TFCNoGrenades.ZIP (5.0 KB, 318 views)

Last edited by Weasel; 05-17-2008 at 17:54. Reason: Turn configuration informaton into "code" format, minor spelling corrections.
Weasel 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 11:47.


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