PDA

View Full Version : Block Weapon Pick up without Removing Weapons [SOLVED]


spunkster21
04-23-2010, 05:28
Hi,

I'm trying to block weapons from being picked up without having them removed. I can easily block weapon pick up using SDKHooks, but this method causes the weapon to be physically removed when someone walks over it.

I'm also familiar with forcing a client to drop a picked up weapon, but this allows clients to move weapons.

Does anyone know of a reliable method for blocking weapon pick up completely? I.e. the weapon is not picked up and remains exactly where it is?

I've searched the forum and found reference to a plugin by Liam, but could not understand how it worked.

Any help would be appreciated.

Thanks.

selax
04-23-2010, 05:57
I use SDKhooks, but this not remove weapons...
In my function only counter-terrorists can pick up and use weapon.
public OnClientPutInServer(client)
{
SDKHook(client, SDKHook_WeaponCanUse, OnWeaponCanUse);
}

public Action:OnWeaponCanUse(client, weapon)
{
if(GetClientTeam(client) == 3)
{
return Plugin_Continue;
}
return Plugin_Handled;
}

spunkster21
04-23-2010, 08:54
I use SDKhooks, but this not remove weapons...
In my function only counter-terrorists can pick up and use weapon.
public OnClientPutInServer(client)
{
SDKHook(client, SDKHook_WeaponCanUse, OnWeaponCanUse);
}

public Action:OnWeaponCanUse(client, weapon)
{
if(GetClientTeam(client) == 3)
{
return Plugin_Continue;
}
return Plugin_Handled;
}

Doh!

I've been using SDKHook_WeaponEquip I'll switch to SDKHook_WeaponCanUse

Thanks.