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

Refilling Clip/Mag with Max Ammo

broken avatar :(
Created 9 years ago
by tannnnnaiirrr
0 Members and 1 Guest are viewing this topic.
1,908 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
Is there a way I can make that when a max ammo is picked up, it refills the players clip alongside the reserved ammo?
broken avatar :(
×
broken avatar :(
Location: nlApeldoorn
Date Registered: 17 December 2013
Last active: 1 year ago
Posts
1,187
Respect
1,404Add +1
Forum Rank
Zombie Colossus
Primary Group
Community Scripter Elite
My Groups
More
My Contact & Social Links
More
Personal Quote
It aint much, if it aint Dutch
Signature
×
BluntStuffy's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
Oil Rig Beta Access
Oil Rig Beta Access
BluntStuffy's Contact & Social LinksBluntstuffy@BluntZombieBluntStuffyStuffyZombie
Last Edit: November 28, 2014, 05:18:02 pm by BluntStuffy
broken avatar :(
×
broken avatar :(
Senpai
Location: us
Date Registered: 28 September 2013
Last active: 3 years ago
Posts
605
Respect
Forum Rank
Zombie Enslaver
Primary Group
Box Mappers Elite
My Groups
More
My Contact & Social Links
More
×
arceus's Groups
Box Mappers Elite
Box Mappers Elite
arceus's Contact & Social LinksarceusNT
Code Snippet
Plaintext
refill_mag()
{
weapon = self getcurrentweapon();

ammo = WeaponClipSize( "weapon" );

self SetWeaponAmmoClip( "weapon", ammo );
}
somthing like this although this will work for the weapon the player is holding
broken avatar :(
×
broken avatar :(
[UGX] Documentation Writer & Programmer
Location: usLos Angeles, CA
Date Registered: 23 August 2013
Last active: 6 months ago
Posts
1,322
Respect
Forum Rank
Zombie Colossus
Primary Group
UGX Team Member
My Groups
More
My Contact & Social Links
More
Personal Quote
(ง º ω º )ง u wont sum m8y?
Signature
Do not take life too seriously. You will never get out of it alive.
×
DidUknowiPwn's Groups
UGX Team Member
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
Pretty sure you could just do giveMaxAmmo("weapon") instead.
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
Pretty sure you could just do giveMaxAmmo("weapon") instead.
what script does that go into?
broken avatar :(
×
broken avatar :(
[UGX] Documentation Writer & Programmer
Location: usLos Angeles, CA
Date Registered: 23 August 2013
Last active: 6 months ago
Posts
1,322
Respect
Forum Rank
Zombie Colossus
Primary Group
UGX Team Member
My Groups
More
My Contact & Social Links
More
Personal Quote
(ง º ω º )ง u wont sum m8y?
×
DidUknowiPwn's Groups
UGX Team Member
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
what script does that go into?
Depends on what you're trying to do.
broken avatar :(
×
broken avatar :(
Location: be
Date Registered: 17 August 2013
Last active: 3 years ago
Posts
369
Respect
Forum Rank
Perk Hacker
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
Web & Software Developer and Designer
Signature
"Deleted code is debugged code." - Jeff Sickel
"Mathematicians stand on each others' shoulders and computer scientists stand on each others' toes." - Richard Hamming
×
JR-Imagine's Groups
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
In _zombiemode_powerups.gsc, look for the function full_ammo_powerup( drop_item ), replace it with this:
Code Snippet
Plaintext
full_ammo_powerup( drop_item )
{
players = get_players();

for (i = 0; i < players.size; i++)
{
primaryWeapons = players[i] GetWeaponsList();

for( x = 0; x < primaryWeapons.size; x++ )
{
players[i] GiveMaxAmmo( primaryWeapons[x] );
players[i] setWeaponAmmoClip( primaryWeapons[x], weaponClipSize( primaryWeapons[x] ) );
}
}
// array_thread (players, ::full_ammo_on_hud, drop_item);
level thread full_ammo_on_hud( drop_item );
}

Code Snippet
Plaintext
refill_mag()
{
weapon = self getcurrentweapon();

ammo = WeaponClipSize( "weapon" );

self SetWeaponAmmoClip( "weapon", ammo );
}
somthing like this although this will work for the weapon the player is holding
Ples... "weapon" is not a variable name but a string, so it should look like this:
Code Snippet
Plaintext
refill_mag()
{
weapon = self getcurrentweapon();

ammo = WeaponClipSize( weapon );

self SetWeaponAmmoClip( weapon, ammo );
}

Tbh, wouldn't store ammo in a variable if you're only going to use it once:
Code Snippet
Plaintext
weap = self getCurrentWeapon();
self setWeaponAmmoClip( weap, weaponClipSize( weap ) );

Pretty sure you could just do giveMaxAmmo("weapon") instead.
Nope, this is the stock max ammo script:
Code Snippet
Plaintext
full_ammo_powerup( drop_item )
{
players = get_players();

for (i = 0; i < players.size; i++)
{
primaryWeapons = players[i] GetWeaponsList();

for( x = 0; x < primaryWeapons.size; x++ )
{
players[i] GiveMaxAmmo( primaryWeapons[x] );
}
}
// array_thread (players, ::full_ammo_on_hud, drop_item);
level thread full_ammo_on_hud( drop_item );
}

giveMaxAmmo() only refills the reserve ammo.
Last Edit: November 30, 2014, 11:02:30 am by JR-Imagine

 
Loading ...