Quote:
Originally Posted by nonameguy123
|
That's for the mod or weapon they are showing. There is absolutely no need IMHO for anything of the sort unless there is a weapon/mod being used that increases the magazine beyond the original design limit of the game. The one in the video has health and more plus is inaccurate watching the video. The old stock HUD is still there. That looks like hell.
Regardless. Here is functional concept code on how to make.
Figure out where you want the HUD.
PHP Code:
#include amxmodx
#include engine
/*CVAR: ammo_hud 2 - only show when stock HUD fails.*/
#define MAX_HUD 100
new ammo, magazine, wpnid, new_hud;
public plugin_init()
{
register_plugin("New Ammo HUD", "1.0", "SPiNX");
new_hud = register_cvar("ammo_hud", "1");
}
public client_PreThink(plr)
if(get_pcvar_num(new_hud) && plr > 0 && !is_user_bot(plr) && is_user_alive(plr))
@check(plr)
@check(plr)
{
new check = get_pcvar_num(new_hud)
weapon_details(plr)
static mag_offset = MAX_HUD;
if(magazine > mag_offset && check > 1 || check == 1)
make_new_ammo_hud(plr);
}
public make_new_ammo_hud(plr)
{
set_hudmessage( 50/*R*/, 255/*G*/, 0/*B*/, 0.9/*X*/, 0.9/*Y*/, 0, 0.5, 0.5 )
show_hudmessage(plr, " %i %i " , magazine, ammo )
}
stock weapon_details(plr)
{
wpnid = get_user_weapon(plr, magazine, ammo);
return wpnid, magazine, ammo;
}
Expanded version.
Removes and replaces various aspects of stock HUD with animated cross-hair when firing or holding special weapons.
Turns itself off when driving as network loss safeguard.
__________________