Resource icon

Approved EasyAirdrops 1.1

No permission to download

CorrosionX

Plugin Developer
Plugin Developer
Sep 3, 2014
212
85
18
California
CorrosionX submitted a new resource:

EasyAirdrops - Easy, straight forward, airdrops on a timer plugin.

EasyAirdrops allows you to easily configure airdrops on a timer.

Only 2 config options:
PlayersRequired: Players required to be online for airdrops to drop. //Default 3
DropFrequency: How often (in seconds) the airdrop will be dropped. //Default 3600 = 1 hour

I was sick and tired of other magma airdrop plugins not working right or downright failing to work properly so decided to write my own. I might add an option to drop only at day/night if requested. :)

Thanks to...
Read more about this resource...
 

DreTaX

Probably knows the answer...
Administrator
Jun 29, 2014
4,093
4,784
113
At your house.
github.com
Can you edit your plugin?
Please include where the airdrop has occured i.e the cordinates and the direction.
Thx :)
JavaScript:
//Plugin:EasyAirDrops
//Author:CorrosionX
//Version:1.1
function On_PluginInit(){   
    if(!Plugin.IniExists("EasyAirdrops")){
        var setini = Plugin.CreateIni("EasyAirdrops");
        setini.AddSetting("Settings", "PlayersRequired", 3); //Default
        setini.AddSetting("Settings", "DropFrequency", 3600); //In Seconds! 1 hour
        setini.AddSetting("Settings", "DropDuring", "anytime"); //(default) - Can be day/night/anytime
        setini.Save();
    }else{
        var ini = EasyAirdropsIni();
    }
    var Drop_Time = parseInt(ini.GetSetting("Settings", "DropFrequency"),10)*1000;
    DataStore.Add("airdrop", "call", 0);
    Plugin.CreateTimer("AirDropTimer", Drop_Time).Start();
}

function On_PlayerConnected(Player){
    var ini = EasyAirdropsIni();
    var Req_Players = parseInt(ini.GetSetting("Settings", "PlayersRequired"),10);
    if(Req_Players <= Server.Players.Count){   
        DataStore.Remove("airdrop", "call");
        DataStore.Add("airdrop", "call", 1);
        //Server.Broadcast("AirDrops are now being called for!"); //debug
    }
    //Player.Message("Required Players=" + Req_Players); //debug
}

function On_PlayerDisconnected(Player){
    var ini = EasyAirdropsIni();
    var Req_Players = parseInt(ini.GetSetting("Settings", "PlayersRequired"),10);
    if(Req_Players <= Server.Players.Count){
        DataStore.Remove("airdrop", "call");
        DataStore.Add("airdrop", "call", 0);
        //Server.Broadcast("Not enough people online to call airdrops!"); //debug
    }
}

function AirDropTimerCallback(){
    var ini = EasyAirdropsIni();
    var Drop_Time = parseInt(ini.GetSetting("Settings", "DropFrequency"),10)*1000;
    //Server.Broadcast("Timer Completed. Drop Frequency =" + Drop_Time); //debug
    if(DataStore.Get("airdrop", "call") == 1){
        var Drop_During = ini.GetSetting("Settings", "DropDuring");
        if(Drop_During == "anytime"){
            World.Airdrop();
        }
        if(Drop_During == "day" && World.Time < 17.5 && World.Time > 5.5){
            World.Airdrop();
        }
        if(Drop_During == "night" && World.Time > 17.5 && World.Time < 5.5){
            World.Airdrop();
        }
        Server.Broadcast("AirDrop on its way!");
    }
    Plugin.CreateTimer("AirDropTimer", Drop_Time).Start();
}

function EasyAirdropsIni(){
    return Plugin.GetIni("EasyAirdrops");
}

function On_Airdrop(Vector3) {
    Server.Broadcast("Airdrop inbound to: " + Vector3)
}
 

Sturt

Plugin Developer
Plugin Developer
Jan 4, 2015
71
38
8
46
Code:
ile "<string>", line 1019, in StartingInCallback
ValueError: Argument is out of range.
Parameter name: viewID
I believe this caused it as I was in my server when the airdrop was announced, and this got spammed in the console at the same time. Sometimes it gets really bad after it runs for a while.