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.
- byte IsActive
- byte WeaponID
- byte ClipAmmo
PHP Code:
#include <amxmodx>
public plugin_init()
{
register_message( get_user_msgid( "CurWeapon" ) , "Message_CurWeapon" );
}
public Message_CurWeapon( iMsgId , iMsgDest , id )
{
set_msg_arg_int( 3 , ARG_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.
- byte AmmoID
- byte Amount
PHP Code:
#include <amxmodx>
public plugin_init()
{
register_message( get_user_msgid( "AmmoX" ) , "Message_AmmoX" );
}
public Message_AmmoX( iMsgId , iMsgDest , id )
{
set_msg_arg_int( 2 , ARG_BYTE , 98 );
}
__________________