Quote:
Originally Posted by Hanzoligen
That defines a value for appropriate clipsizes.
Whats the code for returning the current amount of ammo of a player?
I read through survivor uogrades sourcecode also. I remember its the same method. You can do it two ways. Both of them didnt return the current amount but max amount instead. Post a screenshot with text from the script or the sourcecode which worked for you please
|
You are trying to get ammo based on clipsizes, for every use, it adds a clip size to the reserve? You need to experiment with the events. I suggest you try blocking the ammo pickup event to see if that stops the ammo reserve from increasing. Then, try using the player_use event to determine if its an ammo pile they are using and add the amount of ammo to the reserve of whatever value is returned based on the weapon they are carrying.
Of course they won't RETURN the current amount of the reserve, it returns the max because the event is fired first. You need to stop the event from giving the ammo in the first place, and add your own ammo to it. It requires some heavy scripting. I can think of 2 possible ways to do it. Phyiscally I have not tested, it but outside the constraints, I can add for each use ammo to the player's reserve and limit the amount of ammo usage.
If all else fails, I would set the max ammo cvars to their respectful ammo clip sizes, that, or put it to 0. Then use the events to handle all ammo packaging.
__________________