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

Secondary ammo


Post New Thread Reply   
 
Thread Tools Display Modes
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 12-27-2021 , 12:24   Re: Secondary ammo
Reply With Quote #11

Quote:
Originally Posted by Celena Luna View Post
With custom weapon hud is possible but since steam updated making the cstrike_download, custom hud broke
Using custom hud sprites works just fine.
__________________
HamletEagle is offline
Hellkong
Member
Join Date: Nov 2021
Old 01-08-2022 , 08:34   Re: Secondary ammo
Reply With Quote #12

So attaching ammo2 to the HUD and preparing :
PHP Code:
    message_begin(MSG_ONEget_user_msgid("SecAmmoVal"), _Index)
    
write_byte(N)
    
write_byte(X
Hellkong is offline
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 01-08-2022 , 16:33   Re: Secondary ammo
Reply With Quote #13

The weapon in the picture you provided is using a combination of ammo2 in the weapon list file with the AmmoX message.



Code:
#include <amxmodx>
#include <hamsandwich>
#include <fun>
#include <fakemeta>

new g_msgWeaponList, g_msgAmmoX

public plugin_init()
{
	register_plugin("plugin", "version", "author")

	RegisterHam(Ham_Item_AddToPlayer, "weapon_m249", "OnItemAddToPlayerPost", 1)

	g_msgWeaponList = get_user_msgid("WeaponList")
	g_msgAmmoX = get_user_msgid("AmmoX")

	register_clcmd("radio1", "GiveM249")
}

public OnItemAddToPlayerPost(weapon, player)
{
	message_begin(MSG_ONE, g_msgWeaponList, _, player)
	write_string("weapon_charger7")
	write_byte(3)
	write_byte(200)
	write_byte(1)
	write_byte(-1)
	write_byte(0)
	write_byte(4)
	write_byte(20)
	write_byte(0)
	message_end()

	message_begin(MSG_ONE, g_msgAmmoX, _, player)
	write_byte(1)
	write_byte(8)
	message_end()
}

public GiveM249(index)
{
	give_item(index, "weapon_m249")
}
Code:
4
weapon			640 640hud165	0	0	170	45
weapon_s		640 640hud165	0	45	170	45
ammo			640 640hud7	72	72	24	24
ammo2			640 640hud8	96	0	24	24
Attached Files
File Type: zip sprites.zip (158.7 KB, 61 views)
__________________









Last edited by CrazY.; 01-08-2022 at 16:38.
CrazY. is offline
Hellkong
Member
Join Date: Nov 2021
Old 01-10-2022 , 10:42   Re: Secondary ammo
Reply With Quote #14

Quote:
Originally Posted by CrazY. View Post
The weapon in the picture you provided is using a combination of ammo2 in the weapon list file with the AmmoX message.



Code:
#include <amxmodx>
#include <hamsandwich>
#include <fun>
#include <fakemeta>

new g_msgWeaponList, g_msgAmmoX

public plugin_init()
{
	register_plugin("plugin", "version", "author")

	RegisterHam(Ham_Item_AddToPlayer, "weapon_m249", "OnItemAddToPlayerPost", 1)

	g_msgWeaponList = get_user_msgid("WeaponList")
	g_msgAmmoX = get_user_msgid("AmmoX")

	register_clcmd("radio1", "GiveM249")
}

public OnItemAddToPlayerPost(weapon, player)
{
	message_begin(MSG_ONE, g_msgWeaponList, _, player)
	write_string("weapon_charger7")
	write_byte(3)
	write_byte(200)
	write_byte(1)
	write_byte(-1)
	write_byte(0)
	write_byte(4)
	write_byte(20)
	write_byte(0)
	message_end()

	message_begin(MSG_ONE, g_msgAmmoX, _, player)
	write_byte(1)
	write_byte(8)
	message_end()
}

public GiveM249(index)
{
	give_item(index, "weapon_m249")
}
Code:
4
weapon			640 640hud165	0	0	170	45
weapon_s		640 640hud165	0	45	170	45
ammo			640 640hud7	72	72	24	24
ammo2			640 640hud8	96	0	24	24
Thank you very much.
Hellkong 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 16:00.


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