Try this script, place it in a dynamic (static = no), always active entity. You can change the location and size of the text and sprite by changing the numbers in the HUD Locations and Sizes section.
Name it ammo_hud.lua
-- This is what goes inside of a dynamic always active entity --
-------------------- HUD Locations and Sizes --------------------
-- Ammo --
--text location
local ammo_tex_posx = 5
local ammo_tex_posy = 1
local ammo_text_size = 5
--sprite location
local ammo_spr_posx = 2
local ammo_spr_posy = 1
--sprite size
local ammo_spr_sizex = 6
local ammo_spr_sizey = 4
function ammo_hud_init(e)
-------------------- HUD Sprites --------------------
ammo_sprite = LoadImage("scriptbank\\images\\ammo.png")
ammo_icon = CreateSprite(ammo_sprite)
SetSpriteSize (ammo_icon,ammo_spr_sizex,ammo_spr_sizey)
SetSpriteDepth (ammo_sprite, 100)
SetSpritePosition(ammo_icon,300,300)
end
function ammo_hud_main(e)
-------------------- Hide Default HUD --------------------
HideHuds()
-------------------- Display Ammo --------------------
PasteSpritePosition(ammo_icon,ammo_spr_posx,ammo_spr_posy)
TextCenterOnX(ammo_tex_posx,ammo_tex_posy,ammo_text_size,""..g_PlayerGunAmmoCount.." / "..g_PlayerGunClipCount)
end
You will need to create a background image called ammo.png and place it in your scriptbank\images folder.
i5, NV960 2GB, 16GB memory, 2x 2TB Hybrid, Win10.