Add files via upload

This commit is contained in:
bmgjet 2023-02-26 02:27:58 +13:00 committed by GitHub
commit 8cde6cb270
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 21 additions and 0 deletions

21
ConstantRecycle.cs Normal file
View File

@ -0,0 +1,21 @@
using System.Collections.Generic;
namespace Oxide.Plugins
{
[Info("ConstantRecycle", "bmgjet", "1.0.0")]
class ConstantRecycle : RustPlugin
{
List<Recycler> Running = new List<Recycler>();
private void OnRecyclerToggle(Recycler recycler,BasePlayer player)
{
if(recycler.IsOn())
{
recycler.CancelInvoke(recycler.StartRecycling);
Running.Remove(recycler);
return;
}
recycler.InvokeRepeating(recycler.StartRecycling,1,1);
if(!Running.Contains(recycler)){Running.Add(recycler);}
}
void Unload() { foreach(var recycler in Running) { recycler.CancelInvoke(recycler.StartRecycling); } }
}
}