The online racing simulator
Quote from Silox :Is it possible to change the Request ID and the Click ID to a short?

Nope - this is a limitation in InSim, not LFS_External. My only suggestion would be to select the player and then present the kick/ban/close buttons for that user only.

Quote from Silox :2. Is it possible to clear all the buttons on the screen with one command?

Yes - although I don't know the LFS_External API I can tell you that you need to send an IS_BFN, with sub type (SubT) of BFN_CLEAR, which will clear all buttons made by that insim instance.
Quote from the_angry_angel :Nope - this is a limitation in InSim, not LFS_External. My only suggestion would be to select the player and then present the kick/ban/close buttons for that user only.

Thanks for your quick reaction I'll try to find a method for this the next days...

Quote from the_angry_angel :Yes - although I don't know the LFS_External API I can tell you that you need to send an IS_BFN, with sub type (SubT) of BFN_CLEAR, which will clear all buttons made by that insim instance.

Well, the problem here is when I try to clear the buttons like you've said with the LFS_External API with this code:
InSim.Send_BFN_DeleteButton(Enums.BtnFunc.BFN_CLEAR)

It asks for a RequestId and a UniqueID, and there's no way around to only put the BFN_CLEAR as SubT...
Just set them to NULL or 0, would be my suggestion
Quote from the_angry_angel :Just set them to NULL or 0, would be my suggestion

That's what I tought too but:
Null is not longer used, use System.DBNull instead.
So I use System.DBNull but:
System.DBNull is a type in system and cannot be be used as an expression

Any ideas?

What I could do too is make the same loop as the loop that creates the buttons so it deletes the buttons button by button, but I think that that's too slow...

EDIT:
When I set the Req ID's to 0, InSim gave an Invalid Button ID error.
I have the feeling there maybe a more suitable function to use in LFS_External (Send_BFN_DeleteButton seems to apply very specifically to an IS_BFN with SubT of BFN_DEL_BTN), but I'm afraid that you'll have to wait until someone familiar with it comes along or consult the manual for LFS_External.

My guess would be that you're after something like Send_BFN_Clear.. As I say, I don't use LFS_External so I honestly wouldn't know.
I haven't seen anything to delete all the buttons, but I've never had the need to delete them all either. What I do when deleting multiple buttons is to use a for loop. EG:

for (byte ClickID = 0; ClickID <= 255; ClickID++)
{
InSim.Send_BFN_DeleteButton(0, ClickID, 255);
}

If you only need to delete them from one screen, replace 255 with the appropriate UCID.

Hope that helps a bit...
This will do the job:
InSim.Send_BFN_DeleteButton(Enums.BtnFunc.BFN_CLEAR, 0, UCID);
Quote from T-RonX :This will do the job:
InSim.Send_BFN_DeleteButton(Enums.BtnFunc.BFN_CLEAR, 0, UCID);

Thank you!
I think the most of my problems are solved now but you never know...
Hi, i' trying to make Buttons (equal !stats command).

I`ve add it in code:

byte ButtonID1 = 10; (already exist)
byte ButtonIDA = 11;
byte ButtonIDB = 12;
byte ButtonIDC = 13;

And it:

InSim.Send_BTN_CreateButton("^7text", Flags.ButtonStyles.ISB_LEFT, 5, 31, LocationX, 15, ButtonID1, MSO.UCID, 40, false);
InSim.Send_BTN_CreateButton(
"^6text", Flags.ButtonStyles.ISB_LEFT, 5, 31, LocationY, 15, ButtonIDA, MSO.UCID, 40, false);
InSim.Send_BTN_CreateButton(
"^7text", Flags.ButtonStyles.ISB_LEFT, 5, 31, LocationA, 15, ButtonIDB, MSO.UCID, 40, false);
InSim.Send_BTN_CreateButton(
"^6text", Flags.ButtonStyles.ISB_LEFT, 5, 31, LocationB, 15, ButtonIDC, MSO.UCID, 40, false);


But, when i click in close button, only ButtonID1 close. Buttons A, B and C continue in display. Someone helps me ?

Quote from T-RonX :This will do the job:
InSim.Send_BFN_DeleteButton(Enums.BtnFunc.BFN_CLEAR, 0, UCID);

This is the code to close all buttons...
Works now...

Thanks guy!
How i' create a login system?

How it works:

- Client connect
- Client: !login 'password'*
- Insim: Get the username (key) and 'password'
- Insim: Validade and log in the user
- Client: Acess the account and play

*Registered in .txt of user (pass = "")


I'm trying, but it don't works
Someone help me, please
I think you should check out the source of the opensource Cruise, I can help you with some things, not with all but I'll got to work now... I'll post later on some tips...
No. I want create a login system to protect user accounts.
Quote from SkinCast :No. I want create a login system to protect user accounts.

Why bother? LFS now requires all demo user names to be registered so there's no chance anyone will now ever have the same username (lfsworldname) so just use this to authenticate users.
i' using version Y to play in LAN mode (Local Host). When someone changes the Key with keygen or realkey, its possible to hack other account.
I update LFS External to version 1.1.1.2. I added the missing send methods for TINY and SMALL packets.

You can update by replacing the dll file and reloading your project.
Quote from T-RonX :I update LFS External to version 1.1.1.2. I added the missing send methods for TINY and SMALL packets.

You can update by replacing the dll file and reloading your project.

Nice one
Hi all

I have mistmatches between NLP.Info(i).PLID and Players(i).PlayerID created with the NPL event. I test with 20 ai and only 3 have mistmatches.

Any idea ?

Thanks


Edit : in fact i have one player in NLP.info which is not present in Players class. Dunno why.
Its solve "9 players > Cruise Mod close" ? (New dll)
Anyone know how I can create a button in the MCI packet, because I just get's error when using MCI.Info[0] instead of f.ex NCN.UCID?
Quote from LeifOlav :Anyone know how I can create a button in the MCI packet, because I just get's error when using MCI.Info[0] instead of f.ex NCN.UCID?

InSim.Send_BTN_CreateButton("text", Flags.ButtonStyles.ISB_CLICK Or Flags.ButtonStyles.ISB_DARK, x , x , x , x , x, MCI.UCID, x, True)

?

Replace x with the other options; Height, width, top, left, cliqueID, ...
MCI only contains PLID, so you need to "convert" it to UCID by scanning the connections list for it. Replace MCI.Info[0] with:

Players[GetPlyIdx(MCI.Info[0].PLID)].UniqueID

And that will show the UCID of that PLID

FGED GREDG RDFGDR GSFDG