Ok here is what I am trying to do.  I am trying to make a new VGUI hud, I have done many before.  But this ones seeming to have a problem.  When I make the ammo panel and try to set the text to the current ammo count the game will crash.  I have declared a new varible in CHudAmmo called m_iAmmo1 for the primary ammo.  But when I do the following code in my update function the game crashes.
 
Code I am using:
 
IN HUD:
 
sprintf(PlayerAmmo, "%d",gHUD.m_Ammo.m_iAmmo1);
m_pAmmo->setText(PlayerAmmo);
IN CHUDAMMO:
 
at the bottom of the draw function i have:
// Ammo
 
m_iClip = pw->iClip;
 
m_iAmmo1 = gWR.CountAmmo(pw->iAmmoType);
 
// Ammo
 
Has anyone ever seen this or know whats wrong?  Maybe another way to do it posibly?
 
Thanks,

Reply via email to