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

AMXX Dev Team's Restrict Weapon + Replace Restriced Weapons in map


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   Counter-Strike        Category:   Gameplay       
kurian
Member
Join Date: Aug 2005
Old 01-13-2007 , 04:24   AMXX Dev Team's Restrict Weapon + Replace Restriced Weapons in map
Reply With Quote #1

Update 15th Jan 2007 (Afternoon)
Previously if a weapon was deleted from the map due to being restricted, even after unrestricting it, the weapon would not reappear until the map was reloaded.

The plugin now keeps track of weapons that are deleted and restores them if they are unrestricted, or if a replacement weapon is specified after it has been deleted.

All changes are effective on round start.

Update 15th Jan 2007
Changed weapon replace function to trigger on Round_Start because the first time the map is loaded, the weapons get removed as the function is called before the CVARS get set in AMXX.CFG

If the bots buy a restricted weapon, they are made to drop it immediately. But the bots continue to repeatedly buy and drop the same weapon 100's of times in 2 seconds. You end up with 100's of weapons on the floor and it lags out the server.

Fixed by dropping the weapon using a 1 second timer.
-----------------------------------------------------------------------------


Ok Plugin has been given a total overhaul.

Basically its the AMX Dev's Teams Restrict Weapon plugin with some modifications.

The default plugin only prevents players from buying weapons. But restricted weapons could still be picked up in maps such as fy_iceworld.

The modified plugin can replace all restricted weapons of a particular type with a weapon of another type. Example all AWP's can be turned into Scouts. All Auto Shotguns can be turned into M3's.

Hence players have no way to get a restricted weapon.

When playing with bots however the bots are not affected by the restrictions and can buy any weapon. So if a bot buys a restricted weapon, the bot automatically drops it.

In this case a player can pick up the restricted weapon which the bot dropped. So to prevent this, if a player gets his hands on a restricted weapon somehow it is automatically dropped.

DUE CREDITS:
Weapon drop logic borrowed from MagicShot's Advanced Weapon Restriction plugin.

Weapon remove / replace function suggested by AndraX2000.

get_model_name() function borrowed from Cheap_Suit's Backweapons Plugin because i was too lazy to write all those 24 Switch-Case statements myself.

INSTRUCTIONS:
To restrict a weapon, simply use the default Restrict Weapon menu in AMX Mod X.

By default, any restricted weapons lying around the map are removed.
To replace them with another weapon you must change the corresponding CVAR.

amx_restrict_replace_awp "scout"
amx_restrict_replace_g3sg1 "m4a1"
etc.

If you have restricted a weapon without specifying a replacement and hence it gets removed from the map, if you want to get it back you must reload the map using "changelevel" or "restart". sv_restart or sv_restartround will not work. This is because it is completely removed from memory and has to be reloaded again. I'll add functionality to remember deleted weapons soon.

YOU CANNOT CHANGE A PRIMARY WEAPON INTO A SECONDARY WEAPON.
amx_restrict_replace_awp "deagle"
will cause the plugin to fail to replace any weapons at all.
Attached Files
File Type: sma Get Plugin or Get Source (restmenu.sma - 4571 views - 28.9 KB)

Last edited by kurian; 03-20-2007 at 10:04. Reason: Update - Restores Deleted Weapons
kurian is offline
VEN
Veteran Member
Join Date: Jan 2005
Old 01-13-2007 , 07:24   Re: AMX Restrict Weapon + Drop on Pickup
Reply With Quote #2

Redundant, no original plugin's author in the topic title, unapproved.
VEN is offline
kurian
Member
Join Date: Aug 2005
Old 01-13-2007 , 10:09   Re: AMX Restrict Weapon + Drop on Pickup
Reply With Quote #3

Quote:
Originally Posted by VEN View Post
Redundant, no original plugin's author in the topic title, unapproved.
What original author ? Its a plugin that comes with the AMX Mod X installation.

How is it redundant ? There are no other properly working restrict plugins, other than MagicShot's in which you have to manually type the command each time you start the server because it doesnt work if u put the commands in the amxx.cfg. Read the posts on his plugin thread.
kurian is offline
VEN
Veteran Member
Join Date: Jan 2005
Old 01-13-2007 , 10:41   Re: AMXX Built-In Restrict Weapon + MagicShot's Drop on Pickup
Reply With Quote #4

