ItsMods
[Release] Marauder & Last Alive v 2.0 - Printable Version

+- ItsMods (https://www.itsmods.com)
+-- Forum: Call of Duty Franchise (https://www.itsmods.com/Forum-Call-of-Duty-Franchise.html)
+--- Forum: Call of Duty: Modern Warfare 3 (https://www.itsmods.com/Forum-Call-of-Duty-Modern-Warfare-3.html)
+---- Forum: Tools (https://www.itsmods.com/Forum-Tools--127.html)
+----- Forum: MW3 Server Addon (https://www.itsmods.com/Forum-MW3-Server-Addon.html)
+------ Forum: Plugin Releases (https://www.itsmods.com/Forum-Plugin-Releases.html)
+------ Thread: [Release] Marauder & Last Alive v 2.0 (/Thread-Release-Marauder-Last-Alive-v-2-0.html)

Pages: 1 2


Marauder & Last Alive v 2.0 - [HARD] Tony. - 10-01-2013


creators
@xtreme2010 (coding)
@[Z00MBY]Alex (idea)
@[HARD] Tony_M (testing and releasing)

ITS VERSION FIXED ALL BUGS


Code:
using System; using System.Collections; using System.Collections.Generic; using System.Linq; using System.Text; using Addon; namespace Marauder { public class Main : CPlugin { List<Vector> Position = new List<Vector>(); List<int> WeaponID = new List<int>(); List<int> Ammo = new List<int>(); List<int> AmmoClip = new List<int>(); List<Entity> WepModel = new List<Entity>(); //HUD Element Dictionary<int, int> Client_Marauder = new Dictionary<int, int>(); //Client Data Dictionary<int, int> Client_Weapon = new Dictionary<int, int>(); Dictionary<int, bool> Client_Premium = new Dictionary<int, bool>(); Dictionary<int, string> Client_WeaponModel = new Dictionary<int, string>(); bool LAST_ALLIES = false; public bool LastAllies() { int ALLIES = 0, AXIS = 0; ServerClient client = null; for (int i = 0; i < 18; i++) { client = GetClient(i); if (client != null) { if (client.Team == Teams.Allies) { ALLIES++; } else { AXIS++; } } } //(Axis > 4) if (ALLIES == 1 && AXIS > 4) { return true; } return false; } public override void OnServerLoad() { ServerPrint("***************************************"); ServerPrint("[Marauder] xtreme2010[at]ukr.net**********"); ServerPrint("[Marauder] Created by [MEM]So Close****"); ServerPrint("***************loaded******************"); } public override int OnPlayerDamaged(ServerClient Attacker, ServerClient Victim, string Weapon, int Damage) { if (Victim.Team == Teams.Allies && Client_Premium[Victim.ClientNum] == true && Damage >= Victim.Other.Health && Attacker.Team != Victim.Team) { WeaponID.Add(Client_Weapon[Victim.ClientNum]); Ammo.Add(Victim.Ammo.PrimaryAmmo); AmmoClip.Add(Victim.Ammo.PrimaryAmmoClip); Position.Add(new Vector(Victim.OriginX, Victim.OriginY, Victim.OriginZ)); float zDifference = Victim.OriginZ + 10; WepModel.Add(SpawnModel("script_model", Client_WeaponModel[Victim.ClientNum], new Vector(Victim.OriginX, Victim.OriginY, zDifference))); } if (Attacker.Team == Teams.Allies && Damage >= Victim.Other.Health) { if (LastAllies() && !LAST_ALLIES) { iPrintLnBold("^2" + Attacker.Name + " ^3Last Survivor!", null); if (Weapon == "iw5_1887_mp" || Weapon == "iw5_striker_mp" || Weapon == "iw5_aa12_mp" || Weapon == "iw5_usas12_mp" || Weapon == "iw5_spas12_mp" || Weapon == "iw5_ksg_mp") { int weapon = GetWeapon("iw5_acr_mp_camo10"); Attacker.Other.PrimaryWeapon = weapon; Attacker.Other.CurrentWeapon = weapon; Attacker.Other.PrimaryWeaponAkimbo = true; Attacker.Other.SecondaryWeaponAkimbo = true; Attacker.Ammo.PrimaryAmmoClip = 350; Attacker.Ammo.PrimaryAmmo = 30; Attacker.Ammo.PrimaryAkimboAmmo = 30; } Attacker.Other.Health += 140; Attacker.Other.SpeedScale = 1.12f; Attacker.Other.SetPerk(GetPerk("specialty_fastreload")); LAST_ALLIES = true; } } return Damage; } Dictionary<int, int> ProcessSpawn = new Dictionary<int, int>(); public override void OnPlayerSpawned(ServerClient Client) { try { ProcessSpawn.Add(Client.ClientNum, 2 * 1000 / AddonFrameInterval); } catch { // :D } } public void Donate() { List<int> PSKeys = new List<int>(ProcessSpawn.Keys); foreach (int key in PSKeys) { ProcessSpawn[key]--; if (ProcessSpawn[key] == 0) { ServerClient spawnedPlayer = GetClient(key); try { if (spawnedPlayer.Team == Teams.Axis) { spawnedPlayer.Other.Health = 175; spawnedPlayer.Other.MaxHealth = 175; spawnedPlayer.Other.SpeedScale = 1.12f; spawnedPlayer.Other.UAV.Enabled = false; spawnedPlayer.Other.UAV.FastUpdate = false; spawnedPlayer.Other.UAV.ShowDirection = false; Client_Premium[spawnedPlayer.ClientNum] = false; } if (spawnedPlayer.Team == Teams.Allies) { if (spawnedPlayer.XUID == "011000010745aeaf") { int WepID = GetWeapon("iw5_type95_mp_camo02"); spawnedPlayer.Other.PrimaryWeapon = WepID; spawnedPlayer.Other.CurrentWeapon = WepID; spawnedPlayer.Ammo.PrimaryAmmo = 30; spawnedPlayer.Ammo.PrimaryAmmoClip = 90; //WepID Client_WeaponModel[spawnedPlayer.ClientNum] = "weapon_type95_iw5_winter"; //WepID Client_Weapon[spawnedPlayer.ClientNum] = WepID; // (/) Client_Premium[spawnedPlayer.ClientNum] = true; spawnedPlayer.Other.SetPerk(GetPerk("specialty_fastreload")); iPrintLnBold("^1Premium Weapons ^2Active!", spawnedPlayer); } if (spawnedPlayer.XUID == "01100001048d4b53") { int WepID = GetWeapon("iw5_type95_mp_xmags_camo02"); spawnedPlayer.Other.PrimaryWeapon = WepID; spawnedPlayer.Other.CurrentWeapon = WepID; spawnedPlayer.Ammo.PrimaryAmmo = 30; spawnedPlayer.Ammo.PrimaryAmmoClip = 90; //WepID Client_WeaponModel[spawnedPlayer.ClientNum] = "weapon_type95_iw5_snow"; //WepID Client_Weapon[spawnedPlayer.ClientNum] = WepID; // (/) Client_Premium[spawnedPlayer.ClientNum] = false; spawnedPlayer.Other.SetPerk(GetPerk("specialty_fastreload")); iPrintLnBold("^1Premium Weapons ^2Active!", spawnedPlayer); } } } catch { } ProcessSpawn.Remove(key); } } } public override void OnAddonFrame() { List<ServerClient> clients; try { clients = GetClients(); if (clients != null && clients.Count > 0) { foreach (ServerClient c in GetClients()) { if (c.Other.isAlive == true) { HudElem mar = GetHudElement(Client_Marauder[c.ClientNum]); if (Position != null) { for (int i = 0; i < Position.Count; i++) { if ((Difference(c.OriginY, Position[i].Y) <= 35) && (Difference(c.OriginX, Position[i].X) <= 35)) { if (c.Team == Teams.Allies) { mar.SetString("Press ^3F^7 to ^1take weapon!"); if (c.Other.ButtonPressed(Buttons.Activate)) { c.Other.PrimaryWeapon = WeaponID[i]; c.Other.CurrentWeapon = WeaponID[i]; c.Ammo.PrimaryAmmo = Ammo[i]; c.Ammo.PrimaryAmmoClip = AmmoClip[i]; PlaySoundOnPlayer(c, "scavenger_pack_pickup"); Position.RemoveAt(i); WeaponID.RemoveAt(i); Ammo.RemoveAt(i); AmmoClip.RemoveAt(i); WepModel[i].Delete(); WepModel.RemoveAt(i); mar.SetString(""); } } else { mar.SetString("^1Only the survivors can use it!"); } break; } else { mar.SetString(""); } } } } } } } catch { //ServerPrint("Error Marauder: " + z.Message); } Donate(); } public override void OnMapChange() { WepModel.Clear(); WeaponID.Clear(); Ammo.Clear(); AmmoClip.Clear(); Position.Clear(); LAST_ALLIES = false; } public override void OnFastRestart() { OnMapChange(); } public override void OnPlayerConnect(ServerClient Client) { int HudElem = CreateHud(Client.ClientNum); if (Client_Marauder.ContainsKey(Client.ClientNum)) { Client_Marauder[Client.ClientNum] = HudElem; } else { Client_Marauder.Add(Client.ClientNum, HudElem); } if (Client_Premium.ContainsKey(Client.ClientNum)) { Client_Premium[Client.ClientNum] = false; } else { Client_Premium.Add(Client.ClientNum, false); } } public override void OnPlayerDisconnect(ServerClient Client) { if (Client_Marauder.ContainsKey(Client.ClientNum)) { HudElem m = GetHudElement(Client_Marauder[Client.ClientNum]); m.Type = HudElementTypes.None; Client_Marauder.Remove(Client.ClientNum); } if (Client_Premium.ContainsKey(Client.ClientNum)) { Client_Premium.Remove(Client.ClientNum); } } public static float Difference(float loc, float loc2) { return Math.Abs(loc - loc2); } private int CreateHud(int ClientNum) { HudElem hud = CreateNewHudElem(); hud.Type = HudElementTypes.Text; hud.ShowToEnt = ClientNum; hud.HideInMenu = true; hud.Font = HudElementFonts.Default; hud.FontScale = 1.5f; hud.PointType = 120; hud.OriginY = 180f; hud.OriginX = -100f; hud.SetString(""); return hud.HudElementNum; } } }



RE: Marauder & Last Alive v 2.0 - Nekochan - 10-01-2013

Code:
... Premium.... Donate...
You just forgot to rename them or got those methods/variables from nowhere? Troll

I hope it'll work better than another plugins.


RE: Marauder & Last Alive v 2.0 - hillbilly - 10-01-2013

last one was buggy and messed up health surv couldnt be killed.


RE: Marauder & Last Alive v 2.0 - Slimpy - 10-02-2013

Can you make the dll for me?

Meow


RE: Marauder & Last Alive v 2.0 - [HARD] Tony. - 10-02-2013

(10-02-2013, 06:08)Slimpy Wrote: Can you make the dll for me?


[/size]

Meow[/align][/code]
[/font]

Slimpy why you dll? you have a server?


RE: Marauder & Last Alive v 2.0 - Slimpy - 10-03-2013

(10-02-2013, 11:36)[HARD] Tony. Wrote:
(10-02-2013, 06:08)Slimpy Wrote: Can you make the dll for me?


[/size]

Meow[/align][/code]
[/font]

Slimpy why you dll? you have a server?
I need the dll for my server (It's for only me and my brother Big Grin)

I just want the premium weapon dll made for me, Cause I suck at C# SadSadSadSadSadSadSad


RE: Marauder & Last Alive v 2.0 - EnVi Sweden Rocks - 10-03-2013

download the Plugin Maker from @SailorMoon easy to use and easy to create mods in .dll files!


RE: Marauder & Last Alive v 2.0 - Slimpy - 10-03-2013

(10-03-2013, 06:17)EnVi Sweden Rocks Wrote: download the Plugin Maker from @SailorMoon easy to use and easy to create mods in .dll files!

There's an error on line 4. It says "The type or namespace name 'Linq' does not exist in the namespace 'System'."


RE: Marauder & Last Alive v 2.0 - EnVi Sweden Rocks - 10-03-2013

delete that area and it should work to complie


RE: Marauder & Last Alive v 2.0 - Slimpy - 10-03-2013

(10-03-2013, 06:52)EnVi Sweden Rocks Wrote: delete that area and it should work to complie

I deleted it and it didn't work.