Magazin Booster not working
Still broken
In response to ():Still broken
I did a little tweaking - basically just adding in a hook function for OnReloadWeapon. Try pasting the following function in, perhaps just above OnItemCraftFinished. This would go into MagazinBoost.cs - please save a copy of the original first:
object OnReloadWeapon(BasePlayer player, BaseProjectile projectile)
{
Item item = projectile.GetItem();
Dictionary weaponStats = null;
if(weaponContainer.ContainsKey(item.info.shortname))
{
weaponStats = weaponContainer[item.info.shortname] as Dictionary ;
}
if(!(bool)weaponStats["settingactive"]) return null;
if (hasRight(player,"maxammo") || hasRight(player, "all"))
{
projectile.primaryMagazine.capacity = (int)weaponStats["maxammo"];
projectile.primaryMagazine.contents = (int)weaponStats["maxammo"];
projectile.SendNetworkUpdate();
}
return null;
}
For me, it allows you to reload to the maxammo setting if you have the permission. In most if not all cases, I had to first unload. Thereafter, it reloads normally with the bump.
In response to rfc1920 ():Ok, this has a major drawback in that it just reloads without taking or requiring any ammo in invent...
remove the line that reads:
projectile.primaryMagazine.contents = (int)weaponStats["maxammo"];
projectile.primaryMagazine.contents = (int)weaponStats["maxammo"];
object OnReloadWeapon(BasePlayer player, BaseProjectile projectile)
{
Puts("OnReloadWeapon called!");
Item item = projectile.GetItem();
Dictionary weaponStats = null;
if(weaponContainer.ContainsKey(item.info.shortname))
{
weaponStats = weaponContainer[item.info.shortname] as Dictionary ;
}
if(!(bool)weaponStats["settingactive"]) return null;
if (hasRight(player,"maxammo") || hasRight(player, "all"))
{
projectile.primaryMagazine.capacity = (int)weaponStats["maxammo"];
projectile.SendNetworkUpdate();
}
return null;
}
this seems to work better, it doesn't change the clip size if it is already bigger than "maxammo" setting:-
object OnReloadWeapon(BasePlayer player, BaseProjectile projectile)
{
Item item = projectile.GetItem();
Dictionary <string, object> weaponStats = null;
if(weaponContainer.ContainsKey(item.info.shortname))
{
weaponStats = weaponContainer[item.info.shortname] as Dictionary <string, object>;
}
if(!(bool)weaponStats["settingactive"]) return null;
if (projectile.primaryMagazine.capacity < (int)weaponStats["maxammo"] && (hasRight(player,"maxammo") || hasRight(player, "all")))
{
projectile.primaryMagazine.capacity = (int)weaponStats["maxammo"];
projectile.SendNetworkUpdate();
}
return null;
} broken still
Use https://umod.org/plugins/weapon-changerN8CWG1990broken still
i`m solve a problem
use with https://umod.org/plugins/weapon-changer
and thx orange
use with https://umod.org/plugins/weapon-changer
and thx orange
- 1
- 2