The online racing simulator
Searching in All forums
(59 results)
stuntguy3000
S2 licensed
Quote from mariuba2 :lol hahaha

@stuntguy in FileInfo make sure u have



static public void UpdateUserLeave(clsConnection C)
{
StreamWriter Sw = new StreamWriter(UserInfo + "\\" + C.Username + ".txt");
Sw.WriteLine("Cash = " + C.Cash);
Sw.WriteLine("BBal = " + C.BankBalance);
Sw.WriteLine("Cars = " + C.Cars);
Sw.WriteLine("Distance = " + C.TotalDistance);
Sw.WriteLine("Health = " + C.Health);
Sw.WriteLine("Toys = " + C.Toys);
Sw.WriteLine("Stat = " + C.Stat);
Sw.Flush();
Sw.Close();
}

etc. etc. wat ever u have idk cause i tried to make the toys thingy work but its hard to do for me

this is mine:
static public void UpdateUserLeave(string Username, long Cash, long BankBalance, string Cars, Int32 Distance, int Health, byte Stat, int ToyDogs, int ToyTrains, int ToyMonkeys)
{
StreamWriter Sw = new StreamWriter(UserInfo + "\\" + Username + ".txt");
Sw.WriteLine("Cash = " + Cash);
Sw.WriteLine("BBal = " + BankBalance);
Sw.WriteLine("Cars = " + Cars);
Sw.WriteLine("Distance = " + Distance);
Sw.WriteLine("Health = " + Health);
Sw.WriteLine("Stat = " + Stat);
Sw.WriteLine("ToyDogs = " + ToyDogs);
Sw.WriteLine("ToyTrains = " + ToyTrains);
Sw.WriteLine("ToyMonkeys = " + ToyMonkeys);
Sw.Flush();
Sw.Close();
}

stuntguy3000
S2 licensed
Quote from marcel1 :Right, your code is wrong.
with // you deactivate your code...
do you get any errors?

no
Insim WTF?????
stuntguy3000
S2 licensed
Hello, I am so confused wth is going of with my insim.

I USE LFS_External.

with the if (!InList) bit i added these:

NewConn.ToyDogs = FileInfo.GetUserT1(NCN.UName);
NewConn.ToyTrains = FileInfo.GetUserT2(NCN.UName);
NewConn.ToyMonkeys = FileInfo.GetUserT3(NCN.UName);

And now nothing works. When i // all them the insim starts working wtf???????
stuntguy3000
S2 licensed
I HAVE STARTED A NEW INSIM.
Its Still LFS_External. When i add the JobsCompleted Thing nothing works. no hud/commands work.

i need to
//NewConn.JobsCompleted = FileInfo.GetUserJBS_Completed(NCN.UName);

to get the insim to work? HELP!

static public int GetUserJBS_Completed(string Username)
{
StreamReader Sr = new StreamReader(UserInfo + "\\" + Username + ".txt");

string line = null;
while ((line = Sr.ReadLine()) != null)
{
if (line.Substring(0, 14) == "Jobs Completed")
{
string[] Msg = line.Split('=');
Sr.Close();
return int.Parse(Msg[1].Trim());
}
}
Sr.Close();
return 0;
}

stuntguy3000
S2 licensed
Quote from broken :Have you passed first grade yet? Can you make difference between the numbers?

Go ask your application if it sees Flowers in 6 letters. I think it sees Flower. Go and wonder why it doesn't want to find your Flowers then.

FAIL - that doesn't solve the problem for the other ones.

Toys
JobsCompleted
JobsAccepted
ToysSold
FlowersSold
stuntguy3000
S2 licensed
Quote from Dygear :And that's what this thread is about, but he can't / won't do CSS scripting.

i'm not interested. btw it doesn't even matter now!
stuntguy3000
S2 licensed
Quote from skywatcher122 :did u forget the NewConn to load those ints?

OMG Thanks so Much you ROCK!

lolage...
stuntguy3000
S2 licensed
Quote from amp88 :Good.



You're welcome.

Hang On.. LOL

It still won't retrieve the stats. Or how do i tell it to put the thing in the Connectionsfgbzdfgbfgb.Flowers Byte Thing?
stuntguy3000
S2 licensed
Ok. It works now - well i think.

