Hey I was wondering if you had any idea on how to fix this issue.
We discussed it a little on steam.
This is important for servers that block some weapons in some rounds etc.
Plugin 1 using PTaH:
public void OnPluginStart()
PTaH(PTaH_GiveNamedItemPre, Hook, GiveNamedItemPre);
PTaH(PTaH_WeaponCanUse, Hook, WeaponCanUse);
public void GiveNamedItemPre(int client, char classname, CEconItemView &item, bool &ignoredCEconItemView)
//Do anything here to ak47 here or do nothing
public bool WeaponCanUse(int client, int ent, bool canuse)
//check if ent is the ak47 here etc
public void OnClientPutInServer(int client)
SDKHook(client, SDKHook_WeaponCanUse, Hook_BlockPickup);
public Action Hook_BlockPickup(int client, int weapon)
GetEntityClassname(weapon, weaponClass, sizeof(weaponClass));
if (StrEqual(weaponClass, "weapon_ak47"))
In this case, the AK47 will always be equipped even if other plugins use SDKHooks with SDKHook_WeaponCanUse to block it. A lot of plugins use this so it would be good if there was a solution for this.
Why does returning Plugin_Changed
without changing anything cause the weapon to not be able to be picked up? I'm sure this can be fixed so the weapon can still be picked up by default without needing to use the PTaH weaponcanuse. That way you can just use SDKHooks only for WeaponCanUse.
What does removeIfNotCarried
Maybe using MRES_OVERRIDE
I did some testing, will try some more stuff later.
Let me know if you have any ideas.