 |
|
Senior Member
Join Date: Feb 2010
Location: Germany
|

10-30-2013
, 11:39
Re: Add Admin immunity here?
|
#3
|
Quote:
Originally Posted by simanovich
Because the passed entity index is the weapon entity index and not the player id.
PHP Code:
#include <amxmodx>
#include <hamsandwich>
const XO_CBASEPLAYERITEM = 4;
const m_iId = 43;
public plugin_init()
{
register_plugin("Block Attack", "1.0", "LeOnArD");
/*Aqui poner el nombre de las armas que quieras Bloquear.
Here you put the name of the weapons that you want the Block.*/
RegisterHam( Ham_Weapon_PrimaryAttack, "weapon_knife", "PrimaryAttack" );
RegisterHam( Ham_Weapon_SecondaryAttack, "weapon_knife", "SecondaryAttack" );
RegisterHam( Ham_Weapon_PrimaryAttack, "weapon_usp", "PrimaryAttack" );
RegisterHam( Ham_Weapon_SecondaryAttack, "weapon_usp", "SecondaryAttack" );
/*Aqui estan las armas que le pueden Bloquear la Accion Secundaria.
Here are the weapons that can Block the Secondary Action.*/
RegisterHam( Ham_Weapon_SecondaryAttack, "weapon_awp", "SecondaryAttack" );
RegisterHam( Ham_Weapon_SecondaryAttack, "weapon_scout", "SecondaryAttack" );
RegisterHam( Ham_Weapon_SecondaryAttack, "weapon_g3sg1", "SecondaryAttack" );
RegisterHam( Ham_Weapon_SecondaryAttack, "weapon_sg550", "SecondaryAttack" );
}
public PrimaryAttack( const entity )
{
static client;
client = get_pdata_base(entity, m_iId, XO_CBASEPLAYERITEM);
if (!is_user_alive(client))
return HAM_IGNORED;
if (get_user_flags(client) & ADMIN_IMMUNITY)
return HAM_IGNORED;
return HAM_SUPERCEDE;
}
public SecondaryAttack( const entity )
{
static client;
client = get_pdata_base(entity, m_iId, XO_CBASEPLAYERITEM);
if (!is_user_alive(client))
return HAM_IGNORED;
if (get_user_flags(client) & ADMIN_IMMUNITY)
return HAM_IGNORED;
return HAM_SUPERCEDE;
}
|
I am getting an "undefined symbol" error: get_pdata_base
|
|
|
|