ammo indicator?
- darksmaster923
- Posts: 1857
- Joined: Wed Jan 03, 2007 10:32 pm
- Location: Huntington Beach, California, USA
ammo indicator?
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
Herp derp.
Re: ammo indicator?
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.
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.
Pain is only psychological.
- darksmaster923
- Posts: 1857
- Joined: Wed Jan 03, 2007 10:32 pm
- Location: Huntington Beach, California, USA
Re: ammo indicator?
what about the spare clips? i have them in my player.ini, so how would i 'activate' them.
Herp derp.
Re: ammo indicator?
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
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
Many Bothans died to bring you this signature....