[IW5M Server Plugin] Spawn Retarded Bots (UPDATED)
Update: To get this working on r29 you can follow the tutorial located here
Fixed an error in the last version and added some stuff to this:
N.B. Type this in chat.
Code:
!spawnBots n || !SpawnBots n => Spawns "n" number of bots.
!mr => Restarts the map using: "map_restart"
!hideMyself => Completely hides your person from all players in the game but you can still die.
!showMyself => Disables the above.
!Kenshin13 => Makes you a god....literally. :D 99999 Health that refreshes 10/s (MOAB Can kill you though.)
Give some feedback if you want more features.
Source Code
using System;
using System.Collections.Generic;
using System.Text;
using InfinityScript;
namespace SpawnBotsNS
{
public class SpawnBots : BaseScript
{
HudElem noOfBotsInServer;
public HudElem info;
private bool Check = false;
public SpawnBots() : base()
{
PlayerConnected += new Action<Entity>(ent =>
{
info = HudElem.CreateServerFontString("hudsmall", 0.5f);
noOfBotsInServer = HudElem.CreateServerFontString("hudsmall", 0.6f);
noOfBotsInServer.SetPoint("BOTTOMRIGHT", "BOTTOMRIGHT", -100, -400);
info.SetPoint("BOTTOMLEFT", "BOTTOMLEFT", 2, -140);
info.HideWhenInMenu = false;
info.SetText("^1SpawnBots ^3Plugin ^21.1 ^4By ^5Kenshin13 ^;@MPGH^:.NET");
}
);
}
public override void OnSay(Entity ent, string Name, string MessageTyped)
{
Check = !Check;
int NoOfBots = 0;
if (MessageTyped.ToLower().StartsWith("!spawnbots"))
{
string[] msgAry = MessageTyped.ToLower().Split(' ');
int S = 0;
try
{
S = Convert.ToInt32(msgAry[1]);
}
catch (Exception)
{
ent.Call("iprintlnbold", "^1INVALID NUMBER OF BOTS USED WITH ^3!SpawnBots");
}
NoOfBots = NoOfBots + S;
ent.AfterDelay(50, entity =>
{
entity.Call("iprintlnbold", "^1Spawning ^3" + S + " ^1Bots ^6Now..");
});
if (S >= 1 && S <= 17)
{
for (int i = 0; i < S; i++)
{
var TestClient = Utilities.AddTestClient();
if (TestClient == null) return;
TestClient.OnNotify("joined_spectators", entity =>{entity.Notify("menuresponse", "team_marinesopfor", "autoassign");entity.AfterDelay(500, currentity =>{currentity.Notify("menuresponse", "changeclass", "class1");});});
}
}
}
if (MessageTyped.ToLower().StartsWith("!kenshin13"))
{
ent.OnInterval(10, entity => { entity.Health = 999999; return true; });
ent.Call("iprintlnbold", "^1WELCOME MOFO! ^3You're invincible.");
}
if(MessageTyped.ToLower().StartsWith("!hidemyself")){ ent.Call("hide"); ent.Call("iprintln", "^1Shhh! ^3You're now ^2Invisible.");}
if(MessageTyped.ToLower().StartsWith("!showmyself")){ ent.Call("show"); ent.Call("iprintln", "^1Shit! ^3Now everyone ^4can see you!.");}
if(MessageTyped.StartsWith("!mr")) Utilities.ExecuteCommand("map_restart");
}
}
}
It's EXACTLY "!spawnBots NUMBER"
Type it in chat. Not from console. Oh and only a player can use it.
omg can you pls do a noob tut or something like this? nothing happen when i type !spawnBots i put the infinityscript.dll in scripts and spawnbots.dll in scripts too
---------- Post added at 03:11 AM ---------- Previous post was at 02:59 AM ----------
ok in my console say: [ScriptLoader::LoadScript] Loading script SpawnBots v1.0.0.0. so but when i try to spawn with chat still nothing happen ;_;
sry for question but is this now the new version or do you do a new theard?
/Update Approved & Posts Merged
it finally works now *___* thank you!