25.10.2008, 20:29
pawn Код:
//Top of the script
new racecheckpoint[MAX_PLAYERS];
pawn Код:
//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
pawn Код:
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;
}