The online racing simulator
Searching in All forums
(7 results)
Vego
S2 licensed
I have one more question This is possible to set with insim time which player must to wait on start line (layout)? Lfs set it automaticly but i want to have a control at it. I can make a normal timer, but lap time will start before player start
Last edited by Vego, .
Vego
S2 licensed
Thank you very much. I'm a beginner at c# and i didn't know that i must do that :/
Vego
S2 licensed
I have a next problem. I add the button, but i dont know where is a mistake. I think that everything is good.
CODE:
#region ' Packet receive events '
// Admin's message from textBox
private void button1_Click(object sender, System.EventArgs e)
{
textBox2.Text = "dupa"; //this is an example
}

Problem is in that the click on the button nothing make :/
Vego
S2 licensed
Quote from DarkTimes :I don't know much about LFS_External, but something like this should work. Bare in mind I've not tested this.
// A client left the server.
private void CNL_ClientLeavesHost(Packets.IS_CNL CNL)
{
// Get the connection which is leaving.
clsConnection conn = Connections[GetConnIdx(CNL.UCID)];
// Remove name from the ListBox.
listBox1.Items.Remove(conn.Username);

RemoveFromConnectionsList(CNL.UCID); // Update Connections[] list
}


Yeah. Thats a very good idea. I didn't think in this situation about this metod for checking a username of player which disconnected.
Thanks for everybody which want to help me
Vego
S2 licensed
Thanks for reply. I change textbox into listbox. Adding is very simple so i made it. But problem with deleting is in that the clientleaveserver have only cnl.ucid (uniqueID), it dont have UName or PName like ClientJoinHost
now my code look like this:
Into the joining:
listBox1.Items.Add(NCN.UName);

But i dont know how made deleting:
listBox1.Items.Remove(??);
Last edited by Vego, .
Listing Players in textBox (c#)
Vego
S2 licensed
Hello, at the begining i'm sorry for my bad english.
I'm making a small insim for me and my friend. I have a problem with listing players at server. I'm using lfs_external.
I can add player to list when he connecting, but i can't delete him when he left the server.
Here is a part of my code:
// A new client joined the server.
private void NCN_ClientJoinsHost(Packets.IS_NCN NCN)
{
AddToConnectionsList(NCN); // Update Connections[] list
//message from message.txt
List<string> list = new List<string>();
using (StreamReader reader = new StreamReader("message.txt"))
{
string line;
while ((line = reader.ReadLine()) != null)
{

InSim.Send_MTC_MessageToConnection(line, NCN.UCID, 0); // Show line

}
}
textBox2.Text += NCN.UName;

}




// A client left the server.
private void CNL_ClientLeavesHost(Packets.IS_CNL CNL)
{
RemoveFromConnectionsList(CNL.UCID); // Update Connections[] list


}



I don't know what to write in this case "// A client left the server." I'm trying a lot, but i'm a begginer at programing and i need help.

Kapsel (vego)
Vego
S2 licensed
I agree, but if we want to change shikanes we will must delete all pb's on this tracks, because it' slower.
FGED GREDG RDFGDR GSFDG