Help with a racing checkpoint! :'(
#2

Hmm, easiest way to check where is problem is to debug a
PHP код:
Player_CheckPoint[playerid
you can do it like this:
PHP код:
public OnPlayerEnterRaceCheckpoint(playerid
{
        new 
str2[64];
        
format(str2sizeof(str2), "Checkpoint number: %d"Player_CheckPoint[playerid]);
        
SendClientMessage(-1str2);
        if(
IsRaceRunning == true) { Player_CheckPoint[playerid]++; } 
        if(
Player_CheckPoint[playerid] < && 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] == && 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 
0MAX_PLAYERSi++) 
                { 
                    
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

and try using 158 to CP number, cuz it counts maybe from -1...
Reply


Messages In This Thread
Help with a racing checkpoint! :'( - by Youssefree - 07.07.2016, 00:26
Re: Help with a racing checkpoint! :'( - by Dusan01 - 07.07.2016, 06:24
Re: Help with a racing checkpoint! :'( - by Mencent - 07.07.2016, 07:34

Forum Jump:


Users browsing this thread: 1 Guest(s)