Quote:
Originally Posted by HamletEagle
Using WeapPickup for this is a poor solution. You should hook Ham_Touch with weaponbox/armoury_entity, check if they contain an AWP and if so, block.
How do you check that?
For weaponbox entity: Check m_rgpPlayerItems offset(the CWeaponBox offset, not CBasePlayer), slot 1 with get_pdata_cbase. If if returns a valid entity, retrieve the classname with pev_classname and compare it with weapon_awp. If you need more details about this, search, you will find a ton of examples.
For armoury_entity read here: https://forums.alliedmods.net/showthread.php?t=250922
|
PHP Code:
public OnPlayerTouchWeaponBox(ent, id)
{
new iId = cs_get_weapon_id(ent);
if( iId == CSW_AWP )
{
if(equali(g_mapname, "de_dust2_2x2") || equali(g_mapname, "de_dust2_long"))
{
console_cmd(id,"drop weapon_awp");
CC_SendMessage(id, "&x01>> &x04AWP je zabranjen na malim mapama!");
}
else if(g_HasVIP[id] != 1)
{
console_cmd(id,"drop weapon_awp");
CC_SendMessage(id, "&x01>> &x04AWP je zabranjen na malim mapama!");
}
}
}
I tried something like this, but it doesn't work
__________________