The online racing simulator
[C#] Problem with Private Messages
Hi all

I have this code (command):

[Command("pm", "pm <username> <message>")]
public void pm(string Msg, string[] StrMsg, Packets.IS_MSO MSO)
{
if (StrMsg.Length > 2)
{
if (Connections[GetConnIdx(MSO.UCID)].Username == StrMsg[1] && StrMsg[1].Length > 1)
{
InSim.Send_MTC_MessageToConnection("^7» You can't send PM to yourself!", MSO.UCID, 0);
}
else
{
clsConnection Conn = Connections[GetConnIdx(MSO.UCID)];
bool PMUserFound = false;
foreach (clsConnection C in Connections)
{
string Message = Msg.Remove(0, C.Username.Length + 5);

if (C.Username == StrMsg[1] && StrMsg[1].Length > 1)
{
PMUserFound = true;

InSim.Send_MTC_MessageToConnection("^7--------------------------------------------------", MSO.UCID, 0);
InSim.Send_MTC_MessageToConnection("^7» Message Sent To: ^7" + C.NoColPlyName + " (" + C.Username + ")", MSO.UCID, 0);
InSim.Send_MTC_MessageToConnection("^7» Msg: ^7" + Message, MSO.UCID, 0);
InSim.Send_MTC_MessageToConnection("^7--------------------------------------------------", MSO.UCID, 0);

PMBox("> PM Msg From: " + C.NoColPlyName + " (" + C.Username + ") to " + C.NoColPlyName + " (" + C.Username + ")");
PMBox("> Msg: " + Message);

InSim.Send_MTC_MessageToConnection("^7--------------------------------------------------", MSO.UCID, 0);
InSim.Send_MTC_MessageToConnection("^7» PM From: ^7" + C.NoColPlyName + " (" + C.Username + ")", C.UniqueID, 0);
InSim.Send_MTC_MessageToConnection("^7» Msg: ^7" + Message, C.UniqueID, 0);
InSim.Send_MTC_MessageToConnection("^7--------------------------------------------------", MSO.UCID, 0);
InSim.Send_MTC_MessageToConnection("^7» To reply use ^2!pm " + Conn.Username + " <message>", C.UniqueID, 0);

foreach (clsConnection F in Connections)
{
if ((F.IsAdmin == 1 && F.IsSuperAdmin == 1 && F.IsModerator ==1 ) && F.UniqueID != MSO.UCID)
{
InSim.Send_MTC_MessageToConnection("^7--------------------------------------------------", MSO.UCID, 0);
InSim.Send_MTC_MessageToConnection("^7» PM From: ^7" + Conn.NoColPlyName + " to " + C.NoColPlyName, F.UniqueID, 0);
InSim.Send_MTC_MessageToConnection("^7» Msg: ^7" + Message, F.UniqueID, 0);
InSim.Send_MTC_MessageToConnection("^7--------------------------------------------------", MSO.UCID, 0);
}
}
}
}
if (PMUserFound == false)
{
InSim.Send_MTC_MessageToConnection("^7» Username not found.", MSO.UCID, 0);
}
}
}
else
{
InSim.Send_MTC_MessageToConnection("^7» Invalid Command.", MSO.UCID, 0);
}
}

...problem is that after a player sends the message to appear a few more lines (InSim.Send_MTC_MessageToConnection("^7--------- blablabla) and do not know what's wrong
Nobody ? ):
Hello,

What's changed from real IC to yours?

Regards, i-love-cruise
What u mean ?
You use iC Cruise. It's working in original iC cruise code.
No I just have iC by a model

FGED GREDG RDFGDR GSFDG