[COLOR=SeaGreen] // A player joins the race. If PLID already exists, then player leaves pit.[/COLOR]
[COLOR=Blue]private void[/COLOR] NPL_PlayerJoinsRace(Packets.IS_NPL NPL)
{
[COLOR=Blue] bool[/COLOR] LeavesPits = AddToPlayersList(NPL); [COLOR=SeaGreen]// Update Players[] list[/COLOR]
[COLOR=Blue]if [/COLOR](NPL.PType.Equals(6))
{
InSim.Send_MST_Message([COLOR=DarkOrange]"/spec "[/COLOR] + NPL.PName);
InSim.Send_MTC_MessageToConnection([COLOR=DarkOrange]"^3#^1 It isnt allowed to add AI drivers"[/COLOR], NPL.UCID, NPL.PLID);
}
[COLOR=SeaGreen] // Your code here[/COLOR]
}
if (RES.ResultNum == 0)
{
InSim.Send_MST_Message("/msg " + RES.PName + " ^7won the race...");
Connections[GetConnIdx(Players[GetPlyIdx(RES.PLID)].UniqueID)].Points += 3;
}
// 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...");
}
}
}
//DFO = DistanceFromOfficer
int DFO = ((int)Math.Sqrt(Math.Pow(MCI.Info[i].X - ([COLOR=Red]X[/COLOR] * 196608), 2) + Math.Pow(MCI.Info[i].Y - ([COLOR=Red]Y[/COLOR] * 196608), 2)) / 65536);
//distance in meters
if (DFO <= 200)
{
foreach (clsPlayers ChaseIdx in Players)
{
Message(YouUsername+" is chasing "ChaseIdx.Username);
}
}
else
{
Message("No Playout found within 200meters");
}