Well this plugin is just made for fun that's why i named it FunDrop It give players a Lethal & Tactical drop when they got killed.
Items: Grenade, ac130 strike, Stun, Flash, Smoke, Semtex, EMP-grenade, Predator, Reaper-UAV, RPG, Stinger, Javelin, IMS, Assault-Drone, SAM-Turret.
Add these lines into sv_config.ini
Use permission plugin if you want to restrict commands.
Items: Grenade, ac130 strike, Stun, Flash, Smoke, Semtex, EMP-grenade, Predator, Reaper-UAV, RPG, Stinger, Javelin, IMS, Assault-Drone, SAM-Turret.
Commands (Click to View)
Code:
!try grenade //drop grenade
!try smoke //drop smoke
!try stun //drop stun
!try flash //drop flash
!try emp //drop emp grenade
!try semtex //drop semtex
!try ac130 //drop ac130 strike //detonate after some time.
!try predator //drop predator strike
!try rpg //drop rpg rocket //detonate after some time.
!try uav // drop reaper-uav missile
!try stinger //drop stinger rocket
!try javelin //drop javelin missile
!try drone //drop assault drone missile
!try ims //drop ims blast //detonate after some time.
!try sam //drop sam turret missile
!random 1 //to enable random mode // will disable set commands
!random 0 //to disable random mode
Add these lines into sv_config.ini
Code:
[FunDrop]
Random=0
Time=45
//In Secs
Use permission plugin if you want to restrict commands.
Source-Updated (Click to View)
CSHARP Code
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using Addon;
- using System.Runtime.InteropServices;
- using System.Timers;
-
- namespace fundrop
- {
- public class Class1 : CPlugin
- {
- private static Timer random;
- [DllImport("kernel32.dll", SetLastError = true)]
- public static extern bool WriteProcessMemory(IntPtr hProcess, int lpBaseAddress, byte[] lpBuffer, int nSize, out int lpNumberOfBytesWritten);
- unsafe public override void OnServerLoad()
- {
- ServerPrint("FunDrop Plugin by YAMRAJ");
- int oP;
- byte[] bytes = { 0x90, 0x90, 0x90, 0x90, 0x90, 0x90 };
- WriteProcessMemory(((IntPtr)(-1)), 0x0047EFD2, bytes, bytes.Length, out oP);
- if (GetServerCFG("FunDrop", "Random", "-1") == "-1")
- {
- SetServerCFG("FunDrop", "Random", "0");
- }
- if (GetServerCFG("FunDrop", "Time", "-1") == "-1")
- {
- SetServerCFG("FunDrop", "Time", "45");
- }
- string Time = GetServerCFG("FunDrop", "Time", "");
- int time = Convert.ToInt32(Time);
- if (GetServerCFG("FunDrop", "Random", "") == "1")
- {
- random.Start();
- }
- }
- private void randomize(object sender, ElapsedEventArgs ea)
- {
- List<string> items = new List<string> { "frag_grenade_mp", "semtex_mp", "flash_grenade_mp", "concussion_grenade_mp", "smoke_grenade_mp", "emp_grenade_mp", "ac130_105mm_mp", "remotemissile_projectile_mp", "rpg_mp", "stinger_mp", "javelin_mp", "sam_projectile_mp", "ims_projectile_mp", "remote_mortar_missile_mp", "remote_tank_projectile_mp" };
- int index = items_rand.Next(0, 15);
- string value = items[index];
- SetDvar("perk_grenadedeath", value);
- }
- public override ChatType OnSay(string Message, ServerClient Client)
- {
- string lowMsg = Message.ToLower();
- if (lowMsg == ("!random 0"))
- {
- if (GetServerCFG("FunDrop", "Random", "") == "0")
- {
- TellClient(Client.ClientNum, "^1FunDrop: ^7Random mode already disabled.", true);
- }
- else if (GetServerCFG("FunDrop", "Random", "") == "1")
- {
- random.Stop();
- SetServerCFG("FunDrop", "Random", "0");
- TellClient(Client.ClientNum, "^1FunDrop: ^7Random mode disabled.", true);
- }
- return ChatType.ChatNone;
- }
- else if (lowMsg == ("!random 1"))
- {
- if (GetServerCFG("FunDrop", "Random", "") == "0")
- {
- random.Start();
- SetServerCFG("FunDrop", "Random", "1");
- TellClient(Client.ClientNum, "^1FunDrop: ^7Random mode enabled.", true);
- }
- else if (GetServerCFG("FunDrop", "Random", "") == "1")
- {
- TellClient(Client.ClientNum, "^1FunDrop: ^7Random mode already enabled.", true);
- }
- return ChatType.ChatNone;
- }
-
- if (lowMsg.StartsWith("!try"))
- {
- if (GetServerCFG("FunDrop", "Random", "") == "0")
- {
- if (lowMsg == "!try grenade")
- {
- SetDvar("perk_grenadedeath", "frag_grenade_mp");
- iPrintLnBold("^1FunDrop:^7 Changed to ^1Grenade.", null);
- }
- else if (lowMsg == "!try semtex")
- {
- SetDvar("perk_grenadedeath", "semtex_mp");
- iPrintLnBold("^1FunDrop:^7 Changed to ^1Semtex.", null);
- }
- else if (lowMsg == "!try flash")
- {
- SetDvar("perk_grenadedeath", "flash_grenade_mp");
- iPrintLnBold("^1FunDrop:^7 Changed to ^1Flash.", null);
- }
- else if (lowMsg == "!try stun")
- {
- SetDvar("perk_grenadedeath", "concussion_grenade_mp");
- iPrintLnBold("^1FunDrop:^7 Changed to ^1Stun.", null);
- }
- else if (lowMsg == "!try smoke")
- {
- SetDvar("perk_grenadedeath", "smoke_grenade_mp");
- iPrintLnBold("^1FunDrop:^7 Changed to ^1Smoke.", null);
- }
- else if (lowMsg == "!try emp")
- {
- SetDvar("perk_grenadedeath", "emp_grenade_mp");
- iPrintLnBold("^1FunDrop:^7 Changed to ^1EMP Grenade.", null);
- }
- else if (lowMsg == "!try ac130")
- {
- SetDvar("perk_grenadedeath", "ac130_105mm_mp");
- iPrintLnBold("^1FunDrop:^7 Changed to ^1ac130.", null);
- }
- else if (lowMsg == "!try predator")
- {
- SetDvar("perk_grenadedeath", "remotemissile_projectile_mp");
- iPrintLnBold("^1FunDrop:^7 Changed to ^1Predator.", null);
- }
- else if (lowMsg == "!try rpg")
- {
- SetDvar("perk_grenadedeath", "rpg_mp");
- iPrintLnBold("^1FunDrop:^7 Changed to ^1RPG.", null);
- }
- else if (lowMsg == "!try stinger")
- {
- SetDvar("perk_grenadedeath", "stinger_mp");
- iPrintLnBold("^1FunDrop:^7 Changed to ^1Stinger.", null);
- }
- else if (lowMsg == "!try javelin")
- {
- SetDvar("perk_grenadedeath", "javelin_mp");
- iPrintLnBold("^1FunDrop:^7 Changed to ^1Javelin.", null);
- }
- else if (lowMsg == "!try sam")
- {
- SetDvar("perk_grenadedeath", "sam_projectile_mp");
- iPrintLnBold("^1FunDrop:^7 Changed to ^1SAM turret.", null);
- }
- else if (lowMsg == "!try ims")
- {
- SetDvar("perk_grenadedeath", "ims_projectile_mp");
- iPrintLnBold("^1FunDrop:^7 Changed to ^1IMS.", null);
- }
- else if (lowMsg == "!try uav")
- {
- SetDvar("perk_grenadedeath", "remote_mortar_missile_mp");
- iPrintLnBold("^1FunDrop:^7 Changed to ^1Reaper-UAV.", null);
- }
- else if (lowMsg == "!try drone")
- {
- SetDvar("perk_grenadedeath", "remote_tank_projectile_mp");
- iPrintLnBold("^1FunDrop:^7 Changed to ^1Assault Drone.", null);
- }
- else
- {
- TellClient(Client.ClientNum, "^1FunDrop: ^7Usage !try <item>", true);
- }
- }
- else if (GetServerCFG("FunDrop", "Random", "") == "1")
- {
- {
- TellClient(Client.ClientNum, "^1FunDrop: ^7Random mode is currently enabled use ^1!random 0 ^7to use !set commands.", true);
- }
- }
- return ChatType.ChatNone;
- }
- return ChatType.ChatContinue;
- }
-
- }
- }