Here is the plugin I try to make, but this is the first plugin I try to do, can someone help me ? The goal is to disable the Chinook Heli if there is less than 3 players on the servers and if the count come to 3 or more than the Chinook get reactivated
Here is what I made for the moment, but this isn't working can someone help me ?
Here is what I made for the moment, but this isn't working can someone help me ?
using System;
using System.Collections.Generic;
using System.Linq;
using Oxide.Core;
using Oxide.Core.Libraries.Covalence;
namespace Oxide.Plugins
{
class PlayerMinimum4Crates : CovalencePlugin
{
DisableLockedCrate();
public int GetNbrPlayers(IPlayer player)
{
int playerCount = players.Connected.Count(p => !p.IsAdmin); ;
return playerCount;
}
public void DisableLockedCrate(IPlayer player)
{
if(GetNbrPlayers(player) < 3)
{
rust.RunServerCommand("server.events 0");
}
else
{
rust.RunServerCommand("server.events 1");
}
}
}
}