First find the function for when the weapon is fired, then add an if(%obj.ammo>=1) {blah} and else if(%obj.ammo<0) { reload }
His picture shows a reload function
-snip-
http://prntscr.com/3m9ua3
It isn't too hard, I believe you can do it.
function M1014Image::onFire1(%this,%obj,%slot)
{
%obj.toolMag[%obj.currTool]-=1;if(%obj.toolMag[%obj.currTool]<1)
{
%obj.toolMag[%obj.currTool]=0;%obj.setImageAmmo(0,0);
}
M1014Fire(%this,%obj,%slot,0.0015,1,0.02);
}
function M1014Image::onFire2(%this,%obj,%slot)
{
%obj.toolMag[%obj.currTool]-=1;
if(%obj.toolMag[%obj.currTool]<1)
{
%obj.toolMag[%obj.currTool]=0;%obj.setImageAmmo(0,0);
}
M1014Fire(%this,%obj,%slot,0.0030,1,0.04);
}
There is no setImageAmmo, that is just the ammo hud
function M1014Image::onReload(%this,%obj,%slot)
{
%obj.toolMag[%obj.currTool]+=1;
%obj.setImageAmmo(0,1);
}
As for the setImageAmmo you can create that yourself. Or write your own script to replace this one for something totally different.
Taken from BF3Shotguns by Sgt. A. Walter, A Twig and Navaro