AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   get_user_ammo (https://forums.alliedmods.net/showthread.php?t=260305)

Obada 03-23-2015 06:37

get_user_ammo
 
Hey,

I was making a hud message which shows you the other player's bullets.

The thing is that, it shows something like this.

Code:

His/Her Bullets: 1
Instead of showing his/her actual bullets number, it just shows 1.
PHP Code:

new clip1ammo1
set_hudmessage
(2552550, -1.00.2506.01.0)
show_hudmessage(0,"His/Her Bullets: %d"get_user_ammo(idCSW_USPclip1ammo1)) 


What did I do wrong?

Thanks.

PS. I don't want to use cs_get_weapon_ammo, nor cs_get_user_bpammo. Because I want to get the total player's bullets.

Thanks again.

jimaway 03-23-2015 07:04

Re: get_user_ammo
 
get_user_ammo does not return the amount of ammo, but instead stores the values inside variables that you pass to it

Shiina.Mashiro 03-23-2015 09:14

Re: get_user_ammo
 
so I guess it is gonna be like this
PHP Code:

new clip1ammo1
get_user_ammo
(idCSW_USPclip1ammo1)
set_hudmessage(2552550, -1.00.2506.01.0)
show_hudmessage(0,"His/Her Bullets: %d"ammo1

</span></span>

Obada 03-26-2015 12:28

Re: get_user_ammo
 
Alright thanks, But it just shows the backpack ammo, is there any way I can show the total amount of ammo?

jimaway 03-26-2015 12:30

Re: get_user_ammo
 
Quote:

Originally Posted by Obada (Post 2278295)
Alright thanks, But it just shows the backpack ammo, is there any way I can show the total amount of ammo?

clip1+ammo1

Obada 03-26-2015 12:36

Re: get_user_ammo
 
Thanks alot, it worked! :)


All times are GMT -4. The time now is 14:38.

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