Raised This Month: $ Target: $400
 0% 

[TF2] Disabling Ammo Lockers


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Ralphi
Junior Member
Join Date: Oct 2009
Old 10-01-2009 , 09:10   [TF2] Disabling Ammo Lockers
Reply With Quote #1

Hi there,
I'm fairly new to sourcemod and I'm looking for someone to put me in the right direction as to how to disable ammo lockers in spawn. I've used search and found nothing that seemed to do what I need.

Basically I need the doors on the ammo lockers not to open when players try to use them. Either that or just disable the function of giving additional health and ammo.

I've seen it done on a server so it must be possible but I don't know that it was done in sourcemod. I would like to keep my server simple and only use sourcemod.

Hope you can all help out.
Ralphi
Ralphi is offline
Kilandor
Member
Join Date: Sep 2009
Old 10-01-2009 , 10:05   Re: [TF2] Disabling Ammo Lockers
Reply With Quote #2

You should be able to FindEntityByClassname and search for func_regenerate and set "disabled" to true

Just do this OnMapStart

I'm not 100% but this should work
SetVariantInt(0);
AcceptEntityInput(ent, "Disabled", -1, -1, 0);

But you still have to setup the loop to handle searching for the ents
__________________
Kilandor is offline
Ralphi
Junior Member
Join Date: Oct 2009
Old 10-01-2009 , 10:09   Re: [TF2] Disabling Ammo Lockers
Reply With Quote #3

As I said, I'm new to this and didn't understand what you said to do. Could you be a bit more specific please.
Ralphi is offline
Kilandor
Member
Join Date: Sep 2009
Old 10-01-2009 , 11:08   Re: [TF2] Disabling Ammo Lockers
Reply With Quote #4

Edit: Well I found the problem, When the Round Restarts the entity's are being reset, so I hooked into that to disable them on round start. It also hooks it for arena just in case there are any arena maps with lockers

This contains 1 Cvar that is checked on each round start to disable/enable
Disabled Ammo Lockers on round start (this is default)
ammo_locker_disable - [1/0] Enable/Disable this plugin(doesnt reset lockers unitll normal round/map rest)
__________________

Last edited by Kilandor; 10-02-2009 at 06:14.
Kilandor is offline
TheSpyHunter
Senior Member
Join Date: Jul 2009
Old 10-01-2009 , 13:09   Re: [TF2] Disabling Ammo Lockers
Reply With Quote #5

Is it possible you could make a on/off for this?

Would be great to use with melee mode mod.
__________________
TheSpyHunter is offline
Kilandor
Member
Join Date: Sep 2009
Old 10-01-2009 , 13:47   Re: [TF2] Disabling Ammo Lockers
Reply With Quote #6

Quote:
This contains 1 Cvar that is checked on each round start to disable/enable
Disabled Ammo Lockers on round start (this is default)
ammo_locker_disable - [1/0] Enable/Disable this plugin(doesnt reset lockers unitll normal round/map rest)
It already has a Cvar to disable/enable, or are you referring to doing this like in the middle of a game?
__________________
Kilandor is offline
TheSpyHunter
Senior Member
Join Date: Jul 2009
Old 10-01-2009 , 19:26   Re: [TF2] Disabling Ammo Lockers
Reply With Quote #7

yes, a toggle for when in game
__________________
TheSpyHunter is offline
Ralphi
Junior Member
Join Date: Oct 2009
Old 10-02-2009 , 02:09   Re: [TF2] Disabling Ammo Lockers
Reply With Quote #8

Thanks for that, exactly what I needed
Ralphi is offline
Kilandor
Member
Join Date: Sep 2009
Old 10-02-2009 , 05:24   Re: [TF2] Disabling Ammo Lockers
Reply With Quote #9

New version posted in New Plugins.
http://forums.alliedmods.net/showthr...876#post949876

Please note the cvars changed, added a new one to disable round start disabling, and also added a command to enable/disable
__________________
Kilandor 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 03:56.


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