Raised This Month: $51 Target: $400
 12% 

[REQ] block Shooting


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
plowed
Senior Member
Join Date: Oct 2010
Location: germany
Old 07-30-2011 , 22:54   [REQ] block Shooting
Reply With Quote #1

Is there a plugin that block complete shooting? Or better if someone try to shoot the ammos should be are always empty.
plowed is offline
Aykay
Senior Member
Join Date: Jul 2009
Location: Australia
Old 07-31-2011 , 00:44   Re: [REQ] block Shooting
Reply With Quote #2

PHP Code:
#include <amxmodx>
#include <hamsandwich>

#define PLUGIN "No damage taken."
#define VERSION "1.0"
#define AUTHOR "Aykay"


public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
RegisterHam(Ham_TakeDamage"player""fw_TakeDamage_Pre"0);
}

public 
fw_TakeDamage_Pre(victiminflictorattackerFloat:damagedamagebits)
{
    
SetHamParamFloat(40.0)

^No damage will be taken at all. Is that what you wanted?
__________________

Aykay is offline
Send a message via MSN to Aykay
nikhilgupta345
Veteran Member
Join Date: Aug 2009
Location: Virginia
Old 07-31-2011 , 01:09   Re: [REQ] block Shooting
Reply With Quote #3

Try this:
PHP Code:
#include <amxmodx>
#include <hamsandwich>

public plugin_init() 
{
    
register_plugin("No shooting""1.0""H3avY Ra1n")

    new 
szWeaponName32 ];

    for( new 
CSW_P228<= CSW_P90i++ )
    {
        
get_weaponnameiszWeaponNamecharsmaxszWeaponName ) );
        
        
RegisterHamHam_Weapon_PrimaryAttackszWeaponName"Ham_PrimaryAttack" );
    }
}

public 
Ham_PrimaryAttackiEnt )
{
    return 
HAM_SUPERCEDE;

__________________
Quote:
Originally Posted by DarkGod View Post
nikhilgupta generates his plugins using sheer awesome.
If you like my work, please
nikhilgupta345 is offline
Send a message via ICQ to nikhilgupta345 Send a message via Yahoo to nikhilgupta345
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 07-31-2011 , 01:28   Re: [REQ] block Shooting
Reply With Quote #4

Quote:
Originally Posted by nikhilgupta345 View Post
Try this:
PHP Code:
#include <amxmodx>
#include <hamsandwich>

public plugin_init() 
{
    
register_plugin("No shooting""1.0""H3avY Ra1n")

    new 
szWeaponName32 ];

    for( new 
CSW_P228<= CSW_P90i++ )
    {
        
get_weaponnameiszWeaponNamecharsmaxszWeaponName ) );
        
        
RegisterHamHam_Weapon_PrimaryAttackszWeaponName"Ham_PrimaryAttack" );
    }
}

public 
Ham_PrimaryAttackiEnt )
{
    return 
HAM_SUPERCEDE;

That will give a model twitch when trying to shoot.
Also, you didn't check for valid weapon name.

Better method:

PHP Code:
#include <amxmodx>
#include <hamsandwich>

#define m_flNextPrimaryAttack            46
#define m_flNextSecondaryAttack            47
#define m_flTimeWeaponIdle            48

public plugin_init() 
{
    
register_plugin("No shooting""1.0""H3avY Ra1n")

    new 
szWeaponName32 ];

    for( new 
CSW_P228<= CSW_P90i++ )
    {
        if( 
get_weaponnameiszWeaponNamecharsmaxszWeaponName ) ) )
        {
            
RegisterHamHam_Item_DeployszWeaponName"HamWeaponDeployPost");
        }
    }
}

public 
HamWeaponDeployPostiEnt )
{
    
set_pdata_floatiEntm_flNextPrimaryAttack9999.0);
    
set_pdata_floatiEntm_flNextSecondaryAttack9999.0);
    
set_pdata_floatiEntm_flTimeWeaponIdle9999.0);

__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
nikhilgupta345
Veteran Member
Join Date: Aug 2009
Location: Virginia
Old 07-31-2011 , 02:12   Re: [REQ] block Shooting
Reply With Quote #5

Quote:
Originally Posted by Exolent[jNr] View Post
That will give a model twitch when trying to shoot.
Also, you didn't check for valid weapon name.

Better method:

PHP Code:
#include <amxmodx>
#include <hamsandwich>

#define m_flNextPrimaryAttack            46
#define m_flNextSecondaryAttack            47
#define m_flTimeWeaponIdle            48

public plugin_init() 
{
    
register_plugin("No shooting""1.0""H3avY Ra1n")

    new 
szWeaponName32 ];

    for( new 
CSW_P228<= CSW_P90i++ )
    {
        if( 
get_weaponnameiszWeaponNamecharsmaxszWeaponName ) ) )
        {
            
RegisterHamHam_Item_DeployszWeaponName"HamWeaponDeployPost");
        }
    }
}

public 
HamWeaponDeployPostiEnt )
{
    
set_pdata_floatiEntm_flNextPrimaryAttack9999.0);
    
set_pdata_floatiEntm_flNextSecondaryAttack9999.0);
    
set_pdata_floatiEntm_flTimeWeaponIdle9999.0);

What does m_flTimeWeaponIdle control exactly? How long it is idle for?
__________________
Quote:
Originally Posted by DarkGod View Post
nikhilgupta generates his plugins using sheer awesome.
If you like my work, please
nikhilgupta345 is offline
Send a message via ICQ to nikhilgupta345 Send a message via Yahoo to nikhilgupta345
plowed
Senior Member
Join Date: Oct 2010
Location: germany
Old 07-31-2011 , 09:35   Re: [REQ] block Shooting
Reply With Quote #6

This is good Exolent but can you add the sound which is always when the weapon is empty? Or just set the ammo always to 0? Because I want that only possible to knife. Other weapons should always empty.
plowed is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 07-31-2011 , 15:53   Re: [REQ] block Shooting
Reply With Quote #7

Code:
#include < amxmodx > #include < cstrike > #include < hamsandwich > #define m_pPlayer 41 #define m_iId 43 public plugin_init( ) {     new szWeaponName[ 32 ];     for( new i = CSW_P228; i <= CSW_P90; i++ )     {         if( get_weaponname( i, szWeaponName, charsmax( szWeaponName ) ) )         {             RegisterHam( Ham_Item_Deploy, szWeaponName, "HamWeaponDeployPost", 1 );         }     } } public HamWeaponDeployPost( iEntity ) {     new iPlayer = get_pdata_cbase( iEntity, m_pPlayer, 4 );     new iWeaponID = get_pdata_int( iEntity, m_iId, 4 );         cs_set_weapon_ammo( iEntity, 0 );     cs_set_user_bpammo( iPlayer, iWeaponID, 0 ); }
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
plowed
Senior Member
Join Date: Oct 2010
Location: germany
Old 07-31-2011 , 23:13   Re: [REQ] block Shooting
Reply With Quote #8

It doesnt work first if player spawn but after that its perfect ;) ty
plowed is offline
Reply



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 14:58.


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