04.10.2009, 13:48
Hello,
our race script works but only the second race (NRG Race) but the first one (Standart Race) is buggy. The Standart Race loads only the first checkpoint and if I pass it, then load it the second checkpoint of the NRG race? (I hope everyone can understand my problem on my terrible English... )
our race script works but only the second race (NRG Race) but the first one (Standart Race) is buggy. The Standart Race loads only the first checkpoint and if I pass it, then load it the second checkpoint of the NRG race? (I hope everyone can understand my problem on my terrible English... )
Код:
public OnPlayerEnterRaceCheckpoint(playerid) { if(RennenBegonnen == 1) { if(Racer[playerid] == 1) { DisablePlayerRaceCheckpoint(playerid); gPlayerPos[playerid]++; if(LastCP[playerid] == 1) { GivePlayerMoney(playerid, 10000); RaceOn = 0; LastCP[playerid] = 0; EndCD = 30; RaceEndT = SetTimer("RaceEndTimer", 1000, 0); if(Score2 > 0) { SetPlayerScore(playerid, GetPlayerScore(playerid) + Score[Score2-1]); Score2--;} } if(gPlayerPos[playerid] < sizeof (StandartCheckpoint)) { if(gPlayerPos[playerid] == sizeof (StandartCheckpoint) - 1) { SetPlayerRaceCheckpoint(playerid, 1, StandartCheckpoint[gPlayerPos[playerid]][0], StandartCheckpoint[gPlayerPos[playerid]][1], StandartCheckpoint[gPlayerPos[playerid]][2], 0, 0, 0, 12); LastCP[playerid] = 1; }else{ SetPlayerRaceCheckpoint(playerid, 0, StandartCheckpoint[gPlayerPos[playerid]][0], StandartCheckpoint[gPlayerPos[playerid]][1], StandartCheckpoint[gPlayerPos[playerid]][2], StandartCheckpoint[gPlayerPos[playerid] + 1][0], StandartCheckpoint[gPlayerPos[playerid] + 1][1], StandartCheckpoint[gPlayerPos[playerid] + 1][2], 12); RaceOn = 1; } } if(gPlayerPos[playerid] < sizeof (NRGCheckpoint)) { if(gPlayerPos[playerid] == sizeof (NRGCheckpoint) - 1) { SetPlayerRaceCheckpoint(playerid, 1, NRGCheckpoint[gPlayerPos[playerid]][0], NRGCheckpoint[gPlayerPos[playerid]][1], NRGCheckpoint[gPlayerPos[playerid]][2], 0, 0, 0, 12); LastCP[playerid] = 1; }else{ SetPlayerRaceCheckpoint(playerid, 0, NRGCheckpoint[gPlayerPos[playerid]][0], NRGCheckpoint[gPlayerPos[playerid]][1], NRGCheckpoint[gPlayerPos[playerid]][2], NRGCheckpoint[gPlayerPos[playerid] + 1][0], NRGCheckpoint[gPlayerPos[playerid] + 1][1], NRGCheckpoint[gPlayerPos[playerid] + 1][2], 12); RaceOn = 1; } } } } return 1; } public OnPlayerLeaveRaceCheckpoint(playerid) { if(RennenBegonnen == 1) { if(Racer[playerid] == 1) { DisablePlayerRaceCheckpoint(playerid); gPlayerPos[playerid]++; if(gPlayerPos[playerid] < sizeof (StandartCheckpoint)) { SetPlayerRaceCheckpoint(playerid, 0, StandartCheckpoint[gPlayerPos[playerid]][0], StandartCheckpoint[gPlayerPos[playerid]][1], StandartCheckpoint[gPlayerPos[playerid]][2], StandartCheckpoint[gPlayerPos[playerid] + 1][0], StandartCheckpoint[gPlayerPos[playerid] + 1][1], StandartCheckpoint[gPlayerPos[playerid] + 1][2], 12); RaceOn = 1; } if(gPlayerPos[playerid] < sizeof (NRGCheckpoint)) { SetPlayerRaceCheckpoint(playerid, 0, NRGCheckpoint[gPlayerPos[playerid]][0], NRGCheckpoint[gPlayerPos[playerid]][1], NRGCheckpoint[gPlayerPos[playerid]][2], NRGCheckpoint[gPlayerPos[playerid] + 1][0], NRGCheckpoint[gPlayerPos[playerid] + 1][1], NRGCheckpoint[gPlayerPos[playerid] + 1][2], 12); RaceOn = 1; } } } return 1; }