rendered paste body if(strcmp(cmd, "/joinrace", true) == 0) {
if (gRace == NO_CHECKPOINT)
{
new Float:x = gCheckpoints[gRace][0][0], Float:y = gCheckpoints[gRace][0][1], Float:z = gCheckpoints[gRace][0][2], Float:s = gCheckpoints[gRace][0][3];
for (new i = 0; i < MAX_PLAYERS; i++)
{
if (IsPlayerConnected(i))
{
gRacer[i] = 1;
gRacers++;
gCurCheck[i] = 0;
SetUpTrackInfo();
}
}
}
else
{
SendClientMessage(playerid, 0xFFFF00AA, "<> You need wait until races end! <>");
}
}
public StartRaces() {
if (gRacers > 1) {
gRace = random(MAX_RACES);
gRacers = 0;
gPosition = 0;
new Float:x = gCheckpoints[gRace][0][0], Float:y = gCheckpoints[gRace][0][1], Float:z = gCheckpoints[gRace][0][2], Float:s = gCheckpoints[gRace][0][3];
for (new i = 0; i < MAX_PLAYERS; i++)
{
if (IsPlayerConnected(i))
{
Teleport(i);
SetPlayerCheckpoint(i, x, y, z, s);
SendClientMessage(i, 0xFFFF00AA, "<> Race Started! <>");
}
}
} else {
SendClientMessage(playerid, 0xFFFF00AA, "<> You need wait until more players want race! <>");
}
}