Thread: [Solved] fake ammo hud
View Single Post
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 04-04-2018 , 20:28   Re: fake ammo hud
Reply With Quote #2

Read up on HL game events

For what you want, you would hook CurWeapon event and modify the 3rd arg.

CurWeapon: This message updates the numerical magazine ammo count and the corresponding ammo type icon on the HUD.
  1. byte IsActive
  2. byte WeaponID
  3. byte ClipAmmo
PHP Code:

#include <amxmodx>

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

public 
Message_CurWeaponiMsgId iMsgDest id )
{
    
set_msg_arg_intARG_BYTE 99 );

You can do the same for backpack ammo.

AmmoX: This message updates the green bar indicator in the HUD weapons list. It also updates HUD backpack ammo number in the lower right corner of the screen if the given ammo type is compatible with the current weapon.
  1. byte AmmoID
  2. byte Amount
PHP Code:
#include <amxmodx>

public plugin_init() 
{
    
register_messageget_user_msgid"AmmoX" ) , "Message_AmmoX" );
}

public 
Message_AmmoXiMsgId iMsgDest id )
{
    
set_msg_arg_intARG_BYTE 98 );

__________________

Last edited by Bugsy; 04-04-2018 at 20:35.
Bugsy is offline