No, the error is that you output the button, before the player gets added to the array who contains the Unique ID for the joining player where the button will be send to.
Try this instead:
// A new client joined the server. private void NCN_ClientJoinsHost(Packets.IS_NCN NCN) {
AddToConnectionsList(NCN); // Update Connections[] list
InSim.Send_BTN_CreateButton("^7Welcome to this server!", Flags.ButtonStyles.ISB_LEFT | Flags.ButtonStyles.ISB_DARK | Flags.ButtonStyles.ISB_DARK, 6, 35, 20, 20, 50, NCN.UCID, 40, false);
As DarkTimes said: It's easier to test a program when you press F5. It won't be compiled, but saved in a 'debug map'.
If the program crashes, you'll get more information about the crash.
I think InSim systems are systems that make a server unique. Programmers try to create new / original stuff to make their servers attractive. If LFS would introduce this basic InSim problems, the servers who have this applications will become 'normal'.
An InSim app is just a simple app with a config file. It's an external program which connects to a server with an IP, port and Adminpass.
It's not a stupid idea, but I think you should hire (Read: pay) someone. Not just a regular programmer but someone who's used to work with all those InSim applications.
I'm not sure, but I think he means the site's codec. I searched around a bit and ended up here:
fwrite($fh,utf8_encode($configUpdated));
I have no experience using fwrite in PHP, so I don't know if this is the right way. I had problems with UTF-8 encoding in VB.net's write function with LFS' special characters.
We're planning to make a 'Noob server'; 1 lap Crash!
Well, as the InSim Program is made with a file to save all the data in, the bigger the file gets, the longer to load...
Good luck on your Ranking System!
P.S.: I think it's better to work with a MySQL database to save all the info:
- Much easier way of updating points
- Quicker (I think)
- Better way of backupping
(The 500servers admin accidentally overwrote one of our ranking files... Result: We ended up with a 1 week old file, so we gave everybody more points )
P.P.S.: Watch out with the PubStat Tarpit! You can only make 1 request every 4 seconds...
Well, DarkTimes (almost) gave you the code for it...
I'll show you in VB.net (not tested, it can be bugged) how to recieve a PB from LFSW in milliseconds with PubStat for a pre-defined racer.
' Place the piece of script where you want to create the button
using (WebResponse response = request.GetResponse()) using (StreamReader reader = new StreamReader(response.GetResponseStream())) {
' The streamreader reads every time 1 line from the file, so we'll need a loop
' Save the return info in a string, called line
string line;
' Loop trough all the lines of the file
while (line = reader.ReadLine()) != null) {
' E.g. I want to get my XFG Bl1 PB ' Which is, on the Pubstat like this: ' 240 XFG 45500 0 0 94230 2 1201295794 (Don't know for sure if it's this one) ' Now we'll modify the code: ' I should cut the code into an array
array results
results = String.split(line)
' If BL1 and XFG
If results(0) = 240 and results(1) = "XFG" then
' Save the total time in Miliseconds string pb pb = results(7) ' Exit the loop so it will take less time exit loop;
} }
Now you have the pb of the racer in milliseconds, you'll just need to edit the pb a bit to make it display in hours, minutes, seconds, hundreths...
And then make a button of out it, using the InSim.CreateButton thing
You can use the PubStat (watch out with the maximum of requests) to request the stats, and use StreamReader (or another http reader included in C#) to read the information...
I have no experience with C# nor with PubStat, I just know it's possible this way