SetPlayerRaceCheckpoint

From SA-MP Wiki

Jump to: navigation, search

SetPlayerRaceCheckpoint


Creates a race checkpoint. When the player enters it, the OnPlayerEnterRaceCheckpoint callback is called.


Parameters:
(playerid, type, Float:x, Float:y, Float:z, Float:nextx, Float:nexty, Float:nextz, Float:size)
playeridThe ID of the player to set the checkpoint for
typeType of checkpoint.0-Normal, 1-Finish, 2-Nothing(Only the checkpoint without anything on it), 3-Air normal, 4-Air finish
Float:xX-Coordinate
Float:yY-Coordinate
Float:zY-Coordinate
Float:nextxX-Coordinate of the next point, for the arrow facing direction
Float:nextyY-Coordinate of the next point, for the arrow facing direction
Float:nextzY-Coordinate of the next point, for the arrow facing direction
Float:sizeSize (diameter) of the checkpoint


This function does not return a specific value.


//from Yagu's race filterscript, (c) by Yagu
public SetRaceCheckpoint(playerid,target,next)
{
     if(next == -1 && Airrace == 0)
         SetPlayerRaceCheckpoint(playerid,1,RaceCheckpoints[target][0],RaceCheckpoints[target][1],RaceCheckpoints[target][2],
                         0.0,0.0,0.0,CPsize);
     else if(next == -1 && Airrace == 1)
         SetPlayerRaceCheckpoint(playerid,4,RaceCheckpoints[target][0],RaceCheckpoints[target][1],RaceCheckpoints[target][2],
                         0.0,0.0,0.0,CPsize);
     else if(Airrace == 1)
         SetPlayerRaceCheckpoint(playerid,3,RaceCheckpoints[target][0],RaceCheckpoints[target][1],RaceCheckpoints[target][2],
                         RaceCheckpoints[next][0],RaceCheckpoints[next][1],RaceCheckpoints[next][2],CPsize);
     else
         SetPlayerRaceCheckpoint(playerid,0,RaceCheckpoints[target][0],RaceCheckpoints[target][1],RaceCheckpoints[target][2],
                         RaceCheckpoints[next][0],RaceCheckpoints[next][1],RaceCheckpoints[next][2],CPsize);
}

Related Functions

The following functions might be useful as well, as they're related to this function in one way or another.


Related Callbacks

The following callbacks might be useful, as they're related to this function in one way or another.

Personal tools