Hi.
Im looking for help in code.
I want to add the rank "supporter" (works but not how I want). Problem is with saving rank in .txt file. Command add rank to player but when play leave host this back to Supporter = 0
command:
When it did not work i just copy all from Moderator rank, because Mod works and its sam thing but still nothing.
It is in NewConn section and in FileInfo same like Moderator rank but still same problem.
No idea what i do wrong when there is no difference between ranks.
Other:
NewCruiser:
SaveUser:
SaveOffline
Any ideas?
Im looking for help in code.
I want to add the rank "supporter" (works but not how I want). Problem is with saving rank in .txt file. Command add rank to player but when play leave host this back to Supporter = 0
command:
[Command("addsupp", "addsupp <username>")]
public void addsupp(string Msg, string[] StrMsg, Packets.IS_MSO MSO)
{
clsConnection Conn = Connections[GetConnIdx(MSO.UCID)];
if (StrMsg.Length > 1)
{
if (Conn.IsAdmin == 1 || Conn.IsSuperAdmin == 1 || Conn.IsModerator == 1)
{
foreach (clsConnection l in Connections)
{
if (l.Username == StrMsg[1] && StrMsg[1].Length > 1)
{
MsgAll("^6»^7 " + l.PlayerName + " ^7Added as ^6Supporter");
MsgAll("^6»^7 By: " + Conn.PlayerName);
l.IsSupporter = 1;
}
}
}
}
else
{
InSim.Send_MTC_MessageToConnection("^7Invalid command or Not autorized!", MSO.UCID, 0);
}
}
When it did not work i just copy all from Moderator rank, because Mod works and its sam thing but still nothing.
It is in NewConn section and in FileInfo same like Moderator rank but still same problem.
No idea what i do wrong when there is no difference between ranks.
Other:
public byte IsSupporter;
NewCruiser:
Sr.WriteLine("Support = 0");
SaveUser:
Sw.WriteLine("Support = " + C.IsSupporter);
SaveOffline
Sw.WriteLine("Support = " + IsSupporter);
public static byte IsSupporter(string Username)
{
StreamReader Sr = new StreamReader(Database + "\\" + Username + ".txt");
string line = null;
while ((line = Sr.ReadLine()) != null)
{
if (line.Substring(0, 6) == "Support")
{
string[] Msg = line.Split('=');
Sr.Close();
return byte.Parse(Msg[1].Trim());
}
}
Sr.Close();
return 0;
}
Any ideas?