Page 1 of 1

ammo indicator?

Posted: Sun Mar 30, 2008 10:03 pm
by darksmaster923
hey guys, i have a scripted player, but i dont really know how to add an ammo indicator for it, since the ammo in the clip variable is in the script and i dont know how to make it show up in the hud

Re: ammo indicator?

Posted: Sat Apr 05, 2008 11:08 pm
by Juutis
Add an attribute to the player. Something like 'ammo' and then use 'SetAttribute("ammo",<your ammo variable>,"Player");'.

Now the player's attribute called 'ammo' should always have the same value as your ammo variable in the script. Then just define a new HUD element with the 'ammo' attribute.

Re: ammo indicator?

Posted: Sun Apr 06, 2008 6:33 am
by darksmaster923
what about the spare clips? i have them in my player.ini, so how would i 'activate' them.

Re: ammo indicator?

Posted: Mon Apr 07, 2008 4:09 am
by paradoxnj
Think of the logic that needs to happen.

1. First clip is empty
2. Check if there are spare clips available in inventory
3. If yes, reset ammo value to amount of ammo in spare clip and remove a clip from inventory
4. If no, gun is empty