The online racing simulator
Searching in All forums
(474 results)
coding the x, y co-ordiantes (problem)
sun
S2 licensed
Hi people,

I have a slite problem with the x, y co-ordiantes of my lotto ticket place, what i'am making, and it is that when i build the square. When i go in the middle it shows the message i want it to show. Right i'all get to the point... first of all i created the x, y co-ordiante code for the lotto ticket place

if ((MCI.Info[0].X / 196608 >= 46176313) && (MCI.Info[0].Y / 196608 >= 15915129))

above that i have

if (MCI.Info[0].X = 3) & (MCI.Info[0].Y = 3);



and its saying that i have n error with the MCI method i used.

Errors:

Error 1 Cannot implicitly convert type 'int' to 'bool' C:\Documents and Settings\Owen\Desktop\Cruise Tutorial\LFS_External_Client\LFS_External_Client\Form1.cs 557 17 LFS_External_Client
Error 2 Only assignment, call, increment, decrement, and new object expressions can be used as a statement C:\Documents and Settings\Owen\Desktop\Cruise Tutorial\LFS_External_Client\LFS_External_Client\Form1.cs 557 36 LFS_External_Client
Error 3 Pointers and fixed size buffers may only be used in an unsafe context C:\Documents and Settings\Owen\Desktop\Cruise Tutorial\LFS_External_Client\LFS_External_Client\Form1.cs 557 36 LFS_External_Client
Error 4 Cannot take the address of the given expression C:\Documents and Settings\Owen\Desktop\Cruise Tutorial\LFS_External_Client\LFS_External_Client\Form1.cs 557 36 LFS_External_Client

Big error really, but i'am trying to figure it out for my self. Just thought if you guys could point me in the right direction of what i've done wrong

Thanks...

Regards

Owen.
sun
S2 licensed
I'am talking about how to get the speed in MPH...
sun
S2 licensed
Thanks, Rovex. I think that code you gave me might not work because it the code ppl have sent me so far do not work... but is it supposed to do this ???

yourdriving at 5 mph Speed 5

your driving at 50 mph Speed 50



Is that what it is supposed to do ?
sun
S2 licensed
ok give me a message when you found out about MPH.
sun
S2 licensed
oh you call that right ? Speed 1548.9936 ?????

i only put in MCI.Info[0].Speed * 0.44704);


can you send me the code ?
sun
S2 licensed
Originally Posted by Dygear
32768 = 100 m/s.
1 MPH = 0.44704 m/s.

This will return a float, so do cast to int. (Unless you want some cool looking buttons.)



That dougie-lampkin ?

32768 = 100 m/s.
1 MPH = 0.44704 m/s.
MCI.Info[0].Speed * 0.44704);
sun
S2 licensed
oh lol

oh wait i found it... 3 is 6 , and 0 is 3
sun
S2 licensed
errr yes i have read the code

just dont know how to convert it into MPH. i've tried all sorts and calculations, but still i might not have learned this kind of maths...

if you like say the calculation, i might be able to do it mentally or use some working out for my self, not you working it all out for me
sun
S2 licensed
Well of course i know what 0 x 0 is... its just that when i type in MCI.Info[0].Speed * 0); it spams Speed 3.

.....Can any one help ?
sun
S2 licensed
hi,

i have MCI.Info[0].Speed * 0);.

One problem in that though... it only spams a message saying 3 when i'am stood still. Can any body give me the caluculation to convert LFS units to MPH ? That would be grateful.

Thanks!

Regards

Owen.

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

The LFS youngest Programmer

------------------
sun
S2 licensed
ok, sorry sorry. thats all i wanted to no where it is
sun
S2 licensed
ok.

what are the Car Prices for the cruise tutorial ? it only gets a Dealer price ... how much are they ? please post here with the car prices

Regards

Owen.
sun
S2 licensed
Quote from Dygear :32768 = 100 m/s.
1 MPH = 0.44704 m/s.

This will return a float, so do cast to int. (Unless you want some cool looking buttons.)

are you talking to me here ? ok that code will convert the LFS units to MPH ? i think...
sun
S2 licensed
ok but how would i convert the LFS unit speed into MPH ? atm when you go like 3 mph it shows you 300 or 257 in lfs units
sun
S2 licensed
oh yer 1 question...

what is

privatevoid MCI(Packets.IS_MCI MCI)
{
for (int i = 0; i < Players.Count; i++)
{
decimal Speed = (decimal)((MCI.Info[i].Speed * (100f / 32768f)) * 3.6f);
decimal ConvSpeed = (decimal)(Speed * 25 / 1000);
Players[GetPlyIdx(MCI.Info[i].PLID)].Payout += ConvSpeed;
}

used for ? it doesnt work and doesnt show the speed. I guess you have to do some coding for your self write ?
sun
S2 licensed
ol, i've not done any clickable buttons either... i can do them but cba Razz
sun
S2 licensed
Right i'am going to say this ONCE AND ONLY! dont go off topic

right i come home frm school and i loaded C# opened XNA i thought i'd make a game, and somthing americal happend. All this code came coming to me, and when i tryed my first game it Worked !

I was so amazed.
sun
S2 licensed
Quote from dawesdust_12 :I'm happy that most of my classes are computer classes, where I have freedom to do this sort of stuff

LMAO! usully when the teacher isnt looking i do some code
sun
S2 licensed
i have answers.

Yes i will follow what you tell me.
I will learn.
i'am going to read that C# book at school and i dont care what the teacher says (done it before).

And The_angry_angel

he's helped me alot over the pass couple of days. But i got to say a very great thanks to dougie-lampkin. He has helped me RIGHT from the beggining of 'How do i make an InSim'.

Thanks guys for your help.
sun
S2 licensed
ok.

its fun the problem solving but my insim app keeps timing out and thats NOT FUN !

infact its p****** me off because its been doing it for months. I have a great clue that it might be i have a prblem in the code in the NCN packets.

does any one know ?
sun
S2 licensed
Ok. but can you send me the link to get started to make this game ?
sun
S2 licensed
Quote from Woz :
Did you ever step back as people told you to and read through your C# book from COVER to COVER?

yes.... actually i did read through my book.
sun
S2 licensed
dude i'am not giving it up. This is my dream. making my own insim app...
sun
S2 licensed
ok. now i'am on the part of earning money while cruising ... x,y coordinates right ?
sun
S2 licensed
where can i find the documention ?
FGED GREDG RDFGDR GSFDG