I have several idea's for plugins that I will be currently working on. If you have any ideas or can help add code just post it here and I will put you in credits of the plugin once finished.
1. Unlimited ammo (based on oxide plugin idea) - On specific days, or times or only for admins (Beta)
Still tweaking it, but so far just need to add a catch for weapons which is next step. Currently any item you can hold gets unlimited uses/clip/quantity.
2. Custom Drops and animal spawning w/respawn (based on oxide plugin idea, there is a Magma plugin that doesn't respawn the drops) (PreAlpha) Example: http://forum.rustoxide.com/resources/spawn-controller.234/
3. Vampire/bloodthirsty/vampirism (Pretty much a full Conversion Plugin) - Unlocks/destroys all your doors on death, with your health going down by 1 every 10 seconds and % of dmg to others back in hp, make it USE blood packs, run faster at night and hp doesn’t go down. Could be interesting with BattleField servers... (Pre-Alpha)
4. Chest Log - Already Exists on Fougerite: http://fougerite.com/resources/chestlog.38/
5. Where is Player? (requested plugin based on idea from RustEssentials)- use /where playername to get players coordinates - Admins Only. (Alpha)
6. Plugin exists: N4Zones on GoMagma.org - http://gomagma.org/community/index.php?resources/n4-zones.95/
7. Anti-Spawn Camp(idea from person on my server) - Prevent people from killing fresh spawns/respawns. Good for BattleField Servers or No KOS Servers (Untested) Created/modified by Dretax. Thanks to him!
8. Warcraft3 Mod: Highly doubt I will be able to finish this alone, or at all, but same abilities from WC3:Source - classes and abilities for each class. Great for BattleField Servers?
Not even going to put area for code XD
9. Extra Loot AND/OR Resources based on TotalTimeOnServer OR TimeSinceConnected/gets reset on disconnect (seems more fair) - Gets people to want to stay on your servers longer AND great for wipes, cause people that play a lot on your server will get more loot (if enabled for TotalTimeOnServer)
10. Roll The Dice - Get random ability/perk/effect on player when uses /rtd - Godmode for specific time, resources, instant kill, uber hatchet, unlimited clip?, randomly teleported somewhere, frozen in place, drop inventory item(s) on ground, clear inventory, spawn animals on player, increased/decreased dmg dealt, dmg dealt causes knock back on player or victim, are just a few ideas. Obviously everything would be on a timer.
1. Unlimited ammo (based on oxide plugin idea) - On specific days, or times or only for admins (Beta)
Code:
//Name: UnlimitedAmmo-oldversion
//Author: CorrosionX
//Version: 0.1
function On_PluginInit(){
if(!Plugin.IniExists("UnlimitedAmmo")){
var setini = Plugin.CreateIni("UnlimitedAmmo");
setini.AddSetting("Settings", "AdminOnly", true); //Default
setini.AddSetting("Settings", "RefillDuring", "anytime"); //Default - Can be day/night/anytime
setini.AddSetting("Settings", "RefillNades", false); //Default
setini.AddSetting("Settings", "RefillExpCharges", false); //Default
setini.Save();
}
Plugin.CreateTimer("RefillAmmoTimer", 10).Start();
}
function On_PlayerConnected(Player){
CheckPlayerAndTime(Player);
}
function On_PlayerSpawned(Player){
CheckPlayerAndTime(Player);
}
function CheckPlayerAndTime(Player){
var ini = UnlimitedAmmoIni();
var Admin_Only = ini.GetBoolSetting("Settings", "AdminOnly");
var Refill_During = ini.GetSetting("Settings", "DropDuring");
if(Refill_During == "anytime"){
if(Admin_Only && Player.Admin){
GiveAmmo(Player);
}else if(!AdminOnly){
GiveAmmo(Player);
}
}
if(Refill_During == "day" && World.Time < 17.5 && World.Time > 5.5){
if(Admin_Only && Player.Admin){
GiveAmmo(Player);
}else if(!AdminOnly){
GiveAmmo(Player);
}
}
if(Refill_During == "night" && World.Time > 17.5 && World.Time < 5.5){
if(Admin_Only && Player.Admin){
GiveAmmo(Player);
}else if(!AdminOnly){
GiveAmmo(Player);
}
}
}
function GiveAmmo(Player){
var ini = UnlimitedAmmoIni();
var Refill_Nades = ini.GetBoolSetting("Settings", "RefillNades");
var Refill_ExpCharges = ini.GetBoolSetting("Settings", "RefillExpCharges");
//556 Ammo
if(!Player.Inventory.HasItem("556 Ammo", 250) && Player.Inventory.HasItem("556 Ammo"){
Player.Inventory.RemoveItem("556 Ammo");
Player.Inventory.AddItem("556 Ammo", 250);
}else if(!Player.Inventory.HasItem("556 Ammo") && Player.Inventory.FreeSlots > 0){
Player.Inventory.AddItem("556 Ammo", 250);
}
//9mm Ammo
if(!Player.Inventory.HasItem("9mm Ammo", 250) && Player.Inventory.HasItem("9mm Ammo")){
Player.Inventory.RemoveItem("9mm Ammo");
Player.Inventory.AddItem("9mm Ammo", 250);
}else if(!Player.Inventory.HasItem("9mm Ammo") && Player.Inventory.FreeSlots > 0){
Player.Inventory.AddItem("9mm Ammo", 250);
}
//Shotgun Shells
if(!Player.Inventory.HasItem("Shotgun Shells", 250) && Player.Inventory.HasItem("Shotgun Shells"){
Player.Inventory.RemoveItem("Shotgun Shells");
Player.Inventory.AddItem("Shotgun Shells", 250);
}else if(!Player.Inventory.HasItem("Shotgun Shells") && Player.Inventory.FreeSlots > 0){
Player.Inventory.AddItem("Shotgun Shells", 250);
}
//Handmade Shell
if(!Player.Inventory.HasItem("Handmade Shell", 250) && Player.Inventory.HasItem("Handmade Shell"){
Player.Inventory.RemoveItem("Handmade Shell");
Player.Inventory.AddItem("Handmade Shell", 250);
}else if(!Player.Inventory.HasItem("Handmade Shell") && Player.Inventory.FreeSlots > 0){
Player.Inventory.AddItem("Handmade Shell", 250);
}
//Arrows
if(!Player.Inventory.HasItem("Arrow", 10) && Player.Inventory.HasItem("Arrow"){
Player.Inventory.RemoveItem("Arrow");
Player.Inventory.AddItem("Arrow", 10);
}else if(!Player.Inventory.HasItem("Arrow") && Player.Inventory.FreeSlots > 0){
Player.Inventory.AddItem("Arrow", 10);
}
//Grenades if enabled
if(Refill_Nades){
if(!Player.Inventory.HasItem("F1 Grenade", 5) && Player.Inventory.HasItem("F1 Grenade"){
Player.Inventory.RemoveItem("F1 Grenade");
Player.Inventory.AddItem("F1 Grenade", 5);
}else if(!Player.Inventory.HasItem("F1 Grenade") && Player.Inventory.FreeSlots > 0){
Player.Inventory.AddItem("F1 Grenade", 5);
}
}
//Explosive Charges if enabled
if(Refill_ExpCharges){
if(!Player.Inventory.HasItem("Explosive Charge", 5) && Player.Inventory.HasItem("Explosive Charge"){
Player.Inventory.RemoveItem("Explosive Charge");
Player.Inventory.AddItem("Explosive Charge", 5);
}else if(!Player.Inventory.HasItem("Explosive Charge") && Player.Inventory.FreeSlots > 0){
Player.Inventory.AddItem("Explosive Charge", 5);
}
}
}
function UnlimitedAmmoIni(){
return Plugin.GetIni("UnlimitedAmmo");
}
RefillAmmoTimerCallback(){
for(var player in Server.Players){
if(player.Name != null){
CheckPlayerAndTime(player);
}
}
Plugin.CreateTimer("RefillAmmoTimer", 10).Start();
}
JavaScript:
//UnlimitedIteminHand.
//Author: CorrosionX
function On_PluginInit(){
Plugin.CreateTimer("GiveUsesTimer", 1000).Start();
}
function GiveUsesTimerCallback(){
Server.Players.ForEach(
function(player) {
try{
player.Inventory.InternalInventory.activeItem.SetUses(250);
} catch(ignore) { }
}
);
Plugin.KillTimer("GiveUsesTimer");
Plugin.CreateTimer("GiveUsesTimer", 1000).Start();
}
2. Custom Drops and animal spawning w/respawn (based on oxide plugin idea, there is a Magma plugin that doesn't respawn the drops) (PreAlpha) Example: http://forum.rustoxide.com/resources/spawn-controller.234/
Code:
Space reserved for code.
3. Vampire/bloodthirsty/vampirism (Pretty much a full Conversion Plugin) - Unlocks/destroys all your doors on death, with your health going down by 1 every 10 seconds and % of dmg to others back in hp, make it USE blood packs, run faster at night and hp doesn’t go down. Could be interesting with BattleField servers... (Pre-Alpha)
Code:
Space reserved for code.
4. Chest Log - Already Exists on Fougerite: http://fougerite.com/resources/chestlog.38/
5. Where is Player? (requested plugin based on idea from RustEssentials)- use /where playername to get players coordinates - Admins Only. (Alpha)
Code:
//Name: WhereIs?
//Author: CorrosionX
//Version 0.1
function On_Command(Player, cmd, args){
case "where":
if(!Player.Admin){
Player.Message("You are not allowed to use this command!");
}else{
if(args.Length == 0){
Player.Message("/where playername - Get a Players Location");
}else if(args.Length > 0){
var name = argsToText(args);
var Player_Name = Player.Find(name);
if(Player_Name != null && Player_Name.Location != null/*&& isAlive(Player_Name)*/){
Player.Message("Player " + Player_Name.Name + "is located @ " + Player_Name.Location);
}
}
}
break;
}
6. Plugin exists: N4Zones on GoMagma.org - http://gomagma.org/community/index.php?resources/n4-zones.95/
7. Anti-Spawn Camp(idea from person on my server) - Prevent people from killing fresh spawns/respawns. Good for BattleField Servers or No KOS Servers (Untested) Created/modified by Dretax. Thanks to him!
JavaScript:
/**
* Homejobs plugin addon written by BadZombi. Integrated for SpawnProtection by DreTaX
* SpawnProtection 1.0 by DreTaX
* --
*/
var BZSJ = {
name: 'SpawnProtection Jobs',
author: 'BadZombi',
version: '0.1.2',
DStable: 'BZSJ',
addJob: function(callback, xtime, params) {
if (callback && xtime && params) {
var jobData = {};
jobData.callback = String(callback);
jobData.params = String(params);
var epoch = Plugin.GetTimestamp();
var exectime = parseInt(epoch) + parseInt(xtime);
DataStore.Add(this.DStable, exectime, iJSON.stringify(jobData));
this.startTimer();
}
},
killJob: function(job) {
var pending = DataStore.Keys(this.DStable);
for (var p in pending) {
var jobData = DataStore.Get(this.DStable, p);
var jobxData = iJSON.parse(jobData);
var params = iJSON.parse(jobxData.params);
if (params[0] == job) {
DataStore.Remove(this.DStable, p);
break;
}
}
},
startTimer: function(){
try {
var gfjfhg = 2 * 1000;
if(!Plugin.GetTimer("SPAJobTimer")){
Plugin.CreateTimer("SPAJobTimer", gfjfhg).Start();
}
} catch(err){
Util.ConsoleLog(err.message);
}
},
stopTimer: function(P) {
Plugin.KillTimer("SPAJobTimer");
},
getPlayer: function(stam) {
try {
for (var player in Server.Players) {
var id = player.SteamID;
if (id == stam && player != null) {
return player;
}
}
return null;
} catch(err) {
Plugin.Log("SpawnProtection", "Error caught at getPlayer method. Player was null, removing it from the timer.");
return null;
}
},
clearTimers: function(P){
P.MessageFrom('meh', "Erasing all example timers.");
DataStore.Flush(this.DStable);
}
};
function SPAJobTimerCallback(){
var epoch = Plugin.GetTimestamp();
if(DataStore.Count(BZSJ.DStable) >= 1){
var pending = DataStore.Keys(BZSJ.DStable);
for (var p in pending){
if(epoch >= parseInt(p)) {
var jobData = DataStore.Get(BZSJ.DStable, p);
var jobxData = iJSON.parse(jobData);
if(jobxData.params == "undefined")
{
DataStore.Remove(BZSJ.DStable, p);
continue;
}
var params = iJSON.parse(jobxData.params);
switch(jobxData.callback) {
case "protectdelay":
var player = BZSJ.getPlayer(params[0]);
if (player != null) {
DataStore.Remove("Protected", params[0]);
player.Message("Your spawn protection has worn off");
}
else {
DataStore.Remove("Protected", params[0]);
BZSJ.killJob(params[0]);
}
break;
}
DataStore.Remove(BZSJ.DStable, p);
}
}
}
else {
BZSJ.stopTimer();
}
}
function On_PluginInit() {
DataStore.Flush("BZSJ");
DataStore.Flush("Protected");
}
function On_PlayerHurt(HurtEvent) {
if (HurtEvent.Attacker != null && HurtEvent.Victim != null) {
var id = HurtEvent.Attacker.SteamID;
var idv = HurtEvent.Victim.SteamID;
if (DataStore.Get("Protected", idv)) {
HurtEvent.DamageAmount = 0;
HurtEvent.Attacker.Message("Player is under spawn protection");
return;
}
if (DataStore.Get("Protected", id)) {
HurtEvent.DamageAmount = 0;
HurtEvent.Attacker.Message("You are under spawn protection");
}
}
}
function On_PlayerSpawned(Player, SpawnEvent) {
var id = Player.SteamID;
if (DataStore.Get("Protected", id) == undefined || !DataStore.Get("Protected", id)) {
var jobParams = [];
jobParams.push(String(id));
// Start a timer by giving 10 sec removal time.
DataStore.Add("Protected", id, "protected");
BZSJ.addJob('protectdelay', 10, iJSON.stringify(jobParams));
Player.Message("You are protected for 10 seconds!");
Player.Message("You cannot kill or be killed by anyone till that time!");
}
}
// In Rust We Trust JSON serializer adapted (by mikec) from json2.js 2014-02-04 Public Domain.
// Most recent version from https://github.com/douglascrockford/JSON-js/blob/master/json2.js
var iJSON = {};
(function () {
'use strict';
function f(n) {
return n < 10 ? '0' + n : n;
}
var cx, escapable, gap, indent, meta, rep;
function quote(string) {
escapable.lastIndex = 0;
return escapable.test(string) ? '"' + string.replace(escapable, function (a) {
var c = meta[a];
return typeof c === 'string' ? c : '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
}) + '"' : '"' + string + '"';
}
function str(key, holder) {
var i, k, v, length, mind = gap, partial, value = holder[key];
if (value && typeof value === 'object' && typeof value.toJSON === 'function') {
value = value.toJSON(key);
}
switch (typeof value) {
case 'string':
return quote(value);
case 'number':
return isFinite(value) ? String(value) : 'null';
case 'boolean':
case 'null':
return String(value);
case 'object':
if (!value) { return 'null'; }
gap += indent;
partial = [];
if (Object.prototype.toString.apply(value) === '[object Array]') {
length = value.length;
for (i = 0; i < length; i += 1) {
partial[i] = str(i, value) || 'null';
}
v = partial.length === 0 ? '[]' : gap ? '[ ' + gap + partial.join(', ' + gap) + ' ' + mind + ']' : '[' + partial.join(',') + ']';
// v = partial.length === 0 ? '[]' : gap ? '[\n' + gap + partial.join(',\n' + gap) + '\n' + mind + ']' : '[' + partial.join(',') + ']';
gap = mind;
return v;
}
for (k in value) {
if (Object.prototype.hasOwnProperty.call(value, k)) {
v = str(k, value);
if (v) { partial.push(quote(k) + (gap ? ': ' : ':') + v); }
}
}
v = partial.length === 0 ? '{}' : gap ? '{ ' + gap + partial.join(', ' + gap) + ' ' + mind + '}' : '{' + partial.join(',') + '}';
// v = partial.length === 0 ? '{}' : gap ? '{\n' + gap + partial.join(',\n' + gap) + '\n' + mind + '}' : '{' + partial.join(',') + '}';
gap = mind;
return v;
}
}
if (typeof iJSON.stringify !== 'function') {
escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;
meta = { '\b': '\\b', '\t': '\\t', '\n': '\\n', '\f': '\\f', '\r': '\\r', '"' : '\\"', '\\': '\\\\' };
iJSON.stringify = function (value) { gap = ''; indent = ''; return str('', {'': value}); };
}
if (typeof iJSON.parse !== 'function') {
cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;
iJSON.parse = function (text, reviver) {
var j;
function walk(holder, key) {
var k, v, value = holder[key];
if (value && typeof value === 'object') {
for (k in value) {
if (Object.prototype.hasOwnProperty.call(value, k)) {
v = walk(value, k);
if (v !== undefined) {
value[k] = v;
} else {
delete value[k];
}
}
}
}
return reviver.call(holder, key, value);
}
text = String(text);
cx.lastIndex = 0;
if (cx.test(text)) {
text = text.replace(cx, function (a) {
return '\\u' +
('0000' + a.charCodeAt(0).toString(16)).slice(-4);
});
}
if (/^[\],:{}\s]*$/
.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, '@')
.replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']')
.replace(/(?:^|:|,)(?:\s*\[)+/g, ''))) {
j = eval('(' + text + ')');
return typeof reviver === 'function'
? walk({'': j}, '')
: j;
}
throw new SyntaxError('JSON.parse');
};
}
}());
8. Warcraft3 Mod: Highly doubt I will be able to finish this alone, or at all, but same abilities from WC3:Source - classes and abilities for each class. Great for BattleField Servers?
Not even going to put area for code XD
9. Extra Loot AND/OR Resources based on TotalTimeOnServer OR TimeSinceConnected/gets reset on disconnect (seems more fair) - Gets people to want to stay on your servers longer AND great for wipes, cause people that play a lot on your server will get more loot (if enabled for TotalTimeOnServer)
Code:
Space reserved for code.
10. Roll The Dice - Get random ability/perk/effect on player when uses /rtd - Godmode for specific time, resources, instant kill, uber hatchet, unlimited clip?, randomly teleported somewhere, frozen in place, drop inventory item(s) on ground, clear inventory, spawn animals on player, increased/decreased dmg dealt, dmg dealt causes knock back on player or victim, are just a few ideas. Obviously everything would be on a timer.
Code:
/Plugin: RollTheDice
//Author: CorrosionX
//Version: 0.1
function On_PluginInit(){
}
function On_Command(Player,cmd,args){
if(cmd == "rtd" || cmd == "rollthedice"){
var rnum = Math.floor((Math.random() * 30) + 1);
if(rnum == 1){killplayer(Player);} //Kill Player
if(rnum == 2){showjunk(Player);} //Turn nudity ON =D
if(rnum == 3){teleportthem();} //Teleport to place or person
if(rnum == 4){Player.Health = 10;} //Set Player health
if(rnum == 5){i=0;while(i<50){Player.Notice(string icon?????, "I Hope You Like Spam!", 10000);i++;};} //Spam their screen with notices
if(rnum == 6){Player.Inventory.Clear();}//clearinventory
if(rnum == 7){;}
if(rnum == 8){;}
if(rnum == 9){;}
if(rnum == 10){;}
if(rnum == 11){;}
if(rnum == 12){;}
if(rnum == 13){;}
if(rnum == 14){;}
if(rnum == 15){;}
}
function killplayer(Player){
try{if(Player != null){Player.Kill;}catch(err){Plugin.Log("Error", "Couldn't Kill Player! " + err.message);}
}
function showjunk(Player){
try{if(Player != null){Player.SendCommand("censor.nudity false"); Player.Notice("You might enjoy this a little too much..");}catch(err){Plugin.Log("Error", "Couldn't Turn Nudity On " + err.message);}
}
function teleportthem(Player){
var rnum2 = Math.floor((Math.random() * 2) + 1);var rnumx = Math.floor((Math.random() * 5000) + 1);
if(rnum2 != 1){var rnumz = Math.floor((Math.random() * 5000) + 1);var rnumy = GetTerrainHeight(rnumx,rnumz);rnumy+10;Player.TeleportTo(rnumx, rnumy, rnumz);Player.Notice("IDK where the heck you are!");}else{....????}catch(err){Plugin.Log("Error", "Couldn't Teleport Player " + err.message);}
}
Last edited: