Quote:
Originally Posted by shanapu
Some time ago a read in a thread to use SDKHooks_DropWeapon instead of RemovePlayerItem or CS_DropWeapon. But unfortunately I can't find it or remember the advanced of using SDKHooks instead. Also, I never recognized a crash related to RemovePlayerItem.
PHP Code:
SDKHooks_DropWeapon(client, weapon, NULL_VECTOR, NULL_VECTOR); AcceptEntityInput(iWeapon, "Kill");
|
Still crash
Code:
#include <sdkhooks>
public OnPluginStart()
{
RegConsoleCmd("sm_testi", test);
}
public Action:test(client, args)
{
new glock = GetPlayerWeaponSlot(client, 1);
new knife = GetPlayerWeaponSlot(client, CS_SLOT_KNIFE);
SDKHooks_DropWeapon(client, glock, NULL_VECTOR, NULL_VECTOR);
EquipPlayerWeapon(client, knife);
return Plugin_Handled;
}
But if we will pick pistol or buy, there will be no crash