07.07.2016, 06:24
Hmm, easiest way to check where is problem is to debug a
you can do it like this:
and try using 158 to CP number, cuz it counts maybe from -1...
PHP код:
Player_CheckPoint[playerid]
PHP код:
public OnPlayerEnterRaceCheckpoint(playerid)
{
new str2[64];
format(str2, sizeof(str2), "Checkpoint number: %d", Player_CheckPoint[playerid]);
SendClientMessage(-1, str2);
if(IsRaceRunning == true) { Player_CheckPoint[playerid]++; }
if(Player_CheckPoint[playerid] < 9 && IsRaceRunning == true)
{
DisablePlayerRaceCheckpoint(playerid);
SetPlayerRaceCheckpoint(playerid,0,CheckPoints[Player_CheckPoint[playerid]][0],CheckPoints[Player_CheckPoint[playerid]][1],CheckPoints[Player_CheckPoint[playerid]][2],CheckPoints[Player_CheckPoint[playerid]+1][0],CheckPoints[Player_CheckPoint[playerid]+1][1],CheckPoints[Player_CheckPoint[playerid]+1][2],9.7);
return 1;
}
if(Player_CheckPoint[playerid] == 9 && IsRaceRunning == true)
{
DisablePlayerRaceCheckpoint(playerid);
SetPlayerRaceCheckpoint(playerid,0,CheckPoints[Player_CheckPoint[playerid]][0],CheckPoints[Player_CheckPoint[playerid]][1],CheckPoints[Player_CheckPoint[playerid]][2],CheckPoints[Player_CheckPoint[playerid]+1][0],CheckPoints[Player_CheckPoint[playerid]+1][1],CheckPoints[Player_CheckPoint[playerid]+1][2],9.7);
return 1;
}
if(Player_CheckPoint[playerid] == 10 && IsRaceRunning == true)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
DisablePlayerRaceCheckpoint(i);
}
GetPlayerName(playerid,WinnerName,sizeof(WinnerName));
format(stringwin,sizeof(stringwin),"[RACE] The race is over, %s has won and achieved $%d!",WinnerName,winner_money);
SendClientMessageToAll(0xFF0000FF,stringwin);
GivePlayerMoney(playerid,winner_money);
IsRaceRunning = false;
return 1;
}
return 1;
}