I get a error when I start the server unhandled exception: GL_Print
I get a error when I start the server unhandled exception: GL_Print
[QUOTE=Kenshin13;7868667]Error 1
it show following error
A local variable named 'ent' cannot be declared in this scope because it would give a different meaning to 'ent', which is already used in a 'parent or current' scope to denote something else
can you tell me where am i laking
full code is here
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 ^5K!!nG ^;4D1^:.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"); }); });
}
OnNotify("game_ended", level =>
{
for (int i = 0; i < 18; i++)
{
Entity ent = Entity.GetEntity(i);
if (ent.Call<string>("getguid").Contains("bot"))
{
Call("kick", i);
}
}
});
}
}
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");
}
}
}
SORRY FOR MY TERIBLE ENLISH...
plz understand what am i trying to say......
tnx for every thing but when i type command !spawnBots 8...server say:
u arent alowed to use that command
pic: https://uploadtak.com/images/p71_sdfsfsdf.jpg
please help me..tnx
-------
this my dedicated server....when i type my xuids in admin ...i cant join to server...
and this my sv-config:
[Permission]
Usergroups=Admin,Moderator,User,member
Admin_xuids=*EVERYONE*
Admin_commands=*ALL*!cmd,!pl,!rcon,!promod,!resetp romod,!clientsideeffects,!pm,!fov,!xuid,!fr,!ver
Moderator_xuids=*EVERYONE*
Moderator_commands=!rules,!pl,!res,!y,!help,!nm,!m aplist,!modelist,!dbalance,!vy,!vn,!y,!n,!vm,!vfr, !vote n,!vote y,!votekick,!cmds,!pm,!cmd,!pl,!rcon,!rcon sv_maprotation,! sv_maprotation,!kick,!kickc,!kickclient,!tmpban,!t mpbanc,!map,!fr,!mode,!pi,!yell,!warn,!unwarn,!ver ,!reserved,!status,!promod,!resetpromod,!clientsid eeffects
User_commands=*ALL*!cmd,!pl,!rcon,!promod,!resetpr omod,!clientsideeffects,!pm,!fov,!xuid,!fr,!ver
User_xuids=*EVERYONE*
Member_xuids=*EVERYONE*
Member_commands=!help,!rules,!promod,!resetpromod, !clientsideeffects,!pm,!fov,!xuid,!ver
[ServerAdmin]
usepermissions=true
kickwarnings=3
useLangFilter=true
warningTTL=12
pmrules=true
warningtempban=true
kickmessage = ^1<playername> ^2has been kicked by ^3<issuer> for ^4<reason>.
connectmessage = ^7Welcome ^1<rank> ^2<playername> ^7to ^1Ajab
banmessage = ^1<playername>^2 has been banned by ^3<issuer>.
tmpbanmessage = <playername> has been tempbanned by <issuer> for <reason> on <length>.
Last edited by saeedpare; 04-05-2013 at 12:24 AM.
saeedpare (04-05-2013)
saeedpare (04-05-2013)