Raised This Month: $ Target: $400
 0% 

[ H3LP ] Use bpammo instead of clip?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 06-17-2017 , 13:23   Re: [ H3LP ] Use bpammo instead of clip?
Reply With Quote #2

I'm not sure it's possible to hide just the clip ammo. You could possibly make it display 0 or some constant value.

I was thinking HideWeapon message, but this hides other things in addition to ammo.
Code:
  1   (1<<0)  -  crosshair, ammo, weapons list
  2   (1<<1)  -  flashlight, +
  4   (1<<2)  -  ALL
  8   (1<<3)  -  radar, health, armor, +
 16   (1<<4)  -  timer, +
 32   (1<<5)  -  money, +
 64   (1<<6)  -  crosshair
128   (1<<7)  -  +
This will show clip as always 0 (or whatever you want it to show as) and subtract from bpammo as shots are fired. It needs a little work but it's something to start with:
PHP Code:

#include <amxmodx>
#include <cstrike>
#include <hamsandwich>

#define m_pActiveItem 373

const WeaponType CSW_GLOCK18//Weapon that you want this plugin to apply to
const DisplayClip 0//Clip ammo that will display regardless of actual contents

enum _:CurWeaponArgs
{
    
IsActive 1,
    
WeaponID,
    
ClipAmmo
}

public 
plugin_init() 
{
    
register_messageget_user_msgid"CurWeapon" ) , "CurWeapon" );
}

public 
CurWeaponmsg_id msg_dest msg_entity )
{
    new 
iClip iBP iWeaponEnt;
    
    if ( ( 
get_msg_arg_intIsActive ) == ) && ( get_msg_arg_intWeaponID ) == WeaponType ) )
    {
        
get_user_ammomsg_entity WeaponType iClip iBP );
        
iWeaponEnt get_pdata_cbasemsg_entity m_pActiveItem );
        
        if ( 
iBP >= )
        {
            
cs_set_user_bpammomsg_entity WeaponType , --iBP );
            
cs_set_weapon_ammoiWeaponEnt 40 );
        }
        else
        {
            
cs_set_weapon_ammoiWeaponEnt );
        }
        
        
set_msg_arg_intClipAmmo DisplayClip );
    }

__________________

Last edited by Bugsy; 06-17-2017 at 14:05.
Bugsy 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 22:55.


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