The online racing simulator
I think I have a problem with IS_BTN
Hello everyone
In C#, I have this code to create a new button:

Insim.Send(new IS_BTN { Text = "Cash: €" + Conn.Cash, L = 53, T = 1, W = 18, H = 4, ClickID = 1, UCID = 255, BStyle = ButtonStyles.ISB_DARK });

but the button refuses to appear and I don't know why it doesn't ! O.o

Thanks Everyone
A wild guess, try setting ReqI to 1 as well.
Nope, even after setting ReqI = 1, it doesn't appear
This code works for me, without the Conn.Cash variable. Maybe it's a problem in there?

using System;
using InSimDotNet;
using InSimDotNet.Packets;

namespace FlameInSim
{
class Program
{
static void Main(string[] args)
{
InSim insim = new InSim();

try
{
insim.Initialize(new InSimSettings
{
Host = "XXX.XXX.XXX.XXX",
Port = 12345,
Admin = "XXX",
});
}
catch (InSimException ex)
{
Console.WriteLine("InSim error: {0}", ex.Message);
return;
}

insim.Send(new IS_BTN { Text = "Cash: €", L = 53, T = 1, W = 18, H = 4, ReqI = 1, ClickID = 1, UCID = 255, BStyle = ButtonStyles.ISB_DARK });

Console.ReadKey(true);
}
}
}

I tried to remove "Conn.Cash", but it didn't appear either !!
Is "ClickID" a unique number, not used elsewhere in the code or by other insims that you maybe run?
lol, it's the first button in the whole insim
so yes, it's not used
-
(MariusMM) DELETED by MariusMM : History
I tried to change the ClickID to a random number, as well as ReqI, but not working.

The problem is that there is no more code to show .. everything is working correctly and without any errors, but when I try to add a button in any place (I tried to put it when NCN, NPL, CON, MSO and few others are received) it doesn't work too!!
I want to say that there is something wrong in the library (which I downloaded from insimdotnet.codeplex.com) but i don't think so, since many users use it too .. so I really don't know what's wrong :|
Not random number, just close all other insim apps. Test it offline in singleplayer, so there are no buttons spawned from server-side.
Test with minimal example, like the one Flame posted.
I am not familiar with that libary but does insim.Send have a return value? Maybe check that for error.
Quote from zazcoisa1998 :I tried to change the ClickID to a random number, as well as ReqI, but not working.

The problem is that there is no more code to show .. everything is working correctly and without any errors, but when I try to add a button in any place (I tried to put it when NCN, NPL, CON, MSO and few others are received) it doesn't work too!!
I want to say that there is something wrong in the library (which I downloaded from insimdotnet.codeplex.com) but i don't think so, since many users use it too .. so I really don't know what's wrong :|

You have downloaded an old library from CodePlex. New library is developed in GitHub ( https://github.com/alexmcbride/insimdotnet )
Quote from Gutholz :Not random number, just close all other insim apps. Test it offline in singleplayer, so there are no buttons spawned from server-side.
Test with minimal example, like the one Flame posted.
I am not familiar with that libary but does insim.Send have a return value? Maybe check that for error.

I tried creating a local server and the button appeared, but it didn't appear online, I don't know why .. :|

Quote from geekas :
You have downloaded an old library from CodePlex. New library is developed in GitHub ( https://github.com/alexmcbride/insimdotnet )

I downloaded the library you gave me, thanks for that, but the library wasn't the problem, because when started the insim in local server the button worked (using the library I have and the one you sent).


So, it turns out that it works in local but not online, why??

Thank You
Quote from zazcoisa1998 :
I tried creating a local server and the button appeared, but it didn't appear online, I don't know why .. :|

That means that there's some server-side insim running that uses that ID.
Quote from viraaj5555 :
Quote from zazcoisa1998 :
I tried creating a local server and the button appeared, but it didn't appear online, I don't know why .. :|

That means that there's some server-side insim running that uses that ID.

When I created a local server, the buttons appeared, but when I created a server on master server it didn't.
And there was nothing running at the time I created that server.
When I created a local server, the buttons appeared only for the host (UCID = 0) and it didn't appear to other players in that server.
I also tried running an old insim which is using LFS_External and all the buttons appeared to all the players. To make sure that the problem wasn't from my insim, i created a new simple insim with only codes for connecting to the game and showing a button, nothing else, but it also appeared to the host not for all the players.

So i'm not sure, but i think there is a problem with the library itself .. :|
Do you have ISF_LOCAL set when connecting? With it set, it will only permit buttons to be sent locally (UCID=0).
oh yeah, it was there
i removed it and the buttons appeared
i actually don't remember when i added ISF_LOCAL to the flags

Thanks

FGED GREDG RDFGDR GSFDG