The online racing simulator
#1 - smcsc
what is the problem? Help me
Hi racers,

The code of the health don´t down of 100%, what is the problem ?


// When health < 1% we give Doctors bill
if (C.LastDistanceUpdate != C.TotalDistance)
{
if (C.PlayerName == "host")
{
}
else if (C.Health < 1)
{
InSim.Send_MST_Message("/msg " + C.PlayerName + "^7 paid €500 Doctors Clark!");
C.Health = 100;
C.Cash -= 500;
}
}

This code doesn't lower health at all, it only checks if Health is lower than 1. Are you lowering the health correctly elsewhere in the code and do you do that correctly?

BTW I suggest you modify the condition like this

if(C.Health < 1 && C.PlayerName != "host")

#3 - smcsc
I only have this code.. can you help me with this ?
You know what this code does, don't you? It only checks if health is lower than 1 and if it is, in reduced player's cash by 500 and resets his health back to 100. You need to lower player's health somewhere in the code (after a crash, when he/she doesn't eat, sleep, whatever) to make this work.
But we don´t know very much about code´s .
MadCatX i´m going send a mp to you
Please don't send me PMs, it's better for everyone if the discussion stays public. I can't help you much but because I don't have the code of your application. I'm sure you understand that players have to loose health somehow. Is your app based on some opensource Cruise mod?
-
(rubene300) DELETED by rubene300
i don´t understand very much about codes and insim´s.. can you add me on msn for i show you with printscreen´s the codes ? Thanks
You don't seem to understand how the internet works. When he helps you, he helps anyone else who has that problem. So when YOU ask a question, and someone answers it, it might answer the question for many other people as well. So why help one person via MSN, when he can help many people using these forums?
yep, you have reason
If i have questions, someone have too.
But of the problem, can you help us ?
hello again,

What is missing for when players pass by the radar speeding deduct the money directly.


case "!settrap":
if (StrMsg.Length == 2)
{
if (Connections[GetConnIdx(MSO.UCID)].IsOfficerORCadet == 1)
{
try
{
if (Convert.ToInt32(StrMsg[1]) > 0)
{
Connections[GetConnIdx(MSO.UCID)].TrapSpeed = Convert.ToInt32(StrMsg[1]);
TrapUCID = MSO.UCID;
TrapSet = 1;
}
else
{
InSim.Send_MTC_MessageToConnection("^1Trap Error. Speed cannot be 0", MSO.UCID, 0);
}
}
catch
{
InSim.Send_MTC_MessageToConnection("^1Trap Error", MSO.UCID, 0);
}
}
}
if (StrMsg.Length == 1 && TrapSet == 0)
{
if (Connections[GetConnIdx(MSO.UCID)].TrapSpeed > 0)
{
Connections[GetConnIdx(MSO.UCID)].TrapSpeed = 0;
Connections[GetConnIdx(MSO.UCID)].TrapX = 0;
Connections[GetConnIdx(MSO.UCID)].TrapY = 0;
InSim.Send_MTC_MessageToConnection("^6>^1 Trap Removed", MSO.UCID, 0);
}
else
{
InSim.Send_MTC_MessageToConnection("^6>^7 Trap not yet set", MSO.UCID, 0);
}
}
if (StrMsg.Length > 2)
{
InSim.Send_MTC_MessageToConnection("^6>^7 Invalid command. Please see ^2!help^7 for a command list", MSO.UCID, 0);
}
break;

We'd like to help you, but so far you haven't answered any question we asked.

- Is your app based on another opensource app? If it is, which one?
- Does your app do anything else with health? You just have to read your source to find out.
- Is your code for health checking really executed? You can make is send a message or something whenever it's processed to check that.
yes, I am doing the program in microsoft visual studio 2010, what I really wanted was for the counter of health to work with the players, for example starts at 100% and goes down to 99% and continuing up to zero is that I want.
the code is for a cruise insim.
Let's be straight and honest here - I think he only wants to get code & disappear, until he needs some again.

