The online racing simulator
How to delete buttons?
This post originaly was for traffic lights or signs. I choose to make signs and i found help.
I did button (traffic sign) thats apear in specific region (area/polygon) but how to delete the sign when im outside of region/polygon?
You can show external images in-game via InSIm. We are waiting for it too
Quote from xhector :I saw traffic lights in one Russian server that apear when im closing to crossroad or another road.

Was actually my server (Sin'rs), and I'm Scottish, not Russian!

Quote from xhector :I'm not C# coder so i request whole script for traffic lights or signs...

I made this as an add-on script for the popular LFSLapper ("lapper") InSim system, but unfortunately, I haven't had time to finish things off (I was also working on a drag race system that I was going to use on the long straight), but everything LFS related has had to come to a stop for now (no time).

Quote from xhector :The sign must apear at specific location... again this will be for cruise mod

The pop up traffic signs work by applying a timed sub-routine to start when a car enters a specifically defined "zone" (LFS x and y location), and just consist of text on overly large coloured full stops (.).

Full stops are one of the few UTF-8 symbols that I found can be used in LFS without any problems (like crashing the InSim).

In fact, if anyone's interested, the (quite) simple sub-routine for one of my traffic signs is as follows;

British Stop Sign (Red background with white lettering spelling STOP)


<?php 
Sub SE_StopSign
($userName)    
    
openPrivButton"sts_back",0,5,126,126,1,4,64,"^1•"); # red background
    
openPrivButton"sts_text",7,60,50,24,1,4,0,"^7STOP"); # white text 
EndSub 
?>


- the text after # marks are just comments.
- "sts_back" and "sts_text" are the unigue button identifiers
- numbers conform to usual LFS button placements and size (in the case of the 'circle' made by a full stop, its 126 x 126 , whereas the STOP text is only 24 high).
Interesting... ok i have now idea how to do traffic lights and some of the signs.
I think signs will be easy to made. But how can i made triangle sign
or the yield sign...
So what i need here for signs...
I think i need code for creating the signs
code for place the sign at specific position... and thats it i think

Im giving up from traffic lights ...
Look in chinese characters for triangle.
Quote from misiek08 :Look in chinese characters for triangle.

OmG thats right i can use some characters and make them bigger as buttons

P.S OMG realy i found characters in traditional chinese for triangle and yield!!!!

Now remaining... how to place the signs in place that i want Im not lazy to learnin C# BUT tihs is my first project for fun and will be the last for that reason i trying with help from others

EDIT 2!!!!::
I Found how to find coordinates:
http://denisbatya.narod.ru/ This tool helped me!
Only coordinates in that tool do not match but becouse i have to do math with numbers
(-230 * 196608), 2) + Math.Pow(Conn.CompCar.Y - (106 * 196608), 2)) / 65536)
coordinates for the point A is X-230 and Y106 but in map is different soo i have to do:
numbers from tool * 65536 and the result i have to divide by 19608 and the result is coordinates for cruise
Why is that?


EDIT3:::
I dont know why coordinates from map tools is different from lfs cruise BUT
The forum user: MadCatX is helped me AGAIN with this

-376 / 3 = -125
968 / 3 = 322
This simple calculation convert coordinates from map to/from lfs cruise
Here is my first traffic sign that apear in area that i want but i dont make code for the area i just used created one "KinderGarten"
And the button with this character not closing becouse i have to add delete button code interesting!
Attached images
untitled.PNG
That's a good idea those traffic signs Myself I thought I'd like to have something like that in cruise servers, where people would have to obey the signs and/or traffic lights other than having just classic intersections where barely anyone knows who gives way to whom (probably rule of right hand but still, main roads, yield/stop signs and traffic lights would be an awesome addition).
#9 - PoVo
Kyoto with a demo license? *cough cough*
Quote from PoVo :Kyoto with a demo license? *cough cough*

Screenshot is from LFS of my friend
I will help anyone who wants signs too. Only i have to do delete button stuff and place sign in place where i want after i make it work like normal i can help.
Again i have problem that i dont know how to slove.


[COLOR=#0000ff][B]if[/B][/COLOR] (Conn.CompCar.X / [COLOR=#00008b]196608[/COLOR] >= -[COLOR=#00008b]227[/COLOR] && Conn.CompCar.X / [COLOR=#00008b]196608[/COLOR] <= -[COLOR=#00008b]262[/COLOR] && Conn.CompCar.Y / [COLOR=#00008b]196608[/COLOR] >= [COLOR=#00008b]283[/COLOR] && Conn.CompCar.Y / [COLOR=#00008b]196608[/COLOR] <= [COLOR=#00008b]305[/COLOR] || Conn.CompCar.X / [COLOR=#00008b]196608[/COLOR] >= -[COLOR=#00008b]233[/COLOR] && Conn.CompCar.X / [COLOR=#00008b]196608[/COLOR] <= -[COLOR=#00008b]215[/COLOR] && Conn.CompCar.Y / [COLOR=#00008b]196608[/COLOR] >= [COLOR=#00008b]285[/COLOR] && Conn.CompCar.Y / [COLOR=#00008b]196608[/COLOR] <= [COLOR=#00008b]303[/COLOR])
{ InSim.[COLOR=#191970][B]Send_BTN_CreateButton[/B][/COLOR]([COLOR=#0000ff]"^H^1^JЃҐ"[/COLOR], Flags.ButtonStyles.ISB_C2, [COLOR=#00008b]100[/COLOR], [COLOR=#00008b]100[/COLOR], [COLOR=#00008b]5[/COLOR], [COLOR=#00008b]0[/COLOR], [COLOR=#00008b]50[/COLOR], Conn.UniqueID, [COLOR=#00008b]2[/COLOR], [COLOR=#008b8b][B]false[/B][/COLOR]);
InSim.[COLOR=#191970][B]Send_BTN_CreateButton[/B][/COLOR]([COLOR=#0000ff]"^H^7^JЃҐ"[/COLOR], Flags.ButtonStyles.ISB_C2, [COLOR=#00008b]70[/COLOR], [COLOR=#00008b]70[/COLOR], [COLOR=#00008b]19[/COLOR], [COLOR=#00008b]15[/COLOR], [COLOR=#00008b]51[/COLOR], Conn.UniqueID, [COLOR=#00008b]2[/COLOR], [COLOR=#008b8b][B]false[/B][/COLOR]);
}

I want button to be deleted when im not inside of coordinates....
I tried with "else" after that
InSim.Send_BFN_DeleteButton
BUT when i make another area to createbutton the secound button not apear ....


FGED GREDG RDFGDR GSFDG