View Full Version : MaxAmmo
luluthefirst
17th October, 2009, 09:34 AM
Today, I wanted to make a mutator that give the maximum ammo, that doesn't stop to give you (infinite ammo).
Very smell script :P
dU.Hitman
18th September, 2011, 03:05 PM
Dead Link
TSQ
18th September, 2011, 06:26 PM
yup, link is dead.
CPanoplyd
18th September, 2011, 08:43 PM
Back in the day, we gave ammo bonuses and the original code from UT didn't block pickups if the ammo count was more than the MaxAmmo. The below code fixes it. The class extends TournamentAmmo.
//ADDED from Ammo Class to stop pickup of ammo when ammo amount is more than Max Ammo.
function bool HandlePickupQuery( inventory Item )
{
if ( (class == item.class) || (ClassIsChildOf(item.class, class'Ammo')
&& (class == Ammo(item).parentammo)) )
{
if ( AmmoAmount >= MaxAmmo )
return true;
if (Level.Game.LocalLog != None)
Level.Game.LocalLog.LogPickup(Item, Pawn(Owner));
if (Level.Game.WorldLog != None)
Level.Game.WorldLog.LogPickup(Item, Pawn(Owner));
if (Item.PickupMessageClass == None)
Pawn(Owner).ClientMessage( Item.PickupMessage, 'Pickup' );
else
Pawn(Owner).ReceiveLocalizedMessage( Item.PickupMessageClass, 0, None, None, item.Class );
item.PlaySound( item.PickupSound );
AddAmmo(Ammo(item).AmmoAmount);
item.SetRespawn();
return true;
}
if ( Inventory == None )
return false;
return Inventory.HandlePickupQuery(Item);
}
dU.Hitman
19th September, 2011, 07:18 PM
Sorry but my knowing about coding is limit to 0,I was looking for a mutator that will respawn ammo to my custom sniper-rifle since the maker of it did not get around to make ammboxes for it (the dane)
I was trying to find a mod that could do something like this from a INI for ex.
bUseRegenAmmo=True
MaxAmmo=500
AmmoRegenPerSec=5
StartAmmo=100
vBulletin® v3.6.7, Copyright ©2000-2012, Jelsoft Enterprises Ltd.