Raised This Month: $51 Target: $400
 12% 

Made ammo hud


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
nonameguy123
Junior Member
Join Date: May 2017
Location: Wakanda
Old 02-15-2021 , 08:33   Made ammo hud
Reply With Quote #1

anyone know how to make ammo hud like this? https://youtu.be/6FPjRbn4UtQ
__________________
Mellowzy Gaming ID
nonameguy123 is offline
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 03-29-2021 , 01:52   Re: Made ammo hud
Reply With Quote #2

Quote:
Originally Posted by nonameguy123 View Post
anyone know how to make ammo hud like this? https://youtu.be/6FPjRbn4UtQ
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 ammomagazinewpnidnew_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 && !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 || check == 1)
        
make_new_ammo_hud(plr);
}

public 
make_new_ammo_hud(plr)
{
    
set_hudmessage50/*R*/255/*G*/0/*B*/0.9/*X*/0.9/*Y*/00.50.5 )
    
show_hudmessage(plr"     %i         %i  " magazineammo )
}

stock weapon_details(plr)
{
    
wpnid get_user_weapon(plrmagazineammo);
    return 
wpnidmagazineammo;

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.
__________________
DJEarthQuake is offline
nG_getwreck
Senior Member
Join Date: Oct 2020
Location: Philippines from South K
Old 04-01-2021 , 14:06   Re: Made ammo hud
Reply With Quote #3

Quote:
Originally Posted by nonameguy123 View Post
anyone know how to make ammo hud like this? https://youtu.be/6FPjRbn4UtQ
Found this somewhere:
PHP Code:
stock Func_ShowAmmoX(iPlayeriAmount)

    
message_begin(MSG_ONE_UNRELIABLEget_user_msgid("AmmoX"), _iPlayer); 
    
write_byte(iAmmoID); 
    
write_byte(iAmount); 
    
message_end(); 
}

In the weapon's weapolist in the third "write_byte" the number should be more than 18 or 20, I do not remember. Like 25. iAmmoID should be replaced with that number. They have to be the same. iAmount - it is what you want to show. 
__________________
nG_getwreck is offline
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 23:51.


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