The online racing simulator
Finish race , Receive Money
Hello guys,

Im codding my own insim, and im trying to understand more the C++

I would like to do like this example:

You start a race with 1 lap, then you finish it (cross the finish line) and done 1 lap.

When you cross the finish line i would like to code a give money system.

Example:

// A player finishes race and crosses the finish line
private void FIN_PlayerFinishedRaces(Packets.IS_FIN FIN)
{
}

There i tried to add:

Connections[GetConnIdx(MSO.UCID)].Cash += 700;

But of course, MSO isnt Packets.IS_FIN FIN... I searched on google, and i read insim packets but i can't done that.

Please, help me.

Regards,

Nuno
IS_FIN provides the PLID (or Player ID). Whatever InSim library you're using should have the facility to get you the UCID (Connection ID) by looking up against the PLID.

If the library is sane at all, I'd imagine what you're looking for is GetPlyIdx, or GetPlyrIdx. But that's a guess.

FGED GREDG RDFGDR GSFDG