trying to make a plugin a bit like wiper. the thing im trying to do is make a file each time a player logs in, it would add there uid to that file + the date when he logged in.
when i would type /clean it would remove all buildings not owned by any of the players that are in that file.
(id remove the players from the list that were offline for longer than 5 days)
this is what i have currently but it destroys pretty much everything but also the buildings owned by players in the list
when i would type /clean it would remove all buildings not owned by any of the players that are in that file.
(id remove the players from the list that were offline for longer than 5 days)
this is what i have currently but it destroys pretty much everything but also the buildings owned by players in the list
JavaScript:
function NubIni(target)
{
var ini = Plugin.GetIni("NewPlayers");
if(!Plugin.IniExists("NewPlayers"))
{
Plugin.CreateIni("NewPlayers");
}
if(ini.GetSetting("Players", target.SteamID) != null)
{
return true;
}
else
{
return false;
}
}
function On_PlayerConnected(Player)
{
var ini = Plugin.GetIni("NewPlayers");
var day = System.DateTime.Now.ToString("M.dd");
ini.AddSetting("Players",Player.SteamID,day);
ini.Save();
}
function On_Command(Player, cmd, args)
{
if(cmd=="bananass" && Player.Admin)
{
for (var x in World.Entities){
if (x.OwnerID != NubIni ){
x.Destroy();
}
}
break;
}
}
Last edited: