Hey,
ich habe Yagus Race System bearbeitet und meinem Gamemode Angepasst.
Nun, wenn ich zum Endcheckpoint fahre, muss ich die selbe Strecke noch mal fahren, nur rückwärts.
Ich habe leider Keine Ahnung wieso
Weiß dementsprechend auch nicht, wo der Fehler liegt.
Hier mal mein
OnPlayerEnterRaceCheckpoint
public OnPlayerEnterRaceCheckpoint(playerid)
{
if(RaceParticipant[playerid]>=1) // See if the player is participating in a race, allows race builders to do their stuff in peace.
{
if(RaceParticipant[playerid] == 6) // Player reaches the checkered flag.
{
new name[MAX_PLAYER_NAME], RaceTime;
RaceTime=GetRaceTick(playerid);
GetPlayerName(playerid, name, MAX_PLAYER_NAME);
RaceParticipant[playerid]=0;
RaceSound(playerid,1139);
format(ystring,sizeof(ystring),"%s hat das Rennen beendet! (Pos %d)",name,Ranking);
if (Ranking < 4) SendClientMessageToAll(COLOR_GREEN,ystring);
else SendClientMessage(playerid,COLOR_GREEN,ystring);
if(Racemode == ORacemode && ORacelaps == Racelaps)
{
new RaceString[10], racerank;
if(racerank == 1)
{
RaceString=BeHuman(RaceTime);
racerank=CheckBestRace(playerid,RaceTime);
format(ystring,sizeof(ystring),"%s hat einen neuen Rekord aufgestellt %d! (%d)!", SpielerName(playerid),ystring, RaceString);
}
SendClientMessageToAll(Gelb, ystring);
}
if(Ranking<4)
{
GivePlayerMoney(playerid, 500);
}
Ranking++;
Participants--;
DisablePlayerRaceCheckpoint(playerid);
if(Participants == 0)
{
endrace();
}
}
else if (RaceStart == 0 && RaceParticipant[playerid]==1) // Player arrives to the start CP for 1st time
{
SendClientMessage(playerid,COLOR_YELLOW,">>> /Start um das Rennen zu starten! <<<");
RaceParticipant[playerid]=2;
}
else if (RaceStart==1) // Otherwise switch to the next race CP.
{
RaceSound(playerid,1138);
SetNextCheckpoint(playerid);
}
}
return 1;
}
public endrace()
{
SaveScores(); //If the race had already started, and mode & laps are as originally, save the lapscores and racescores.
for(new i=0;i<LCurrentCheckpoint;i++)
{
RaceCheckpoints[i][0]=0.0;
RaceCheckpoints[i][1]=0.0;
RaceCheckpoints[i][2]=0.0;
}
LCurrentCheckpoint=0;
for(new i=0;i<MAX_PLAYERS;i++)
{
LastLapTick[i]=0;
DisablePlayerRaceCheckpoint(i);
if(RaceParticipant[i]==3) //Player was still /ready-locked, unlocking.
{
TogglePlayerControllable(i,1);
if(PlayerVehicles[i] != 0)
{
PutPlayerInVehicle(i,PlayerVehicles[i],0);
PlayerVehicles[i]=0;
}
}
RaceParticipant[i]=0;
}
RaceActive=0;
RaceStart=0;
Participants=0;
SendClientMessageToAll(COLOR_YELLOW, "Das Rennen wurde beendet.");
}
Danke im vorraus