The online racing simulator
Something that APPAERS
Hello all programers, im sorry to be annoying, but i gotta ask something:

How to create a button that when i stop in a place appaer a BUTTON that should i have options etc.

Where do i put coordinates for appaer button and when i press button what to do?


(Example: BANK)
I googled APPAERS and it came up with 'did you mean APPEARS?'.

Assuming that's what you actually mean then you can either set a button to appear at a node or at a X,Y location.

Then you need to bind a sub-routine to the button so that when clicked, it takes you to sub-routine.

The first thing your sub-routine should do is close the first button, then it.....
Quote from impresora :...what to do?

...does something else.

See HERE if you want to see some of the things you can do with opening and closing buttons.
Yes in some place i type !info and appaer a BUTTON, where do i put X, and Y coordinates?
Quote from impresora :Yes in some place i type !info and appaer a BUTTON, where do i put X, and Y coordinates?

What exactly do you need the coordinates if you want to make something appear when typing something?

Look mate, here's a quick, very rough checklist you need to do. If you don't know how to do these things you need to get someone who does.

1) create a insim connection
2) bind the event of receiving a IS_MSO packet to a function that checks what has just been typed in chat.
3) Make a function that does whatever it is you want it to do.
4) ???
5) Profit!
Okey but in a place that i stop and appear TEXT or message. Only explainme that please
I suppose it all depends on what insim program you use.

I use LFSLapper.

For instance, part of my code is


<?php 
RegisterZoneAction
"SO1" 143,378SE_leavepits,SE_bluelights );
?>

When you leave the SO1 pits at x,y of 143,378, then sub-routine SE_leavepits and sub-routine, SE_bluelights both start. These sub-routines show on my HUD display at top of screen.

Instead of something happing automatically, I could have easily made a sub-routine to open a button, and clicking on this button then does something.

For instance, if you get stuck in a sandtrap somewhere, I could have a button open. Button could say something like "Click to reset car to back of pack". And if button clicked, it then starts a sub-routine that puts you in the pits.
Attached images
lfs exit pit lane.png
Quote from impresora :Okey but in a place that i stop and appear TEXT or message. Only explainme that please

Path nodes are in the NLP packet. Coordinates are in the MCI packet. Bind receiving either of them to a function that will compare the node or coordinates to a set location.

I'm not sure what the best way to figure out if you are stationary or not. Perhaps if the coordinates between two updates do not change you can be considered stopped.
Im using open SOURCE cruise insim sir.

If you cold help me please? :S
Help please?
I have been created a button that i added ISB_CLICK and in server we can click them, now how do i put an action in this button?
When you create a button via InSim, you can assign a ClickID to it. When a button created by InSim is clicked, LFS sends a IS_BTC packet that contains a ClickID of the button that's been clicked. You can use that to create actions for buttons.
Okey its working Now how i add !engage command to the BUTTON?

Copy all the command?

(COMMAND

case "!chase":
if (StrMsg.Length == 1)
{
if (Connections[GetConnIdx(MSO.UCID)].IsOfficerORCadet != 0)
{
if (Connections[GetConnIdx(MSO.UCID)].ChaseCondition == 0)
{
ChaseInitiated = 1;
ChaserUCID = MSO.UCID;
}


if (Connections[GetConnIdx(MSO.UCID)].ChaseCondition == 4)
{
Connections[GetConnIdx(MSO.UCID)].ChaseCondition = 5;
BumpCondition = 1;
BumpUCID = MSO.UCID;

}
if (Connections[GetConnIdx(MSO.UCID)].ChaseCondition == 3)
{
Connections[GetConnIdx(MSO.UCID)].ChaseCondition = 4;
BumpCondition = 1;
BumpUCID = MSO.UCID;

}
if (Connections[GetConnIdx(MSO.UCID)].ChaseCondition == 2)
{
Connections[GetConnIdx(MSO.UCID)].ChaseCondition = 3;
BumpCondition = 1;
BumpUCID = MSO.UCID;

}
if (Connections[GetConnIdx(MSO.UCID)].ChaseCondition == 1)
{
Connections[GetConnIdx(MSO.UCID)].ChaseCondition = 2;
BumpCondition = 1;
BumpUCID = MSO.UCID;

}


}
else
{
InSim.Send_MTC_MessageToConnection("^1Not Authorised", MSO.UCID, 0);
}
}
else
{
InSim.Send_MTC_MessageToConnection("^6|^7 Invalid command. Please see ^2!help^7 for a command list", MSO.UCID, 0);
}
break;

-
(MariusMM) DELETED by MariusMM : History
okey it is working man now i could put all of commands in buttons eheh

Now i have more one question, is about locations when i stop somewhere and a button appear. How do i make that? (LAST QUESTION :P)
repply? ***
Stop spamming the forum.
Im not spamming.
Quote from impresora :Okey but in a place that i stop and appear TEXT or message. Only explainme that please

Are you sure you're British?
Quote from azasmith14 :Are you sure you're British?

Something I've been wondering about too

@impersora: What you want to do is NOT that hard. Think, experiment, use your brain, that's how you'll learn to write InSim apps. We really can't just dump some code here for you. It most likely won't work without substantial modifications anyway and Dygear once said it well, read broken's sig for the words that should be written in stone and displayed in every "Programming help" forum section.
I only need that to finish my insim :'(
Seriously, how hard is something like
  1. Check car's positions
  2. If position matches, tell InSim to create a button
  3. Store the fact that you've created a button in your app
  4. Check car's positions again
  5. If the car leaves the "display" area tell InSim to remove the button
to figure out? We won't write it for you, we actually can't write it for you even if we wanted.

FGED GREDG RDFGDR GSFDG