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

Ammo HUD Fix


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Abhinash
Senior Member
Join Date: Jan 2015
Location: India,kolkata
Old 08-02-2020 , 14:46   Ammo HUD Fix
Reply With Quote #1

Hey there.
I am using this function to set weapon, clip and bpammo.
Everything works fine.
But as we know HUD cannot display more than 255.
When I am setting the iClip to more than 255 for ex. 5000 then the HUD is messing up.
I want HUD Fix when iClip is more than 1000.
How can I do it ?
Can anyone edit and show me how to do it in Function, CurWeapon and AmmoX ?
Please ?

Function --
Code:
ode:
give_user_weapon( index , iWeaponTypeID , iClip=0 , iBPAmmo=0 , szWeapon[]="" , maxchars=0 )
{
	if ( !( CSW_P228 <= iWeaponTypeID <= CSW_P90 ) || ( iClip < 0 ) || ( iBPAmmo < 0 ) || !is_user_alive( index ) )
		return -1;
	
	new szWeaponName[ 20 ] , iWeaponEntity , bool:bIsGrenade;
	
	const GrenadeBits = ( ( 1 << CSW_HEGRENADE ) | ( 1 << CSW_FLASHBANG ) | ( 1 << CSW_SMOKEGRENADE ) | ( 1 << CSW_C4 ) );
	
	if ( ( bIsGrenade = bool:!!( GrenadeBits & ( 1 << iWeaponTypeID ) ) ) )
		iClip = clamp( iClip ? iClip : iBPAmmo , 1 );
	
	get_weaponname( iWeaponTypeID , szWeaponName , charsmax( szWeaponName ) );
	
	if ( ( iWeaponEntity = user_has_weapon( index , iWeaponTypeID ) ? find_ent_by_owner( -1 , szWeaponName , index ) : give_item( index , szWeaponName ) ) > 0 )
	{
		if ( iWeaponTypeID != CSW_KNIFE )
		{
			if ( iClip && !bIsGrenade )
				cs_set_weapon_ammo( iWeaponEntity , iClip );
		
			if ( iWeaponTypeID == CSW_C4 ) 
				cs_set_user_plant( index , 1 , 1 );
			else
				cs_set_user_bpammo( index , iWeaponTypeID , bIsGrenade ? iClip : iBPAmmo ); 
		}
		
		if ( maxchars )
			copy( szWeapon , maxchars , szWeaponName[7] );
	}
	
	return iWeaponEntity;
}
Abhinash is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 08-02-2020 , 14:49   Re: Ammo HUD Fix
Reply With Quote #2

You can't make the hud display more than 255.
__________________
HamletEagle is offline
Abhinash
Senior Member
Join Date: Jan 2015
Location: India,kolkata
Old 08-02-2020 , 14:56   Re: Ammo HUD Fix
Reply With Quote #3

Quote:
Originally Posted by HamletEagle View Post
You can't make the hud display more than 255.
Absolutely. That's why I want a fix for it. Can you show me how ?
Because, I want the fix to be used only when the iClip > 1000.
Can you tell me how ?
Abhinash is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 08-02-2020 , 15:58   Re: Ammo HUD Fix
Reply With Quote #4

I'm not sure if I am missing something here, but "the hud can't display more than 255" means there is no fix besides creating a custom hud message(which is not really a fix).
__________________
HamletEagle is offline
Abhinash
Senior Member
Join Date: Jan 2015
Location: India,kolkata
Old 08-03-2020 , 06:05   Re: Ammo HUD Fix
Reply With Quote #5

Quote:
Originally Posted by HamletEagle View Post
I'm not sure if I am missing something here, but "the hud can't display more than 255" means there is no fix besides creating a custom hud message(which is not really a fix).
Actually you didn't got me. I mean when the clip is more than 255, I want the HuD to show full all the time like in Unlimited clip plugin. Can you show me how to do that ?
Abhinash is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 08-03-2020 , 07:47   Re: Ammo HUD Fix
Reply With Quote #6

What is "show full" supposed to mean?
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Abhinash
Senior Member
Join Date: Jan 2015
Location: India,kolkata
Old 08-03-2020 , 08:29   Re: Ammo HUD Fix
Reply With Quote #7

Quote:
Originally Posted by OciXCrom View Post
What is "show full" supposed to mean?
Show full means it would show the max ammo of the respective gun
Abhinash is offline
Abhinash
Senior Member
Join Date: Jan 2015
Location: India,kolkata
Old 08-04-2020 , 13:16   Re: Ammo HUD Fix
Reply With Quote #8

Quote:
Originally Posted by OciXCrom View Post
What is "show full" supposed to mean?
Hey Oxi, look.
I want when iClip > 1000 then this fix should be applied --
Code:
set_msg_arg_int(3, get_msg_argtype(3), MAXCLIP[weapon])
Can you tell me how to do it ?
Abhinash is offline
Reply


Thread Tools
Display Modes

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 22:03.


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