The online racing simulator
#1 - Ziroh
!track <trackname> admin command - C#
Hey, can somebody help me with this command for admins?
It should change track when race is stopped.
(!track <trackname>)
I'm using C# and have a LFS_External InSim..

Where and what should the Fileinfo be?
Heya here some help
hope so far that it helps

case "!track":

if ( Connections[GetConnIdx(MSO.UCID)].IsAdmin == 1)
{
try
{
if (StrMsg.Length > 0)
{
if (StrMsg[1].Contains("-"))
InSim.Send_MTC_MessageToConnection("^1InSim:^7 Unknown Command", MSO.UCID, 0);
else
{
InSim.Send_MST_Message("/msg ^6- ^7Changed the track to ^6- ^7" + (StrMsg[1]));
InSim.Send_MST_Message("/track " + (StrMsg[1]));



}
}
}
catch
{
InSim.Send_MTC_MessageToConnection("^1InSim:^7 Go to race menu!", MSO.UCID, 0);
break;
}
}
else InSim.Send_MTC_MessageToConnection("^1InSim:^7 Command not Authorized!", MSO.UCID, 0);
break;

Hope that will help you

Regards Heiko1
#3 - Ziroh
ah, lovely

Thanks!
How it's working? Send_MST_Message is trigerring error?
that code wont work properly in your insim either because you are using admins from a .txt file you need to change it to this

case "!track":

if (FileInfo.IsAdmin(Connections[GetConnIdx(MSO.UCID)].Username) == true)
{
try
{
if (StrMsg.Length > 0)
{
if (StrMsg[1].Contains("-"))
InSim.Send_MTC_MessageToConnection("^1InSim:^7 Unknown Command", MSO.UCID, 0);
else
{
InSim.Send_MST_Message("/msg ^6- ^7Changed the track to ^6- ^7" + (StrMsg[1]));
InSim.Send_MST_Message("/track " + (StrMsg[1]));



}
}
}
catch
{
InSim.Send_MTC_MessageToConnection("^1InSim:^7 Go to race menu!", MSO.UCID, 0);
break;
}
}
else InSim.Send_MTC_MessageToConnection("^1InSim:^7 Command not Authorized!", MSO.UCID, 0);
break;

#6 - Ziroh
Quote from Robbo01 :that code wont work properly in your insim either because you are using admins from a .txt file you need to change it to this

case "!track":

if (FileInfo.IsAdmin(Connections[GetConnIdx(MSO.UCID)].Username) == true)
{
try
{
if (StrMsg.Length > 0)
{
if (StrMsg[1].Contains("-"))
InSim.Send_MTC_MessageToConnection("^1InSim:^7 Unknown Command", MSO.UCID, 0);
else
{
InSim.Send_MST_Message("/msg ^6- ^7Changed the track to ^6- ^7" + (StrMsg[1]));
InSim.Send_MST_Message("/track " + (StrMsg[1]));



}
}
}
catch
{
InSim.Send_MTC_MessageToConnection("^1InSim:^7 Go to race menu!", MSO.UCID, 0);
break;
}
}
else InSim.Send_MTC_MessageToConnection("^1InSim:^7 Command not Authorized!", MSO.UCID, 0);
break;


I found out and fixed it
-
(Lisnu) DELETED by Lisnu : looks like shit
-
(Lisnu) DELETED by Lisnu : llooll

FGED GREDG RDFGDR GSFDG