The online racing simulator
InSim.Net 2 buttons i 1 command
(15 posts, started )
InSim.Net 2 buttons i 1 command
Heya

Iam trying to do a !rules comand witch it comes up a box with the rule LIST

I made the !rules command with the backround button but i need to add more buttons for the rule list and i cant get it working

Making it in : InsimDotNet , C#

Here`s my code

case "!rules":
{
insim.Send(new IS_BTN
{
ReqI = 255,
UCID = MSO.UCID,
ClickID = 3,
BStyle = ButtonStyles.ISB_DARK | ButtonStyles.ISB_CLICK,
T = 30,
L = 45,
W = 100,
H = 120,
Text = "",
});
break;
}

This code works fine but tried to add the 2nd button but failed ( frozen tried also)

Please help me with this guys !
--Regards Sture
Anyone?

var buttons = new List<IS_BTN> {
new IS_BTN { ReqI = 3, UCID = MSO.UCID, ClickID = 3, BStyle = ButtonStyles.ISB_DARK | ButtonStyles.ISB_CLICK, T = 30, L = 45, W = 100, H = 120, Text = "", },
new IS_BTN { ReqI = 4, UCID = MSO.UCID, ClickID = 4, BStyle = ButtonStyles.ISB_DARK | ButtonStyles.ISB_CLICK, T = 30, L = 45, W = 100, H = 120, Text = "", },
// Etc...
};

// Send list in one go.
insim.Send(buttons);

Thank you all sorted, Hmm, I need close button for it
Use IS_BTC to detect a button click and use IS_BFN to delete button(s).
hmm. Where do i add that ? , tried now a while is it in

Bstyle = , ?

Or where do i add that!?

CODE ATM
new IS_BTN
{
ReqI = 8,
UCID = MSO.UCID,
ClickID = 8,
BStyle = ButtonStyles.ISB_DARK | ButtonStyles.ISB_CLICK | ButtonStyles.ISB_LEFT,
T = 60,
L = 45,
W = 100,
H = 10,
Text = "^4N^1C^3**^3>>>>>>^7SHIFT+I - To Delete This^3<<<<<<<<<<<", },
// Etc...

};

new IS_BTN { ReqI = 3, UCID = MSO.UCID, ClickID = 3, BStyle = ButtonStyles.ISB_DARK | ButtonStyles.ISB_CLICK, T = 30, L = 45, W = 100, H = 120, Text = "", },

copy/paste this code for more buttons. But don't forget, to change ReqI, and ClickID.
And code for deleting buttons:

public static void DeleteButton(InSim insim, byte UCID, byte ClickID)
{
insim.Send(new IS_BFN
{
UCID = UCID,
ClickID = ClickID,
SubT = ButtonFunction.BFN_DEL_BTN,
});
}

Usage:

DeleteButton(insim, C.UCID, 8);

Where do i add the code, Below or on top? sorry i feel so stupid, Can you explain where to post the codes

here is all codes i have for my !rules that i want to add the close button tried alot myself

sorry but iam still beginner
Maybe you could add the code into this? or just give me instructions

Here is it also on pastebin.com : http://pastebin.com/8y4J9Vft


case "!rules"://Backround
{
insim.Send(new IS_BTN
{
ReqI = 255,
UCID = MSO.UCID,
ClickID = 1,
BStyle = ButtonStyles.ISB_DARK | ButtonStyles.ISB_CLICK,
T = 30,
L = 45,
W = 100,
H = 50,
Text = "",
});
var buttons = new List<IS_BTN> {
new IS_BTN
{
ReqI = 3,
UCID = MSO.UCID,
ClickID = 2,
BStyle = ButtonStyles.ISB_DARK | ButtonStyles.ISB_CLICK,
T = 30,
L = 45,
W = 100,
H = 10,
Text = "^4N^1C^7 Rule List", },
new IS_BTN
{
ReqI = 4,
UCID = MSO.UCID,
ClickID = 3,
BStyle = ButtonStyles.ISB_DARK | ButtonStyles.ISB_CLICK | ButtonStyles.ISB_LEFT,
T = 40,
L = 45,
W = 100,
H = 5,
Text = "^4N^1C^3**^7Ramming Is Not Allowed!", },
new IS_BTN
{
ReqI = 5,
UCID = MSO.UCID,
ClickID = 5,
BStyle = ButtonStyles.ISB_DARK | ButtonStyles.ISB_CLICK | ButtonStyles.ISB_LEFT,
T = 45,
L = 45,
W = 100,
H = 5,
Text = "^4N^1C^3**^7Respect Others Including Admins!", },
new IS_BTN
{
ReqI = 6,
UCID = MSO.UCID,
ClickID = 6,
BStyle = ButtonStyles.ISB_DARK | ButtonStyles.ISB_CLICK | ButtonStyles.ISB_LEFT,
T = 50,
L = 45,
W = 100,
H = 5,
Text = "^4N^1C^3**^7No Swearing Is Allowed!", },
new IS_BTN
{
ReqI = 7,
UCID = MSO.UCID,
ClickID = 7,
BStyle = ButtonStyles.ISB_DARK | ButtonStyles.ISB_CLICK | ButtonStyles.ISB_LEFT,
T = 55,
L = 45,
W = 100,
H = 5,
Text = "^4N^1C^3**^7No Racism!", },
new IS_BTN
{
ReqI = 8,
UCID = MSO.UCID,
ClickID = 8,
BStyle = ButtonStyles.ISB_DARK | ButtonStyles.ISB_CLICK | ButtonStyles.ISB_LEFT,
T = 60,
L = 45,
W = 100,
H = 5,
Text = "^4N^1C^3**^7No Namecalling!", },
new IS_BTN
{
ReqI = 9,
UCID = MSO.UCID,
ClickID = 9,
BStyle = ButtonStyles.ISB_DARK | ButtonStyles.ISB_CLICK | ButtonStyles.ISB_LEFT,
T = 65,
L = 45,
W = 100,
H = 5,
Text = "^4N^1C^3**^7No Insulting!", },
new IS_BTN
{
ReqI = 10,
UCID = MSO.UCID,
ClickID = 10,
BStyle = ButtonStyles.ISB_DARK | ButtonStyles.ISB_CLICK | ButtonStyles.ISB_LEFT,
T = 70,
L = 45,
W = 100,
H = 10,
Text = "^4N^1C^3**^3>>>>>>^7SHIFT+I - To Delete This^3<<<<<<<<<<<", },
// Etc...

};

// Send list in one go.
insim.Send(buttons);
break;
}

Geekas?

Or someone?
I think you set the delete code below the buttons code. Though intuition might get me in the wrong direction.

var delete = new List<IS_BFN>
{
new IS_BFN
{
UCID = C.UCID,
ClickID = 2,
SubT = ButtonFunction.BFN_DEL_BTN,
},
new IS_BFN
{
UCID = C.UCID,
ClickID = 3,
SubT = ButtonFunction.BFN_DEL_BTN,
},
new IS_BFN
{
UCID = C.UCID,
ClickID = 4,
SubT = ButtonFunction.BFN_DEL_BTN,
},
new IS_BFN
{
UCID = C.UCID,
ClickID = 5,
SubT = ButtonFunction.BFN_DEL_BTN,
},
new IS_BFN
{
UCID = C.UCID,
ClickID = 6,
SubT = ButtonFunction.BFN_DEL_BTN,
},
new IS_BFN
{
UCID = C.UCID,
ClickID = 7,
SubT = ButtonFunction.BFN_DEL_BTN,
},
new IS_BFN
{
UCID = C.UCID,
ClickID = 8,
SubT = ButtonFunction.BFN_DEL_BTN,
},
new IS_BFN
{
UCID = C.UCID,
ClickID = 9,
SubT = ButtonFunction.BFN_DEL_BTN,
},
new IS_BFN
{
UCID = C.UCID,
ClickID = 10,
SubT = ButtonFunction.BFN_DEL_BTN,
},
}
insim.Send(delete);

Where do i paste the code?

:hidesbehi



Sorry, a bit embarrassing but, Show me with my code //PASTE IT HERE

in the code or something, But aim very glad you guys responding and trying helping me out
It's hard to explain to beginner. Can you attach your cruise mod in this thread, or send to me via PM? I will put delete button code with code explainings.
PM sended!
ALL SORTED Thanks Geekas!

InSim.Net 2 buttons i 1 command
(15 posts, started )
FGED GREDG RDFGDR GSFDG