Hi, just wondering if it's possible to change options on how the sam shoot parachutes. On modded servers with high loot it's easy to get lots of sams and I am wondering if an option can be added to either enable or disable. Thank you again WhiteThunder!
Possible to add options to change how sams attack parachutes?Solved
Are parachutes already Targetable? I saw a Facepunch commit about it but not sure if that's already out. If it is, it sounds like you are looking to block it? That should be easy to do, but probably out of scope for this plugin for now. I can make a separate plugin for parachutes though.
Yes they are targetable now. That would be great either way, just thought I would ask you. Thank you again!
Here's a simple plugin that adds a permission to avoid targeting. Save as NoTargetParachutes.cs. Note that it doesn't discriminate player vs monument Sam Sites, but that could be changed if needed.
namespace Oxide.Plugins
{
[Info("No Target Parachute", "WhiteThunder", "1.0.0")]
[Description("Prevents players from being targeted by Sam Sites while parachuting if they have permission.")]
internal class NoTargetParachute : CovalencePlugin
{
private const string PermissionUse = "notargetparachute.use";
private readonly object True = true;
private void Init()
{
permission.RegisterPermission(PermissionUse, this);
}
private object OnSamSiteTarget(SamSite samSite, Parachute parachute)
{
if (parachute.mountPoints != null)
{
foreach (var mountPoint in parachute.mountPoints)
{
var player = mountPoint.mountable.GetMounted();
if ((object)player != null && permission.UserHasPermission(player.UserIDString, PermissionUse))
return True;
}
}
return null;
}
}
}
Damn! Thank you so much WhiteThunder!
Locked automatically