The online racing simulator
#1 - sun
Co-oridinate's of a place. ( neally complete )
hello,

I have posted millions of posts in the past about somthing familier with this, but as faras i know, i'm beginning to understand it. As far as i know, this is what i know:

I Go in LFS, get the X, Y co-ordinates. (X, Y) for example we will be using,

X: 9746464

Y: 8446454.

Do you halve it by 1906?, i just dont know what to halve it bye? can anybody give me some unstructions or somthing or correct me?
edit: irrelevant.
#3 - sun
Ah... Thanks DarkTimes.
You could find it on InSim.txt on dedi server to:

open Dediserver/docs/InSim.txt

and read it

there you can find some interesting things to
#5 - sun
Ok. I have that neally done.

------------------------------------------------------------

Ok, i'm doing a little neat system, and i dont know how to make an auto message every 20 minutes?

i know:

System.Timers.Timer AutoMessage = new System.Timers.Timer(300000);

is that set for 30 minutes?

and if it is then how do i make a message say every (300000)?



void AutoMessage_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
{
InSim.send_MTC_MessageToConnection("test");
}
}

i tryed that and it doesnt work. Can anyone help? please?
Did you set the elapsed event?

AutoMessage.Enabled = true;
AutoMessage.Elapsed += new System.Timers.ElapsedEventHandler(AutoMessage_Elapsed);

Did you wait the 30 mins? (1,800,000 would be 30 mins btw, it goes in MS)
edit: irrelevant.
#8 - sun
Quote from DarkTimes :

Edit: Dougie beat me to it.

lol... Well Dougie has Quick thinking skills.
#9 - sun
Ok 2 problems here. Ok all my plan is to do is to make a quiz system. When a user types in the correct answer in my case the 1st question anser is 48. So i did this:

/*case "48":
if (Connections[GetConnIdx(MSO.UCID)].alreadyanswered == 0)
{
InSim.Send_MTC_MessageToConnection("^6Congradulations!", MSO.UCID, 0);
alreadyanswered = 1;
}
if (Connections[GetConnIdx(MSO.UCID)].alreadyanswered == 1)
{
InSim.Send_MTC_MessageToConnection("^1The current Question has already been answered.", MSO.UCID, 0);
}
break;
*/

(forgot the comment out i did that because i was doing somthing else)

Basically after the command is said, i put in:

alreadyanswered = 1;

That was supposed to make it 1, so it means that its been answered when the answer has been said. Then when i type in '48' again it shows 'congradulations' again.

Can anybodyhelp?

NOTE: i'm posting in my co-ordiante topic because i dont want to make other topics every 10 minutes.
Shouldn't it be:

case "48":
if (Connections[GetConnIdx(MSO.UCID)].alreadyanswered == 0)
{
InSim.Send_MTC_MessageToConnection("^6Congradulations!", MSO.UCID, 0);
Connections[GetConnIdx(MSO.UCID)].alreadyanswered = 1;
}
if (Connections[GetConnIdx(MSO.UCID)].alreadyanswered == 1)
{
InSim.Send_MTC_MessageToConnection("^1The current Question has already been answered.", MSO.UCID, 0);
}
break;

?
Small problem there too. It goes: if 0, congrats, set to 1. if 1, try again. That means if its 0, both will be executed. Slap in an else and you're good to go.
Quote from Stuff :Small problem there too. It goes: if 0, congrats, set to 1. if 1, try again. That means if its 0, both will be executed. Slap in an else and you're good to go.

Good point, never noticed that

case "48":
if (Connections[GetConnIdx(MSO.UCID)].alreadyanswered == 0)
{
InSim.Send_MTC_MessageToConnection("^6Congradulations!", MSO.UCID, 0);
Connections[GetConnIdx(MSO.UCID)].alreadyanswered = 1;
}
else if (Connections[GetConnIdx(MSO.UCID)].alreadyanswered == 1)
{
InSim.Send_MTC_MessageToConnection("^1The current Question has already been answered.", MSO.UCID, 0);
}
break;

Quote from sun :

void AutoMessage_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
{
InSim.send_MTC_MessageToConnection("test");
}
}

i tryed that and it doesnt work. Can anyone help? please?

It cant work! because you forget the UCID and PLID
Heres right code:


void AutoMessage_Elapsed(object sender,System.Timers.ElapsedEventArgs e)
{
foreach (clsConnection c in Connections)
{
InSim.send_MTC_MessageToConnection("Your Message", c.UniqueID, c.PlayerID);
}
}

