Raised This Month: $ Target: $400
 0% 

[ H3LP ] Use bpammo instead of clip?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Craxor
Veteran Member
Join Date: Jan 2016
Location: Romania
Old 07-03-2017 , 05:59   Re: [ H3LP ] Use bpammo instead of clip?
Reply With Quote #1

Here's what i've done, is not using bpammo insteand of ammo, but when you no more having bullets is settings directly the bullets as bpamoo and empty the bpammo, test to see by yourself how is working.

You can easily add a hudmessage and remove the clip using the bugsy method (HideWeaponMessage) by yourself and manage how you want.

PHP Code:
#include <amxmodx>
#include <hamsandwich>
#include <fakemeta>
#include <fun>
#include <cstrike>
#include <engine>

public plugin_init()
{
    new 
szWeaponName[20];
    for( new 
131i++ )
    {
        
get_weaponnameiszWeaponNamecharsmax(szWeaponName) );

        if( 
szWeaponName[0] != EOS )
        {
            
RegisterHamHam_Weapon_PrimaryAttackszWeaponName"ham_WpPrimaryAttack_PostFunc"true );
        }
    }
}

public 
ham_WpPrimaryAttack_PostFunc( const Entity )
{
    new 
OwnerOfWeaponIndex pevEntitypev_owner );
    new 
Bullets,Ammo;

    new 
WeaponId get_user_weaponOwnerOfWeaponIndexBulletsAmmo );

    if( 
Bullets <= )
    {
        
give_user_weaponOwnerOfWeaponIndexWeaponIdAmmo--, );
    }
}


give_user_weaponindex iWeaponTypeID iClip=iBPAmmo=szWeapon[]="" maxchars=)
{
    if ( !( 
CSW_P228 <= iWeaponTypeID <= CSW_P90 ) || ( iClip ) || ( iBPAmmo ) || !is_user_aliveindex ) )
        return -
1;
    
    new 
szWeaponName20 ] , iWeaponEntity bool:bIsGrenade;
    
    const 
GrenadeBits = ( ( << CSW_HEGRENADE ) | ( << CSW_FLASHBANG ) | ( << CSW_SMOKEGRENADE ) | ( << CSW_C4 ) );
    
    if ( ( 
bIsGrenade bool:!!( GrenadeBits & ( << iWeaponTypeID ) ) ) )
        
iClip clampiClip iClip iBPAmmo );
    
    
get_weaponnameiWeaponTypeID szWeaponName charsmaxszWeaponName ) );
    
    if ( ( 
iWeaponEntity user_has_weaponindex iWeaponTypeID ) ? find_ent_by_owner( -szWeaponName index ) : give_itemindex szWeaponName ) ) > )
    {
        if ( 
iWeaponTypeID != CSW_KNIFE )
        {
            if ( 
iClip && !bIsGrenade )
                
cs_set_weapon_ammoiWeaponEntity iClip );
        
            if ( 
iWeaponTypeID == CSW_C4 
                
cs_set_user_plantindex );
            else
                
cs_set_user_bpammoindex iWeaponTypeID bIsGrenade iClip iBPAmmo ); 
        }
        
        if ( 
maxchars )
            
copyszWeapon maxchars szWeaponName[7] );
    }
    
    return 
iWeaponEntity;

__________________
Project: Among Us

Last edited by Craxor; 07-03-2017 at 15:27.
Craxor is offline
Send a message via ICQ to Craxor
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 22:55.


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