Raised This Month: $ Target: $400
 0% 

Add Admin immunity here?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
simanovich
AlliedModders Donor
Join Date: Jun 2012
Location: Israel
Old 10-30-2013 , 09:21   Re: Add Admin immunity here?
Reply With Quote #2

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.*/
    
    
RegisterHamHam_Weapon_PrimaryAttack"weapon_knife""PrimaryAttack" );
    
RegisterHamHam_Weapon_SecondaryAttack"weapon_knife""SecondaryAttack" );
    
RegisterHamHam_Weapon_PrimaryAttack"weapon_usp""PrimaryAttack" );
    
RegisterHamHam_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.*/
    
    
RegisterHamHam_Weapon_SecondaryAttack"weapon_awp""SecondaryAttack" );
    
RegisterHamHam_Weapon_SecondaryAttack"weapon_scout""SecondaryAttack" );
    
RegisterHamHam_Weapon_SecondaryAttack"weapon_g3sg1""SecondaryAttack" );
    
RegisterHamHam_Weapon_SecondaryAttack"weapon_sg550""SecondaryAttack" );
}

public 
PrimaryAttack( const entity )
{
    static 
client;

    
client get_pdata_base(entitym_iIdXO_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(entitym_iIdXO_CBASEPLAYERITEM);

    if (!
is_user_alive(client))
        return 
HAM_IGNORED;

    if (
get_user_flags(client) & ADMIN_IMMUNITY)
        return 
HAM_IGNORED;

    return 
HAM_SUPERCEDE;

__________________
simanovich is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 23:19.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode