Raised This Month: $32 Target: $400
 8% 

Solved fake ammo hud


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
man_s_our
Senior Member
Join Date: Jul 2017
Location: aim_taliban
Old 04-04-2018 , 17:34   fake ammo hud
Reply With Quote #1

how can I set ammo hud to a specific value that are different than real ammount.
__________________

Last edited by man_s_our; 04-10-2018 at 17:14.
man_s_our is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 04-04-2018 , 20:28   Re: fake ammo hud
Reply With Quote #2

Read up on HL game events

For what you want, you would hook CurWeapon event and modify the 3rd arg.

CurWeapon: This message updates the numerical magazine ammo count and the corresponding ammo type icon on the HUD.
  1. byte IsActive
  2. byte WeaponID
  3. byte ClipAmmo
PHP Code:

#include <amxmodx>

public plugin_init() 
{
    
register_messageget_user_msgid"CurWeapon" ) , "Message_CurWeapon" );
}

public 
Message_CurWeaponiMsgId iMsgDest id )
{
    
set_msg_arg_intARG_BYTE 99 );

You can do the same for backpack ammo.

AmmoX: This message updates the green bar indicator in the HUD weapons list. It also updates HUD backpack ammo number in the lower right corner of the screen if the given ammo type is compatible with the current weapon.
  1. byte AmmoID
  2. byte Amount
PHP Code:
#include <amxmodx>

public plugin_init() 
{
    
register_messageget_user_msgid"AmmoX" ) , "Message_AmmoX" );
}

public 
Message_AmmoXiMsgId iMsgDest id )
{
    
set_msg_arg_intARG_BYTE 98 );

__________________

Last edited by Bugsy; 04-04-2018 at 20:35.
Bugsy is offline
man_s_our
Senior Member
Join Date: Jul 2017
Location: aim_taliban
Old 04-05-2018 , 06:56   Re: fake ammo hud
Reply With Quote #3

thank you for the answer
__________________
man_s_our is offline
man_s_our
Senior Member
Join Date: Jul 2017
Location: aim_taliban
Old 04-05-2018 , 12:28   Re: fake ammo hud
Reply With Quote #4

how to update it?
__________________
man_s_our is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 04-05-2018 , 12:55   Re: fake ammo hud
Reply With Quote #5

What do you mean? You need to explain specifically what you want to do.
__________________
Bugsy is offline
man_s_our
Senior Member
Join Date: Jul 2017
Location: aim_taliban
Old 04-05-2018 , 13:09   Re: fake ammo hud
Reply With Quote #6

I'm adding a new weapon to the first slot and I need to update ammo hud after every shot
__________________
man_s_our is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 04-05-2018 , 13:22   Re: fake ammo hud
Reply With Quote #7

Replace 99 with whatever number you want...
__________________
Bugsy is offline
man_s_our
Senior Member
Join Date: Jul 2017
Location: aim_taliban
Old 04-05-2018 , 13:53   Re: fake ammo hud
Reply With Quote #8

PHP Code:
public Message_CurWeaponiMsgId iMsgDest id )
{
        
set_msg_arg_int(3ARG_BYTE ,  min(1Bazooka_Ammo[id]));
}
public 
Message_AmmoXiMsgId iMsgDest id )
{
        
set_msg_arg_int(2ARG_BYTE max(Bazooka_Ammo[id] - 10));

I did this but it's fixed at 1:0
__________________
man_s_our is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 04-05-2018 , 16:24   Re: fake ammo hud
Reply With Quote #9

I have no idea how Bazooka_ammo[] data is being set so I cannot help.
__________________
Bugsy is offline
man_s_our
Senior Member
Join Date: Jul 2017
Location: aim_taliban
Old 04-05-2018 , 16:32   Re: fake ammo hud
Reply With Quote #10

till now I have this plugin.
I need to set ammo and bpammo to those values every time the player use the bazooka (m3 & has_bazooka[id])
Attached Files
File Type: sma Get Plugin or Get Source (bazooka s1.sma - 718 views - 34.8 KB)
__________________
man_s_our 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 22:53.


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