smcsc, this is not going to happen. Either put some effort in it yourself, or pay a programmer to do the job for you. Or find one to do it for free (if you think you're that lucky). The problem you're having is not that hard to solve - it just needs a little bit of thinking, a little bit of logic, and a little bit of knowledge of how the C# syntax works.

In case you prefer the "put some effort in it yourself" method:
As a start, I would suggest that you google "C# beginners guide" or something like that, and find the tutorial you find the easiest to learn from. OR - the way you've started is also not bad(experimenting, aka trial and error). It's more fun too, but you just need to practice a lot, and to accept that there are going to be more problems like this one, which you will most likely have to figure out yourself. And of course, the more experience you gain, the harder the problems will become.
by the looks of it that could be the LFS_External by dougie-lampkin or the LC's insim i'm unsure but

the health should be found within the MCI or under it's own timer called Health_Timer or something like that and within this code it just subtracts health if the player is in the race

Example code:


(foreach C In Connections)
{
if (C.InRace == 1 && Health >= 0)
{
C.Health -= 1;
}
}

i just typed that up quickly i hope it gives you an idea on how to subtract values now.

also about the !settrap that is only the command to set the trap up

you will find the code within the MCI Packet to then apply a fine for if they speed.

i hope this helps

EDIT: i just want to point out that if it is an LFS_External library you are using you will need to update it by yourself as the work to the library seems to have ceased so.. you will need to add the new packets and fix a few bugs within the library yourself as the library doesnt seem very stable.
Quote from broken :Let's be straight and honest here - I think he only wants to get code & disappear, until he needs some again.

smcsc, this is not going to happen. Either put some effort in it yourself, or pay a programmer to do the job for you. Or find one to do it for free (if you think you're that lucky). The problem you're having is not that hard to solve - it just needs a little bit of thinking, a little bit of logic, and a little bit of knowledge of how the C# syntax works.

In case you prefer the "put some effort in it yourself" method:
As a start, I would suggest that you google "C# beginners guide" or something like that, and find the tutorial you find the easiest to learn from. OR - the way you've started is also not bad(experimenting, aka trial and error). It's more fun too, but you just need to practice a lot, and to accept that there are going to be more problems like this one, which you will most likely have to figure out yourself. And of course, the more experience you gain, the harder the problems will become.

i wish i had read this before i posted now
Quote from broken :Let's be straight and honest here - I think he only wants to get code & disappear, until he needs some again.

smcsc, this is not going to happen. Either put some effort in it yourself, or pay a programmer to do the job for you. Or find one to do it for free (if you think you're that lucky). The problem you're having is not that hard to solve - it just needs a little bit of thinking, a little bit of logic, and a little bit of knowledge of how the C# syntax works.

In case you prefer the "put some effort in it yourself" method:
As a start, I would suggest that you google "C# beginners guide" or something like that, and find the tutorial you find the easiest to learn from. OR - the way you've started is also not bad(experimenting, aka trial and error). It's more fun too, but you just need to practice a lot, and to accept that there are going to be more problems like this one, which you will most likely have to figure out yourself. And of course, the more experience you gain, the harder the problems will become.

That is not true because if you help him, he help other people.
Dont say that because he is new on lfs, and dont speak very much on the forum, but he is a good guy. If someone need help he can try to help.
Broken has somewhat lower patience with people who mistake "asking for advice" for "wanting others to do the job for them" which is quite understandable attitude considering how many people seem to have problem differentiating these two things.
However, just the fact that I spend hours of my free time writing code instead of drinking beer doesn't entitle me to feel like a member of a master race, I'll give you few programming advices. They apply for all questions in all threads you've opened here.
  • Programming requires knowledge of a programming language. Just knowing how to do "if", "while" and "for" does not qualify.
  • Programming needs functioning brain. Programming is NOT something you can learn in 5 minutes of Googling
  • Programming requires understanding. Before you start writing anything, make sure you know WHAT you actually want to write. Before you start modifying something, make sure you know exactly how it works.
Quote from Greg Kroah-Hartman :
When you first start learning how to speak a language you don't start writing at right away, you READ a lot.

With these things in mind, either spend some time learning how to code or get yourself a programmer to do the work for you.
hello,

i know something about programmation but i need help with health, jobs and settrap.
I am willing to learn even if it takes a long time, MadCatX you help me? Even need help, I'm doing everything to learn. I'm still young so I still have much to learn.
Yes, maybe I don't have enough patience sometimes, but usually after I see many threads and the same person in them requesting help, I tend to lose a great portion of it. Sorry if I was too harsh to you, my conclusion was rather rashly, but try to see it from my POV - There are exactly 5 threads from 3 or 4 accounts with the same country flag, that seem to ask for help for the same insim app., and some of the threads are with almost identical requests. You have posted in all of these threads. And all that in a very short time. What would you think?

Even with that in mind, I still gave you pointers after all the off-topic, but everybody seemed to pick up only the negativity from my posts. Which is understandable though, I'd maybe react the same about it.

But anyway, next time I will just tend to keep away, instead of posting what I think, because this seems to be the best decision. After all, I don't want to stop people if they want to help, which, I'm sorry if I did.
(And I'm not enjoying it either when I'm posting such stuff, so why am I, lol?)

FGED GREDG RDFGDR GSFDG