if ((MCI.Info[0].X >= -28705464) && (MCI.Info[0].Y >= 34620449)) ///this code verified the coordinates, good=send message : bad=no send { InSim.Send_MST_Message("/msg ^6You have found your daily lottery ticket!"); ///this code send "test^3 -4228125845" ///the number is the coordinate X. }
that works !
all what i need to do now is for the rectangle and ReVoX said that you need to configure it
Can someone explain what he is on about ?
LFS is a 3 dimensional world, but for what you want to do you can consider it to be 2 dimensional.
In order to reference any single point in a 2D world you need 2 points (coordinates), which are themselves typically defined as the X and Y, by their offset from a fixed position. i.e. the coordinates X = 1 and Y = 2 would mean that you're 1 unit by 2 units away from the origin (central point).
However, there are 2 problems with using a simple point for LFS - cars are not that small, and it would be tricky to be directly over a single point (since the coordinates from an MCI assume that a vehicle is also a single point), so you need to define a larger area, which is defined by the minimum of 2 sets of coordinates (unless you were making it a circular area, but lets not get into that).
What you're doing is seeing whether or not the vehicle is at or past your given point (-28705464, 34620449). What this means in practical terms is that you're simply going to end up with spamming the "You have found your daily lottery ticket!" message (in your example) on large tracks, once they've passed this point you've defined.
Basically what I'm trying to say, and give you as much information as possible, is that you're simply not doing what you think you're doing.
ye it kept spamming that mesage when i came up to a corner...
to give you somthing (maybe i should of told you) is that i want a rectangle so it doesnt have to take me ages to find those co-ordiante place to get my prize.
so rectangle and co-ordiantes. got the co-ordiantes but not the rectangle so i can go over and get my ticket
That's because it pseudo code, not copy and pasteable code. You'll need to rewrite it to suit the rest of your program. I know that and I'm even worse at programming that you!