The online racing simulator
Need help with InSim
Hello guys

I have this code and i want to know what is wrong ?
Can anyone help me ?

#region ' Tick '
if (kmh < 2)
{
if (Conn.AFKTick == 60 == false)
{
Conn.AFKTick += 1;
}
}
else
{
if (Conn.AFKTick > 0)
{
Conn.AFKTick = 0;
}
if (Conn.IsAFK == true)
{
Conn.IsAFK = false;
}
}
#endregion

#region ' Warn '
if (Conn.AFKTick == 60)
{
if (Conn.IsAFK == false)
{
MsgPly("^7> > Bank bonus is disabled whilst your ^1AFK", Conn.UniqueID);
Conn.IsAFK = true;
}
}
#endregion
}

#endregion

The code sample is a bit limited, I have no idea what the "Conn" object is, but I'm guessing it is the connection from one of the C# frameworks available.


if (Conn.AFKTick == 60 == false)

This is a weird way to write an "if not", and had me confused for a bit. If that is even the intention in the first place. It would be better written:


if (Conn.AFKTick != 60)

Let us know what you are trying to do with the code, and what actually happens, and it will help us locate what is wrong.
I am a beginner with this code.
Do you can give me all code?
Well I can't give you all the code because I don't even know what is wrong. Nothing comes for free, it takes effort to do things. You haven't even taken the time and effort to explain the problem yet you are asking for someone to do it for you.

As for being a beginner with programming, I was once a beginner too. It was hard. It was hard for a really long time. But I learned by doing, not by having others do for me.
I just asked for help here, because I can not manage in this region
But you haven't even asked for help. Does the code not compile? What doesn't work? What are you trying to do?
I want to put it idle if the player does not move for 60 seconds.
And then after I move that occur in all players is not longer idle.
Ok, do you see where it says:
if (Conn.IsAFK == true)
{
Conn.IsAFK = false;
}

Right above the Conn.IsAFK = false, start a new line and use:

MsgAll("^7> > " + Conn.PlayerName + " ^7is now ^1AFK");

Ok, so part 1 is done. Now lets go over to when people are done AFK'ing:
Do you see where it says the following:

if (Conn.IsAFK == false)
{
MsgPly("^7> > Bank bonus is disabled whilst your ^1AFK", Conn.UniqueID);
Conn.IsAFK = true;
}

Above the line that contains the MsgPly function, insert this:

MsgAll("^7> > " + Conn.PlayerName + " ^7is no longer ^1AFK");

Good Luck.
#9 - 196.
Kriss btw, No it was not me to your answer.. Also it has been happening to me thats why my server has not been on.
Quote from kristofferandersen :Ok, do you see where it says:
if (Conn.IsAFK == true)
{
Conn.IsAFK = false;
}

Right above the Conn.IsAFK = false, start a new line and use:

MsgAll("^7> > " + Conn.PlayerName + " ^7is now ^1AFK");

Ok, so part 1 is done. Now lets go over to when people are done AFK'ing:
Do you see where it says the following:

if (Conn.IsAFK == false)
{
MsgPly("^7> > Bank bonus is disabled whilst your ^1AFK", Conn.UniqueID);
Conn.IsAFK = true;
}

Above the line that contains the MsgPly function, insert this:

MsgAll("^7> > " + Conn.PlayerName + " ^7is no longer ^1AFK");

Good Luck.

Can u give me all code ? please
If I do that, you won't learn anything.
Have you even tried?
I will learn, but my problem is that I am a beginner with the insim and I do not know every code
And yes, I tried

Need help with InSim
(13 posts, started )
FGED GREDG RDFGDR GSFDG