I meant that you should prepend "AMXX Dev Team" to the topic title.
Also i do not see why would you want to drop the weapons, seems pointless. Why not just restrict weapons with the default AMX Mod X Restrict Weapons Plugin? What's wrong with it?
VEN is offline
AndraX2000
Member
Join Date: Mar 2006
Location: 39°57' N 83°14' W
Old 01-13-2007 , 10:51   Re: AMXX Built-In Restrict Weapon + MagicShot's Drop on Pickup
Reply With Quote #5

The shortcoming with the weapon restrict is that is does not restrict armory entities. I think this is why kurian was trying to force dropping restricted weapons.
__________________
Get maps at http://www.counter-strike-maps.net
Shoot me at:

AndraX2000 is offline
neogeo
Senior Member
Join Date: Jul 2005
Old 01-13-2007 , 16:38   Re: AMXX Built-In Restrict Weapon + MagicShot's Drop on Pickup
Reply With Quote #6

thx
it works perfectly
neogeo is offline
kurian
Member
Join Date: Aug 2005
Old 01-13-2007 , 21:14   Re: AMXX Built-In Restrict Weapon + MagicShot's Drop on Pickup
Reply With Quote #7

Quote:
Originally Posted by VEN View Post
Also i do not see why would you want to drop the weapons, seems pointless. Why not just restrict weapons with the default AMX Mod X Restrict Weapons Plugin? What's wrong with it?
The default Restrict plugin only prevents players from buying restricted weapons. But in maps such as fy_poolday and fy_iceworld players can still pickup a restricted weapon if its lying on the floor,
since these maps already have weapons lying around.

The modified plugin makes them drop it if its restricted.
And there are NO other *properly working* restrict plugins so its not redundant.
kurian is offline
AndraX2000
Member
Join Date: Mar 2006
Location: 39°57' N 83°14' W
Old 01-14-2007 , 01:19   Re: AMXX Dev Team's Restrict Weapon + MagicShot's Drop on Pickup
Reply With Quote #8

Players get annoyed by seeing a gun on the ground, running over to get it, and then finding that it flies out of their grasp. A better way would be to remove the armory entities that are restricted, that way the player will never have the opportunity to pick it up.

You could also change the restricted armory entity to another weapon. See AWP Armory To Scout and feel free to make a general Restricted Armory Changer plugin that works of a config file.

Or maybe a combo of the two thoughts above. Image a config like:

awp scout
ak47 m4a1
tmp none

In this example, any armory entities that are awps convert to scouts, any ak47s convert to m4a1s, and any tmps are removed from the map. That would be pretty slick.

If you don't want to get into doing all that, maybe I will make it in a few weeks when I'm a little less busy.

(Hmm, or maybe they could be vars like sv_change_awp = scout. That way you could have a different configuration for every map...)
__________________
Get maps at http://www.counter-strike-maps.net
Shoot me at:


Last edited by AndraX2000; 01-14-2007 at 01:22.
AndraX2000 is offline
VEN
Veteran Member
Join Date: Jan 2005
Old 01-14-2007 , 11:54   Re: AMXX Dev Team's Restrict Weapon + MagicShot's Drop on Pickup
Reply With Quote #9

There are "Remove weapons" and "Armoury Editor" by JGHG. Dropping isn't efficient solution.

Last edited by VEN; 01-14-2007 at 11:57.
VEN is offline
kurian
Member
Join Date: Aug 2005
Old 01-14-2007 , 21:22   Re: AMXX Dev Team's Restrict Weapon + MagicShot's Drop on Pickup
Reply With Quote #10

OK im remodifying the plugin.
BTW dropping is still required because thats the only thing that works with the bots. The bots can still buy restricted weapons and they are forced to drop them. So incase the player picks up a restricted weapon that is dropped by a bot, in that case he is forced to drop it.

I dont know how to remove a weapon after dropping it, as the dropped entity doesnt show up when finding entities by class name. Otherwise the bot dropped weapon can be removed.

Im adding functionality to replace all weapons already in the map by any weapon of choice, like AndraX2000 suggested.

The cvars will be amx_restrict_replace_awp "scout", etc. Any weapon can be replaced with any other.
kurian 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 09:56.


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