Raised This Month: $ Target: $400
 0% 

Show Clip-Ammo by HUDmsg


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
tei1995
Senior Member
Join Date: Feb 2011
Location: VietNam
Old 06-28-2012 , 11:40   Show Clip-Ammo by HUDmsg
Reply With Quote #1

How can I use SyncHUD message to show Weapon clip, ammo?
How can I check when player switch weapon?

for example:

I'm holding AK47, and I switch to D-eagle or the other weapons and to the contrary, How can I check it?

plz help me, I want to Show Clip/Ammo, which higher than 125/254.
__________________

Hatsune Miku~
tei1995 is offline
Liverwiz
Veteran Member
Join Date: Feb 2010
Location: Maryland
Old 06-28-2012 , 13:45   Re: Show Clip-Ammo by HUDmsg
Reply With Quote #2

This will help you out. Just take out the calculations and such.

http://forums.alliedmods.net/showthread.php?t=188368
__________________
What an elegant solution to a problem that doesn't need solving....
Liverwiz is offline
tei1995
Senior Member
Join Date: Feb 2011
Location: VietNam
Old 06-29-2012 , 01:24   Re: Show Clip-Ammo by HUDmsg
Reply With Quote #3

the ammo just show when player shoot/fire.

but i want to show ammo permantly.
__________________

Hatsune Miku~
tei1995 is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 06-29-2012 , 01:26   Re: Show Clip-Ammo by HUDmsg
Reply With Quote #4

See http://forums.alliedmods.net/showthread.php?p=1469706
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
tei1995
Senior Member
Join Date: Feb 2011
Location: VietNam
Old 06-29-2012 , 01:43   Re: Show Clip-Ammo by HUDmsg
Reply With Quote #5

so just make some var to get weaponid, clip, ammo. Check some statement and show it in by task loop flags "b", right?
__________________

Hatsune Miku~
tei1995 is offline
yokomo
Surprise Ascot!
Join Date: May 2010
Location: Malaysia
Old 06-29-2012 , 02:35   Re: Show Clip-Ammo by HUDmsg
Reply With Quote #6

Quote:
Originally Posted by ConnorMcLeod View Post
But in your code it only cap BP ammo at 254. Any idea how to get the true value that > 254?
__________________
Team-MMG CS1.6 Servers:
✅ MultiMod -- 103.179.44.152:27016
✅ Zombie Plague -- 103.179.44.152:27015
✅ Zombie Escape -- 103.179.44.152:27017
✅ Klassik Kombat -- 103.179.44.152:27018
✅ Boss-Battle -- 103.179.44.152:27019
yokomo is offline
tei1995
Senior Member
Join Date: Feb 2011
Location: VietNam
Old 06-29-2012 , 02:59   Re: Show Clip-Ammo by HUDmsg
Reply With Quote #7

can use cs_get_user_bpammo(id,WEAPON_ID)?
__________________

Hatsune Miku~
tei1995 is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 06-29-2012 , 03:06   Re: Show Clip-Ammo by HUDmsg
Reply With Quote #8

Quote:
Originally Posted by yokomo View Post
But in your code it only cap BP ammo at 254. Any idea how to get the true value that > 254?
You tested it ?

If you have tested and that it doesn't work, replace :

PHP Code:
public Event_AmmoX(id)
{
    
g_iBpAmmo[id][read_data(1)] = read_data(2)

with

PHP Code:
new const m_rgAmmo_CBasePlayer[15] = {376,377,...} 

public 
Event_AmmoX(id)
{
    new 
iAmmoIndex read_data(1)
    
g_iBpAmmo[id][iAmmoIndex] = get_pdata_int(idm_rgAmmo_CBasePlayer[iAmmoIndex])


You can do the same here :

PHP Code:
public Event_Health(id)
{
    
g_iHealth[id] = read_data(1)

to

PHP Code:
public Event_Health(id)
{
    
g_iHealth[id] = get_user_health(id)


I'm pretty sure that for Health event, passed value is real health value and not mask, should be the same for AmmoX.
__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 06-29-2012 at 03:10.
ConnorMcLeod is offline
yokomo
Surprise Ascot!
Join Date: May 2010
Location: Malaysia
Old 06-29-2012 , 12:18   Re: Show Clip-Ammo by HUDmsg
Reply With Quote #9

Quote:
Originally Posted by ConnorMcLeod View Post
You tested it ?

If you have tested and that it doesn't work, replace :

PHP Code:
public Event_AmmoX(id)
{
    
g_iBpAmmo[id][read_data(1)] = read_data(2)

with

PHP Code:
new const m_rgAmmo_CBasePlayer[15] = {376,377,...} 

public 
Event_AmmoX(id)
{
    new 
iAmmoIndex read_data(1)
    
g_iBpAmmo[id][iAmmoIndex] = get_pdata_int(idm_rgAmmo_CBasePlayer[iAmmoIndex])

You can do the same here :

PHP Code:
public Event_Health(id)
{
    
g_iHealth[id] = read_data(1)

to

PHP Code:
public Event_Health(id)
{
    
g_iHealth[id] = get_user_health(id)

I'm pretty sure that for Health event, passed value is real health value and not mask, should be the same for AmmoX.
Yup tested and confirmed.

Before fix (cap at 254):


After Fix using your given code:


Thanks by the way for that code.

But no problem on Heath event, it still give the true value.
__________________
Team-MMG CS1.6 Servers:
✅ MultiMod -- 103.179.44.152:27016
✅ Zombie Plague -- 103.179.44.152:27015
✅ Zombie Escape -- 103.179.44.152:27017
✅ Klassik Kombat -- 103.179.44.152:27018
✅ Boss-Battle -- 103.179.44.152:27019

Last edited by yokomo; 06-29-2012 at 12:19.
yokomo is offline
tei1995
Senior Member
Join Date: Feb 2011
Location: VietNam
Old 06-30-2012 , 06:58   Re: Show Clip-Ammo by HUDmsg
Reply With Quote #10

yokomo, can you show me your code?
__________________

Hatsune Miku~
tei1995 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 06:08.


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