hi everyone
I'm a Noob in programming but
i'm trying to make a insim Just for practising programming with C#
i have lil problems with 2 case commands
1st
i get an error
System.Threading.Thread.Sleep() doesnt work
is there anyone who can help me
thx
Bass-Driver
I'm a Noob in programming but
i'm trying to make a insim Just for practising programming with C#
i have lil problems with 2 case commands
1st
case "!ban":
try
{
if (StrMsg.Length > 2)
{
if (Connections[GetConnIdx(MSO.UCID)].IsAdmin == 1)
{
int Days = int.Parse(StrMsg[1]);
foreach (clsConnection C in Connections)
{
if (C.Username == Msg.Remove(0,9 + StrMsg[1].Length))
{
InSim.Send_MST_Message("/msg " + C.PlayerName + "^7 is ^1Banned ^7by ");
InSim.Send_MST_Message("/msg " + Connections[GetConnIdx(MSO.UCID)].PlayerName);
InSim.Send_MST_Message("/msg ^7" + Days + "^7 Days");
InSim.Send_MST_Message("/ban " + C.Username + (Days));
}
else
{
InSim.Send_MTC_MessageToConnection("^1User Not Found!!!", (MSO.UCID), 0);
}
}
}
else if (Connections[GetConnIdx(MSO.UCID)].IsAdmin == 0)
{
InSim.Send_MTC_MessageToConnection("^3^1U are not an admin", (MSO.UCID), 0);
}
}
}
catch (Exception EX)
{
MessageBox.Show("!BanCommand - " + EX.Message);
}
break;
i get an error
case "!insimrestart":
if (StrMsg.Length >= 1)
{
if (Connections[GetConnIdx(MSO.UCID)].Username == "Bass-Driver")
{
System.Diagnostics.Process.Start("LFS_External_Client.exe");
InSim.Send_MST_Message("/msg ^3^1WARNING ^7Insim Reboot!!!!");
InSim.Send_MST_Message("/msg ^3^7Insim Reboot in 5 Seconds!!!!");
[SIZE=2][COLOR=#2b91af][SIZE=2][COLOR=#2b91af][SIZE=2][COLOR=black]System.Threading.[/COLOR][/SIZE][SIZE=2][COLOR=#2b91af][SIZE=2][COLOR=#2b91af]Thread[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=black].Sleep[/COLOR][/SIZE][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2](50000);[/SIZE]
[SIZE=2]InSim.Close();
[/SIZE][SIZE=2][COLOR=#2b91af][SIZE=2][COLOR=#2b91af][SIZE=2][COLOR=black]System.Threading.[/COLOR][/SIZE][SIZE=2][COLOR=#2b91af][SIZE=2][COLOR=#2b91af]Thread[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=black].[/COLOR][COLOR=black]Sleep[/COLOR][/SIZE][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2](1000);
[/SIZE]InSim.Connect();
InSim.Send_MST_Message("/msg ^3^7 Connections: " + Connections.Count);
}
}
break;
System.Threading.Thread.Sleep() doesnt work
is there anyone who can help me
thx
Bass-Driver