UGX-Mods Login

or login with an authentication provider below
Sign In with Google
Sign In with Twitter
Sign In with Discord
Sign In with Steam
Sign In with Facebook
Sign In with Twitch

Buyable Max ammo help

broken avatar :(
Created 9 years ago
by tannnnnaiirrr
0 Members and 1 Guest are viewing this topic.
2,184 views
broken avatar :(
×
broken avatar :(
Location: usindiana
Date Registered: 8 December 2013
Last active: 8 years ago
Posts
235
Respect
Forum Rank
Mr. Elemental
Primary Group
Member
My Contact & Social Links
More
×
tannnnnaiirrr's Groups
So I use this tut for my buyable max ammo, it works well: http://modsonline.com/Forums-top-102627.html?start=
But the problem is, it seems like it only lets me buy ammo when my weapon amount gets to a certain point.

For example, Say I have an MP40. 32 in clip plus 160 reserved (192 reserved at max ammo) It won't let me buy ammo for it until say I get down to like 100 reserved ammo.

 I figure this is an easy fix, I just don't know how to go about doing it, thanks in advance!
This topic contains a post which is marked as the Best Answer. Click here to view it.
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 14 September 2013
Last active: 4 years ago
Posts
1,895
Respect
Forum Rank
Zombie Destroyer
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
BE ORIGINAL
Signature
×
MakeCents's Groups
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
So I use this tut for my buyable max ammo, it works well: http://modsonline.com/Forums-top-102627.html?start=
But the problem is, it seems like it only lets me buy ammo when my weapon amount gets to a certain point.

For example, Say I have an MP40. 32 in clip plus 160 reserved (192 reserved at max ammo) It won't let me buy ammo for it until say I get down to like 100 reserved ammo.

 I figure this is an easy fix, I just don't know how to go about doing it, thanks in advance!

It could be this:
Code Snippet
Plaintext
                weapon = who GetCurrentWeapon();
ammocount = who getammocount(weapon);
clipcount = who getweaponammoclip(weapon);
maxammo = weaponmaxammo(weapon);

if( !is_player_valid( who ) || maxammo <= ammocount + clipcount) continue;
   
give = 0;

Later it checks if give is > 0 here:

Code Snippet
Plaintext
                if( give > 0 )
{
who givemaxammo( who GetCurrentWeapon() );
who maps\_zombiemode_score::minus_to_player_score( self.zombie_cost );
who playsound( "cha_ching" );
}     
else
{
who playsound( "no_cha_ching" );
}

Or you didn't have enough points, but I doubt you overlooked that.

Is it playing any sounds?
Last Edit: April 17, 2015, 08:29:31 pm by MakeCents
broken avatar :(
×
broken avatar :(
Location: usindiana
Date Registered: 8 December 2013
Last active: 8 years ago
Posts
235
Respect
Forum Rank
Mr. Elemental
Primary Group
Member
My Contact & Social Links
More
×
tannnnnaiirrr's Groups
If it is playing the no cha ching sound when you try to buy it is is because of these lines:
Code Snippet
Plaintext
                weapon = who GetCurrentWeapon();
ammocount = who getammocount(weapon);
clipcount = who getweaponammoclip(weapon);
maxammo = weaponmaxammo(weapon);

if( !is_player_valid( who ) || maxammo <= ammocount + clipcount) continue;
   
give = 0;

Later it checks if give is > 0 here:

Code Snippet
Plaintext
                if( give > 0 )
{
who givemaxammo( who GetCurrentWeapon() );
who maps\_zombiemode_score::minus_to_player_score( self.zombie_cost );
who playsound( "cha_ching" );
}     
else
{
who playsound( "no_cha_ching" );
}
It doesn't make the sound, it just doesn't give the gun ammo until about 2 clips have been shot. I know it isn't a huge deal, but with the way my current WIP plays, it would be best to be able to just buy ammo even if you're one bullet

EDIT: and yes, I made sure I had points. Its just a little odd
Last Edit: April 17, 2015, 08:31:34 pm by tannnnnaiirrr
Marked as best answer by tannnnnaiirrr 9 years ago
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 14 September 2013
Last active: 4 years ago
Posts
1,895
Respect
Forum Rank
Zombie Destroyer
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
BE ORIGINAL
×
MakeCents's Groups
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
k, with no sounds it is saying that this is true:

Code Snippet
Plaintext
if( !is_player_valid( who ) || maxammo <= ammocount + clipcount)

Add above this line this:

Code Snippet
Plaintext
iprintlnbold(ammocount," ammo ",clipcount, " clip ", maxammo," max ammo ");


Then do that math and see if that is the issue.

Sorry about last post, I re read and saw i was wrong and changed it.
Last Edit: April 17, 2015, 08:33:43 pm by MakeCents
broken avatar :(
×
broken avatar :(
Location: usindiana
Date Registered: 8 December 2013
Last active: 8 years ago
Posts
235
Respect
Forum Rank
Mr. Elemental
Primary Group
Member
My Contact & Social Links
More
×
tannnnnaiirrr's Groups
k, with no sounds it is saying that this is true:

Code Snippet
Plaintext
if( !is_player_valid( who ) || maxammo <= ammocount + clipcount)

Add above this line this:

Code Snippet
Plaintext
iprintlnbold(ammocount," ammo ",clipcount, " clip ", maxammo," max ammo ");


Then do that math and see if that is the issue.

Sorry about last post, I re read and saw i was wrong and changed it.
Thanks it worked

 
Loading ...