Or Send to all Players:


void AutoMessage_Elapsed(object sender,System.Timers.ElapsedEventArgs e)
{
InSim.Send_MST_Message("/msg Your Message");

}

#14 - sun
ahhh... Thanks. I forgot about the 'else'.

Ok. I can type in 48 when the question hasnt even been asked. and get money. How would i enable the answer when the question has been said? would i have to declare a variable ?
#15 - sun
Hi!

My friend ( heiko ) told me that you need 4 co-ordiantes of a rectangle. ( 4 Corners ). I have them which are:

Top:

X: 23120658

Y: 44028316

-----------------

Bottom:

X: -23157776

Y: 43328664

-----------------

Left:

X: -23312779

Y: 43962067

-----------------

Right:

X: -22955669

Y: 43779036

--------------------------------------------------

how would i put those into the if ( statement )?
-
(Bose321) DELETED by the_angry_angel : Stop posting utter rubbish. If you intended to help you might have actually put something useful in the post.
-
(sun) DELETED by the_angry_angel
-
(Bose321) DELETED by the_angry_angel : Stop posting utter rubbish. If you intended to help you might have actually put something useful in the post.
#16 - sun
wait. I how do i put my full 6 digit co-ordiantes in here?

if (MCI.Info[i].X /
if (MCI.Info[index].X <= ... && MCI.Info[index].X >= ... && MCI.Info[index].Y <= ... && MCI.Info[index].Y >= ...)
{
// User is in the rectangle
}

Or, you could define a proper rectangle, but I find that the first way is easier I've not done that in a while, but it's going to be something like

System.Drawing.Rectangle rDefinedArea = new System.Drawing.Rectangle(x1, x2, y1, y2);
if (rDefinedArea.Contains(MCI.Info[index].X, MCI.Info[index].Y))
{
// User is in rectangle
}

I was thinking of some .NET function like that too dougie. But looking at his x,y points tells us it is a polygon and not a simple rectangle. In that case sun you'll have to do some reading! Yay!

http://letmegooglethatforyou.com/?q=point+in+polygon

Check out the 3rd one down, at the bottom of the page is a C/C++ function you should be able to convert
#19 - sun
Ok, i've done the 'Top' X/Y Co-ordiantes, and the 'Bottom' X / Y co-ordiantes. And now it makes a line top to bottom of my place. What do i need to do now?
This looks interesting. May i ask what its all for? Im guessing some kind of online GPS kind of thing so you know exactly where everyone is on the track.
#21 - sun
.....

:dnfnoob:

--------------------------

if you read the posts you may get an answer. I'm doing a job place for now someone said i could have it.
Quote from sun :.....

:dnfnoob:

--------------------------

if you read the posts you may get an answer. I'm doing a job place for now someone said i could have it.

Oh God the irony
#23 - sun
#24 - sun
Dougie, didnt you say that you didnt do it in a while? the System.Drawing method? because i think i understand.

System.Drawing.Rectangle rDefinedArea = new System.Drawing.Rectangle(x1, x2, y1, y2);
if (rDefinedArea.Contains(MCI.Info[index].X, MCI.Info[index].Y))
{
// User is in rectangle
}

so basically you did somthing similar to this?

rDefinedArea = MCI.Info[i].X >= 23120658

?

---------------------------------------------------------------------------------------------

Quote from Stuff :I was thinking of some .NET function like that too dougie. But looking at his x,y points tells us it is a polygon and not a simple rectangle. In that case sun you'll have to do some reading! Yay!

http://letmegooglethatforyou.com/?q=point+in+polygon

Check out the 3rd one down, at the bottom of the page is a C/C++ function you should be able to convert

I have done C++ before, but not making polygons or converting into another language.
Quote from sun :Dougie, didnt you say that you didnt do it in a while? the System.Drawing method? because i think i understand.

System.Drawing.Rectangle rDefinedArea = new System.Drawing.Rectangle(x1, x2, y1, y2);
if (rDefinedArea.Contains(MCI.Info[index].X, MCI.Info[index].Y))
{
// User is in rectangle
}

so basically you did somthing similar to this?

rDefinedArea = MCI.Info[i].X >= 23120658

?

According to this page, you need to define the height, width and top-left corner of your rectangle.

Or, for a polygon, I think a region would do the trick
1

FGED GREDG RDFGDR GSFDG