25.10.2008, 19:44
i will make a race
but how i can make good checkpoints
and yes i have 20 minutes searched
but how i can make good checkpoints
and yes i have 20 minutes searched
SetPlayerRaceCheckpoint(playerid, type, Float, Float:y, Float:z, Float:nextx, Float:nexty, Float:nextz, Floatize); playerid The ID of the player to set the checkpoint for type Kind of checkpoint.0-Normal, 1-Finish, 2-Nothing(Only the checkpoint without anything on it), 3-Air normal, 4-Air finish Float X-Coordinate Float:y Y-Coordinate Float:z Y-Coordinate Float:nextx X-Coordinate of the next point, for the arrow facing direction Float:nexty Y-Coordinate of the next point, for the arrow facing direction Float:nextz Y-Coordinate of the next point, for the arrow facing direction Floatize Size (diameter) of the checkpoint |
Creates a race checkpoint. When the player enters it, a OnPlayerEnterRaceCheckpoint callback is fired. |
//Top of the script
new racecheckpoint[MAX_PLAYERS];
//in the command
SetPlayerRaceCheckpoint(playerid, 0, Float:x, Float:y, Float:z, Float:nextx, Float:nexty, Float:nextz, 5.0);
racecheckpoint[playerid] = 1;
//START OF THE RACE
public OnPlayerEnterRaceCheckpoint(playerid)
{
DisablePlayerRaceCheckpoint(playerid);
if(racecheckpoint[playerid] == 1)
{
SetPlayerRaceCheckpoint(playerid, 0, Float:x, Float:y, Float:z, Float:nextx, Float:nexty, Float:nextz, 5.0);
racecheckpoint[playerid] = 2; // NEXT CP
}
else if(racecheckpoint[playerid] == 2)
{
SetPlayerRaceCheckpoint(playerid, 0, Float:x, Float:y, Float:z, Float:nextx, Float:nexty, Float:nextz, 5.0);
racecheckpoint[playerid] = 3; // NEXT CP
}
else if(racecheckpoint[playerid] == 3)
{
SetPlayerRaceCheckpoint(playerid, 0, Float:x, Float:y, Float:z, Float:nextx, Float:nexty, Float:nextz, 5.0);
racecheckpoint[playerid] = 4; // NEXT CP
}
else if(racecheckpoint[playerid] == 4)
{
SetPlayerRaceCheckpoint(playerid, 1, Float:x, Float:y, Float:z, 0.0, 0.0, 0.0, 5.0);
racecheckpoint[playerid] = 5; // NEXT CP, THIS IS THE FINISH LINE CHECKPOINT
}
else if(racecheckpoint[playerid] == 5)
{
//FINISH
racecheckpoint[playerid] = 0;
}
return 1;
}