CS_OnBuyAttempt forward is only available in amxmodx version 1.8.3 or later.
You will need to update your amxmodx. An alternative is this https://forums.alliedmods.net/showthread.php?t=198486 or use the built-in restrict weapons plugin, called restmenu.amxx