02.07.2018, 13:19
You'll need to look at checkpoints and OnPlayerEnterCheckpoint, the others listed are also relevant.
https://sampwiki.blast.hk/wiki/OnPlayerEnterCheckpoint
OnPlayerLeaveCheckpoint: Called when a player leaves a checkpoint.
OnPlayerEnterRaceCheckpoint: Called when a player enters a race checkpoint.
OnPlayerLeaveRaceCheckpoint: Called when a player leaves a race checkpoint.
Obviously I don't know how your script looks but it'd be something like this:
https://sampwiki.blast.hk/wiki/OnPlayerEnterCheckpoint
OnPlayerLeaveCheckpoint: Called when a player leaves a checkpoint.
OnPlayerEnterRaceCheckpoint: Called when a player enters a race checkpoint.
OnPlayerLeaveRaceCheckpoint: Called when a player leaves a race checkpoint.
Obviously I don't know how your script looks but it'd be something like this:
pawn Код:
public OnPlayerEnterCheckpoint(playerid)
{
if(StartedRace[playerid] && RaceStep[playerid] == 6) // say 6 is the final step, idk
{
// Code here (SetPlayerScore etc..)
}
}