The online racing simulator
Finished race position help
(5 posts, started )
// Qualify or confirmed finish
private void RES_RaceOrQualifyingResult(Packets.IS_RES RES)
{
if (RES.ResultNum == 0)
{
InSim.Send_MST_Message("/msg " + RES.UName + " ^7won the race...");
}
if (RES.ResultNum == 1)
{
InSim.Send_MST_Message("/msg " + RES.UName + " ^7 came in second...");
}
if (RES.ResultNum == 2)
{
InSim.Send_MST_Message("/msg " + RES.UName + " ^7came in third...");
}
}
}

thats it
-
(MariusMM) DELETED by MariusMM
#2 - filur
Quote from MariusMM :Any tips/tricks anyone?

I think you're confused with what "foreach" actually means/does. This is your code:

if the result number is zero
{
send a chat message

for each / with every connected client, do the following
{
increase points by 3
}
}

-
(MariusMM) DELETED by MariusMM
That's what should happen isn't it?

if the result number is zero

{
send a chat message

increase points of winner by 3
}

Actually I have no experience with programming in LFS but it should work like this (maybe after some adjusting):


if (RES.ResultNum == 0)
{
InSim.Send_MST_Message("/msg " + RES.PName + " ^7won the race...");
RES.Points += 3;
}
}


if (RES.ResultNum == 0)
{
InSim.Send_MST_Message("/msg " + RES.PName + " ^7won the race...");
Connections[GetConnIdx(Players[GetPlyIdx(RES.PLID)].UniqueID)].Points += 3;
}

-
(MariusMM) DELETED by MariusMM
No problem
its rly easy for me

Finished race position help
(5 posts, started )
FGED GREDG RDFGDR GSFDG