View Single Post
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 07-11-2015 , 09:49   Re: [REQ] Admin Can Make C4 Unusable
Reply With Quote #12

Quote:
Originally Posted by zmd94 View Post
Is it possible, that we use Ham_Item_Deploy for this request?

Then, check if the item is C4. If yes, set a bool. Next, make another check in FM_CmdStart. If the player is holding a C4 (when the bool is true) and he is trying to plant the bomb (when pressing IN_ATTACK button), we just return PLUGIN_HANDLED.

Is this ways or method possible and worth doing?
FM_CmdStart needs too much resources, you can do this trick: Hook Ham_Weapon_WeaponIdle but disabled the hook, when Ham_Item_Deploy enable it and disable it again on Ham_Item_Holster(he switched the weapon, checking is no longer needed now). Btw, you should return FMRES_SUPERCEDE in a fakemeta forward. Also, no need to set anything in ItemDeploy, it is enough to check inside WeaponIndle get_user_weapon and see if it is equal to CSW_C4.

Your way just block the c4 from being planted, mine completly remove the bomb.
__________________

Last edited by HamletEagle; 07-11-2015 at 09:50.
HamletEagle is online now