Set minimum players for airdrop?
hi guys im new to modding my server,

i woud like to have a simple plugin where i can set the minimum ammount of players for events to start.

for example airdrops (vanilla frecuency,etc) but just have minimum ammount of players.

lets say i set it up at 40 , there is not going to be vanilla airdrops until 40 players are online, as soon as there is below the limit it will stop airdrops.

is this possible?, same with cargo ship.

Thanks everyone.
https://umod.org/plugins/fancy-drop

"Minimum players for timed Drop": 2, // defines the needed player count for timed random airdrops

...dunno about Cargo.
Hi Ryan thanks for your reply any chance you can help me setting this up? where do i put that "Minimum players for timed Drop": 2,
in the oxide\config\FancyDrop.json file near the bottom (lines 228 & 236)
There are a couple convars you might be interested in looking into as well
airdrop.min_players
cargoship.loot_rounds​

 

You could also probably set up a script (there may be a plugin to handle this kind of thing as well) to modify cargoship.event_enabled from False to True when the desired player count threshold has been met, or just change it manually at will, or set cargoship.loot_rounds "0" so it only spawns 1 crate.

FancyDrop is a powerful plugin, just overkill if all you want is to add minimum player cap before airdrops.

A less invasive way would be to override OnEventTrigger and filtering on the prefab guid for CargoPlane.
Then based on your return result, you can control to either continue the event or to end it before it begins (based on your own criteria).

Example:

private object OnEventTrigger(TriggeredEventPrefab triggeredEvent)
{
    // Should not happen
    if(triggeredEvent.targetPrefab == null)
    {                
        // Do nothing
        return null;
    }
   
    // If this is not an airdrop (i.e. Helicopter, CH47) then return null (meaning continue normal trigger)
    if (!triggeredEvent.targetPrefab.guid.Equals("8429b072581d64747bfe17eab7852b42"))
    {
        Puts($"{triggeredEvent.targetPrefab.resourcePath} event allowed to continue [{triggeredEvent.targetPrefab.guid}]");
        return null;
    }

    // Just an example filter - check if player count is above hardcoded 10 players     
    if (BasePlayer.activePlayerList.Count() >= 10)
    {
        return null;
    }

    // Report to console trigger event was blocked
    Puts($"{triggeredEvent.targetPrefab.resourcePath} blocked");

    // Returning false will stop triggered event!
    return false;
}