How can i set the flowers in the user file to the C.Flowers Byte?????
Last edited by stuntguy3000, .
stuntguy3000
S2 licensed
Quote from amp88 :http://bytes.com/topic/c-sharp/answers/762995-string-equals

Thanks, I am pretty much a newbie with Insim/C# Coding so i can't really understand anything of the stuff in that link.

Do you think you could maybe provide an example plz.

Thanks!
Retrieving User Stats
stuntguy3000
S2 licensed
Hello,
On my Cruise Insim you can buy flowers and toys and sell them at houses.
That works and the selling also works. I want to make it that you can leave the server and re join and still have your flowers/toys. When you leave my server It Does save the flower/toy stats in the user.txt file but when you join it won't fetch that data.

static public int GetUserFlowers(string Username)
{
StreamReader Sr = new StreamReader(UserInfo + "\\" + Username + ".txt");

string line = null;
while ((line = Sr.ReadLine()) != null)
{
if (line.Substring(0, 6) == "Flowers")
{
string[] Msg = line.Split('=');
Sr.Close();
return int.Parse(Msg[1].Trim());
}
}
Sr.Close();
return 0;
}

Also this is my User File BTW

WORKS - Cash = 495031
WORKS - BBal = 1000
WORKS - Cars = UF1 XFG
WORKS - Distance = 1002441
WORKS - Health = 100
WORKS - Stat = 1
DOESN'T WORK - Flowers = 20
DOESN'T WORK - Toys = 0
DOESN'T WORK - JobsCompleted = 0
DOESN'T WORK - JobsAccepted = 0
DOESN'T WORK - FlowersSold = 0
DOESN'T WORK - ToysSold = 0

By DOESN'T WORK it saves it like i said but it won't read it and apply it to the users flowers etc on the server.

I am using LFS_External

Thanks
Last edited by stuntguy3000, .
stuntguy3000
S2 licensed
Quote from Dygear :You don't know how to do CSS, but you can do PHP?

And to answer the question yes, you can find it in the LFSWorldSDK.

yes i can do php and i will look at the sdk
stuntguy3000
S2 licensed
Quote from stuntguy3000 :THANKS SO MUCH!!!!! lol

2 Problems:

When i click the Button the text input does come up but it the text field in white is says Withdraw??????

And

When i click ok nothing happens (But it you enter text then hit ok the whole insim crashes)

HELP!
stuntguy3000
S2 licensed
Quote from skywatcher122 :Add this
InSim.Send_BTN_CreateButton("^7Deposit", "Enter amount to Deposit", Flags.ButtonStyles.ISB_LIGHT | Flags.ButtonStyles.ISB_CLICK, 5, 20, 50, 125, 204, 204, Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].UniqueID, 2, false);

Highlight means it will activate the BTT Packet

to BTT Packet


switch (BTT.ClickID)
{
case 204:
if (Connections[GetConnIdx(BTT.UCID)].InBank == 1)
{
int Withdraw = int.Parse(BTT.Text);
{
if (BTT.Text.Contains("-"))
{
InSim.Send_MTC_MessageToConnection("^1Error. Please don't use minus values!", BTT.UCID, 0);
}
else if (Connections[GetConnIdx(BTT.UCID)].BankBalance >= Withdraw)
{
Connections[GetConnIdx(BTT.UCID)].BankBalance -= Withdraw;
Connections[GetConnIdx(BTT.UCID)].Cash += Withdraw;
Connections[GetConnIdx(BTT.UCID)].Timer = 60;
InSim.Send_MTC_MessageToConnection("^7You have succesfully withdrawn ^6$" + Withdraw + " ^7from the bank.", BTT.UCID, 0);
InSim.Send_BTN_CreateButton("^7Your bank balance is ^6$" + Connections[GetConnIdx(BTT.UCID)].BankBalance, Flags.ButtonStyles.ISB_LEFT, 4, 40, 65, 54, 163, Connections[GetConnIdx(BTT.UCID)].UniqueID, 2, false);
}
else if (Connections[GetConnIdx(BTT.UCID)].BankBalance < Withdraw)
{
InSim.Send_MTC_MessageToConnection("^1You don't have enough cash to complete the transaction.", BTT.UCID, 0);
}
}
}
break;
}

