PDA

View Full Version : Can't add things for insim


stickylfs
25th January 2009, 19:04
Hi

FIRST: I donwloaded the example for insim, I add 1 thing and nothing...

When I edit the Form1 in solution, I add 1 thing and dont take any effect.

See:

// A new client joined the server.
private void NCN_ClientJoinsHost(Packets.IS_NCN NCN)
{
AddToConnectionsList(NCN); // Update Connections[] list

// Your code hereI edit it to:

// A new client joined the server.
private void NCN_ClientJoinsHost(Packets.IS_NCN NCN)
{
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);
AddToConnectionsList(NCN); // Update Connections[] list

// Your code hereAnd when I compile with F6 dont take any effect... :shrug:

Any help? :(

DarkTimes
26th January 2009, 06:07
Try pressing F5 instead.

Silox
26th January 2009, 16:50
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.

stickylfs
26th January 2009, 17:01
Thanks ! It works now :shy: