alliedmodders / amxmodx

AMX Mod X - Half-Life 1 Scripting and Administration
http://www.amxmodx.org/
496 stars 201 forks source link

Feature Request: Strip specific weapon(s) #583

Open OciXCrom opened 6 years ago

OciXCrom commented 6 years ago

An option to remove specific weapons from a player is highly needed, as well as to remove all weapons from a slot. The closest we have right now is using strip_user_weapons which removes all weapons. This native can either be upgraded to hold a weapon slot or a enitrely new one can be added. Making a plugin that needs to remove specific weapons is really a problem nowadays because the only known way to do it in regular AMXX is by using the stripweapons.inc library which for some reason fails to work when the server is using ReAPI/ReGameDLL.

Arkshine commented 6 years ago

For the record, you still have the generic fm_strip_user_gun stock. It drops and forces think the entity to remove it.

For CS, having a native is welcomed. Ideally, we should have something like that: https://github.com/s1lentq/ReGameDLL_CS/blob/26db32e8845647cf024e38f11cb3da3071ac0dd1/regamedll/dlls/API/CSPlayer.cpp#L135-L276 which properly removes the item. The annoying thing is for HLDS, it will require some effort to translate that into the native, especially virtual funtions (hamdata.ini should be moved to gamedata beforehand), etc.

OciXCrom commented 6 years ago

I know about the stock, but it still isn't much help when you need to remove all weapons from a slot which is a very common thing to do.

SmiteIsTrashBro commented 6 years ago

because the only known way to do it in regular AMXX is by using the stripweapons.inc library which for some reason fails to work when the server is using ReAPI/ReGameDLL.

If server is running ReAPI/ReGameDLL, makes no sense to use stripweapons.inc instead of rg_remove_items_by_slot of reapi_gamedll.inc.

OciXCrom commented 6 years ago

@CrazY770 Yes, but when releasing a public plugin you can't know if someone is going to use the plugin with ReAPI or with default AMXX.