rofl I made a code for u

THANKS SO MUCH!!!!! lol
stuntguy3000
S2 licensed
Quote from Victor :well Bunder gave you the link to all the information there is on the subject.

If you don't like the layout, you can change it with CSS. You can make a css file that suits your needs, then send it to me and I'll make it so that you can use that css file when you load the host status.

Or you can gather the host information yourself via pubstats and then you can show it in any way you like.

Since i have NO idea how to code CSS & Don't know how to do the pubstats (is their a link?) it is possible to fetch the data in PHP?
stuntguy3000
S2 licensed
Quote from skywatcher122 :MCI Updates + InSim.Button

I don't understand that...

I will Provide the button code

InSim.Send_BTN_CreateButton("^7Deposit", Flags.ButtonStyles.ISB_LIGHT | Flags.ButtonStyles.ISB_CLICK, 5, 20, 50, 125, 204, Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].UniqueID, 2, false);

Text Popup Help
stuntguy3000
S2 licensed
Hello, I was wondering if Anyone could Help me with this!

How in the World can i make a button in the bank when you click on it a popup says "Enter Amount to Insert" etc.

I am using LFS_External!
stuntguy3000
S2 licensed
Ok... Would it be Simpler to just re-format the data?

EDIT: I have sent Victor a PM so i will tell you how it goes!
Last edited by stuntguy3000, .
stuntguy3000
S2 licensed
Quote from Bose321 :What I do is show this URL in php on my site:

http://www.lfsworld.net/hoststatus/?h=[iD]+iDrift+Practise

?h=servername+here
Behind ?h= goes your server name, use a '+' for a space in your name.

I know how to do that but how would i show it like the way http://www.livetocruise.net/ shows it?
Display Server Status on a Website?
stuntguy3000
S2 licensed
Hello, I am wondering How can i get my servers Status on my teams Website.

I can do it but i want to customize it all Like This:

Server Name:
License: (Demo,S1,S2)
Track:
Connections: 5/32 etc.
Player1
Player2
Player3
Player4
Player5
etc. again

Could anyone help me - ALSO if it possible to Link the Players Name under the connections to their LFSW Profile?

And is it possible to have the text in white and back black?

I KNOW THIS IS ALL POSSIBLE BUT I HAVEN'T GOT A CLUE HOW TO DO IT!!!!!

Thanks,
[STUNT]stuntguy
stuntguy3000
S2 licensed
yes it is for me - its well. dead for me
stuntguy3000
S2 licensed
Quote from MariusMM :Well just something really really quick to show you the basics;

Add this to your MSO handler:

case "!test":
try
{
InSim.Send_BTN_CreateButton("^3Click here to open the chatbox thingy ^8", "Type whatever you want", Flags.ButtonStyles.ISB_LIGHT | Flags.ButtonStyles.ISB_CLICK, 4, 30, 144, 4, 120, 120, MSO.UCID, 40, false);
}
catch
{
InSim.Send_MTC_MessageToConnection("^1Error.", MSO.UCID, 0);
}
break;

And this to your BTT handler:


if (BTT.ClickID == 120)
{
InSim.Send_MTC_MessageToConnection("" + BTT.Text, Connections[GetConnIdx(BTT.UCID)].UniqueID, 0);
}

When that is done, fire up the application, type !test in game, click the button that opens and type something, click OK and something magical will happen resent:

Thx alot
stuntguy3000
S2 licensed
Still Confused. Would it be possible for someone to post the code for it?
Last edited by stuntguy3000, .
!speedtrap code request
stuntguy3000
S2 licensed
Hello everone. I would really like it if someone could post the source code for the command !settrap.

I am using LFS_External as a base.
stuntguy3000
S2 licensed
Quote from Dygear :Send a IS_BTN packet with the member `TypeIn` set to the max length of the string you wish to receive. The max len you can set TypeIn to is 96, the smallest value (That would make sense) is 1. The value of the IS_BTN packet will be sent back in the IS_BTT's `Text` member.

Sorry but that doesn't help me at all (i am confused heaps)
FGED GREDG RDFGDR GSFDG