Help with race checkpoints
#1

Hey All,

I want to make a little system what lets you follow some checkpoints, i got this:

pawn Код:
if (strcmp (cmdtext,"/startline1", true) == 0)
{
  if IsPlayerInRangeOfPoint(playerid, 5.0, 2775.3477,-1606.4093,11.0209) *then
  {
    SetPlayerRaceCheckpoint(playerid,0,1691.3124,-2317.0698,13.1099,1534.8900,-2284.3818,13.1099,5.0);
    gPlayerCheckpointStatus[playerid] = BUSLINE11;
    SendClientMessage(playerid,COLOR_GREEN,"Drive to the next checkpoint!");
    return 1;
  }
pawn Код:
switch (gPlayerCheckpointStatus[playerid])
                {
                case BUSLINE11:
                    {
                    gPlayerCheckpointStatus[playerid] = BUSLINE12;
                    SetPlayerRaceCheckpoint(playerid, 0, 1534.8900,-2284.3818,13.1099, 1360.0413,-2299.0510,13.1100, 5.0);
                    }
                case BUSLINE12:
                    {
                    gPlayerCheckpointStatus[playerid] = BUSLINE13;
                    SetPlayerRaceCheckpoint(playerid, 0, 1360.0413,-2299.0510,13.1100, 1278.2041,-2445.0911,7.9363, 5.0);
                    }
                case BUSLINE13:
                    {
                    gPlayerCheckpointStatus[playerid] = BUSLINE14;
                    SetPlayerRaceCheckpoint(playerid, 0, 1278.2041,-2445.0911,7.9363, 1108.4916,-1854.5470,13.1099, 5.0);
                    }
                case BUSLINE14:
                    {
                    gPlayerCheckpointStatus[playerid] = BUSLINE15;
                    SetPlayerRaceCheckpoint(playerid, 0, 1108.4916,-1854.5470,13.1099, 1572.2140,-1856.6042,13.1099, 5.0);
                    }
                case BUSLINE15:
                    {
                    gPlayerCheckpointStatus[playerid] = BUSLINE16;
                    SetPlayerRaceCheckpoint(playerid, 0, 1572.2140,-1856.6042,13.1099, 1572.4399,-1750.1161,13.1099, 5.0);
                    }
                case BUSLINE16:
                    {
                    gPlayerCheckpointStatus[playerid] = BUSLINE17;
                    SetPlayerRaceCheckpoint(playerid, 0, 1572.4399,-1750.1161,13.1099, 1531.7767,-1706.4436,13.1099, 5.0);
                    }
                case BUSLINE17:
                    {
                    gPlayerCheckpointStatus[playerid] = BUSLINE18;
                    SetPlayerRaceCheckpoint(playerid, 0, 1531.7767,-1706.4436,13.1099, 1680.7041,-1594.5792,13.1135, 5.0);
                    }
                case BUSLINE18:
                    {
                    gPlayerCheckpointStatus[playerid] = BUSLINE19;
                    SetPlayerRaceCheckpoint(playerid, 0, 1680.7041,-1594.5792,13.1135, 1818.7328,-1634.2960,13.1099, 5.0);
                    }
                case BUSLINE19:
                    {
                    gPlayerCheckpointStatus[playerid] = BUSLINE110;
                    SetPlayerRaceCheckpoint(playerid, 0, 1818.7328,-1634.2960,13.1099, 1819.5846,-1893.4481,13.1101, 5.0);
                    }
                case BUSLINE110:
                    {
                    gPlayerCheckpointStatus[playerid] = BUSLINE111;
                    SetPlayerRaceCheckpoint(playerid, 0, 1819.5846,-1893.4481,13.1101, 1959.4604,-2007.5430,13.1177, 5.0);
                    }
                case BUSLINE111:
                    {
                    gPlayerCheckpointStatus[playerid] = BUSLINE112;
                    SetPlayerRaceCheckpoint(playerid, 0, 1959.4604,-2007.5430,13.1177, 1959.4457,-2152.6189,13.1099, 5.0);
                    }
                case BUSLINE112:
                    {
                    gPlayerCheckpointStatus[playerid] = BUSLINE113;
                    SetPlayerRaceCheckpoint(playerid, 0, 1959.4457,-2152.6189,13.1099, 1607.2571,-2192.8301,13.1021, 5.0);
                    }
                case BUSLINE113:
                    {
                    gPlayerCheckpointStatus[playerid] = BUSLINE114;
                    SetPlayerRaceCheckpoint(playerid, 0, 1607.2571,-2192.8301,13.1021, 1730.3928,-2291.5469,13.1026, 5.0);
                    }
                case BUSLINE114:
                    {
                    DisablePlayerRaceCheckpoint(playerid);
                    SetPlayerRaceCheckpoint(playerid, 0, 1730.3928,-2291.5469,13.1026, 1691.3124,-2317.0698,13.1099, 5.0);
            }
But my problem is, when i go in the first checkpoint it stays there and isnt going to the next one...

Does someone know how to fix this?
Reply
#2

Do you have anything before switch (gPlayerCheckpointStatus[playerid]) that uses "return 1;"?
Reply
#3

Quote:
Originally Posted by Dark_Kostas
Do you have anything before switch (gPlayerCheckpointStatus[playerid]) that uses "return 1;"?
Its the Pen1 gamemode so this is infront of it:

pawn Код:
public OnPlayerEnterRaceCheckpoint(playerid)
{
    new string[128];
    new name[MAX_PLAYER_NAME];

    switch (gPlayerCheckpointStatus[playerid])
    {
    case CHECKPOINT_SR1START:
          {
            //  if (gdebug){print("DEBUG CHECKPOINT_SR1START");}
                if (GetPlayerState(playerid) != 2)
                {
                    return 1;
                }
                PlayerPlaySound(playerid, 1058, 0.0, 0.0, 0.0);
                if (gTeam[playerid] >= 3)
                {
                    new tmpcar = GetPlayerVehicleID(playerid);
                    if(IsAPlane(tmpcar))
                    {
                        GameTextForPlayer(playerid, "~w~No aircraft allowed in the race", 2000, 6);
                        return 1;
                    }
                    if (MissionActive == 5)// first to arrive
                    {
                        gRaceLeader++;
                    //  if (gdebug){printf("gRaceLeader %d",gRaceLeader);}
                        if (gRaceLeader == 1)
                        {
                            format(string, sizeof(string), "~r~Wait For More Racers");
                            GameTextForPlayer(playerid, string, 2000, 6);
                            gPlayerCheckpointStatus[playerid] = CHECKPOINT_SRA;
                            DisablePlayerRaceCheckpoint(playerid);
                            return 1;
                        }
                        else if (gRaceLeader == 2)
                        {
                            gRaceLeader = 0;
                        //  if (gdebug){printf("gRaceLeader %d",gRaceLeader);}
                            format(string, sizeof(string), "Hurry %d Seconds To Race Start!",racedelay/1000);
                            RingTone[playerid] = 20;
                            SendEnemyMessage(COLOR_WHITE, string);
                            format(string, sizeof(string), "~r~Wait Here For Racers");
                            gPlayerCheckpointStatus[playerid] = CHECKPOINT_SRA;
                            GameTextForPlayer(playerid, string, 2000, 6);
                        }
                        SetTimer("RaceDelay", racedelay, 0);
                        DisablePlayerRaceCheckpoint(playerid);
                        MissionActive = 6;
                    //  if (gdebug){print("DEBUG MissionActive = 6");}
                    }
                    else if (MissionActive == 6) //late arrivels
                    {
                    //  if (gdebug){print("DEBUG waiting");}
                        DisablePlayerRaceCheckpoint(playerid);
                        gPlayerCheckpointStatus[playerid] = CHECKPOINT_SRA;
                    }
                }
                else
                {
                    GameTextForPlayer(playerid, "~w~Patrol This Area~n~ For Suspects", 5000, 1);
                    gPlayerCheckpointStatus[playerid] = CHECKPOINT_NONE;
                    return 1;
                }
          }
        case CHECKPOINT_SRA:
          {
            //  if (gdebug){print("DEBUG CHECKPOINT_SRA");}
                if (GetPlayerState(playerid) != 2)
                {
                    return 1;
                }
                new tmpcar = GetPlayerVehicleID(playerid);
                if(IsAPlane(tmpcar))
                {
                    GameTextForPlayer(playerid, "~w~No aircraft allowed in the race", 2000, 6);
                    return 1;
                }
                if (StartTime[playerid] == 0)
                {
                    StartTime[playerid] = Gtickcount;
                    if(gTeam[playerid] == 3)
                    {
                        SetPlayerCriminal(playerid,255, "Street Racing",0,0);
                        //if(FlashTime[playerid] == 0){FlashTime[playerid] = 60;}
                    }
                }
                LapCount[playerid]++;
                gRaceEnd++;
                if(LapCount[playerid] > gLaps)
                {
                    gLaps = LapCount[playerid];
                    gRaceEnd = 1;
                }
                if(RaceInfo[rLaps] != 0)
                {
                    if(gLaps != (RaceInfo[rLaps]+1) && gLaps > 1)
                    {
                        //RaceDebug(playerid);
                        if(gLaps == 2)
                        {
                            for(new i = 0; i <= MAX_PLAYERS; i++)
                            {
                                if(IsPlayerConnected(i) && gTeam[i] == 2)
                                {
                                    format(cbjstore, sizeof(cbjstore), "HQ: 911 10-14 Set Up A RoadBlock At The Red Marker.");
                                    SendClientMessage(i, COLOR_DBLUE, cbjstore);
                                    RingTone[i] = 20;
                                    SetPlayerCheckpoint(i,rm2x,rm2y,rm2z, 8.0);
                                }
                            }
                            RaceTime[playerid] = Gtickcount;
                        }
                        if (gRaceEnd == 1 && LapCount[playerid] == gLaps)
                        {
                            pos1time = RaceTime[playerid] - StartTime[playerid];
                            ConvertTicks(pos1time);
                            GetPlayerName(playerid, name, sizeof(name));
                            format(string, sizeof(string), "RACENEWS: %s is in 1st Place T: %d:%d:%d", name,cmins,csecs,cmils);
                            BroadCast(COLOR_WHITE, string);
                            format(string, sizeof(string), "~w~Lap %d/%d~n~~g~1st Place ~n~~y~T: %d:%d:%d",gLaps,RaceInfo[rLaps],cmins,csecs,cmils);
                            SetAllCopCheckpoint(rex,rey,rez, 8.0);
                        }
                        else if (gRaceEnd == 2 && LapCount[playerid] == gLaps)
                        {
                            pos2time = RaceTime[playerid] - StartTime[playerid];
                            new splittime = pos2time - pos1time;
                            ConvertTicks(splittime);
                            GetPlayerName(playerid, name, sizeof(name));
                            format(string, sizeof(string), "RACENEWS: %s is in 2nd Place T: +%d:%d:%d", name,cmins,csecs,cmils);
                            BroadCast(COLOR_WHITE, string);
                            format(string, sizeof(string), "~w~Lap %d/%d~n~~g~2nd Place ~n~~y~T: %d:%d:%d",gLaps,RaceInfo[rLaps],cmins,csecs,cmils);
                        }
                        else if (gRaceEnd == 3 && LapCount[playerid] == gLaps)
                        {
                            pos3time = RaceTime[playerid] - StartTime[playerid];
                            new splittime = pos3time - pos1time;
                            ConvertTicks(splittime);
                            GetPlayerName(playerid, name, sizeof(name));
                            format(string, sizeof(string), "RACENEWS: %s is in 3rd Place T: +%d:%d:%d", name,cmins,csecs,cmils);
                            BroadCast(COLOR_WHITE, string);
                            format(string, sizeof(string), "~w~Lap %d/%d~n~~g~3rd Place ~n~~y~T: %d:%d:%d",gLaps,RaceInfo[rLaps],cmins,csecs,cmils);
                        }
                        else
                        {
                            format(string, sizeof(string), "~w~Lap %d/%d",LapCount[playerid],RaceInfo[rLaps]);
                        }
                        GameTextForPlayer(playerid, string, 5000, 1);
                    }
                    else if(gLaps == (RaceInfo[rLaps]+1) && gLaps > 1)
                    {
                        if (gRaceEnd == 1)
                        {
                            DisablePlayerCheckpoint(playerid);
                            PlayerPlaySound(playerid, 1058, 0.0, 0.0, 0.0);
                        //  if (gdebug){print("DEBUG RACE OVER");}
                            RewardCalc(playerid,1000,10000);
                            GetPlayerName(playerid, name, sizeof(name));
                            GivePlayerMoney(playerid, reward);
                            preward = reward;
                            PlayerPlayMusic(playerid);
                            format(string, sizeof(string), "~w~MISSION PASSED! ~n~~g~$%d", reward);
                            //format(string, sizeof(string), "~g~YOU WIN~n~~w~Your winnings are ~n~~g~$%d", reward);
                            GameTextForPlayer(playerid, string, 5000, 0);
                            BroadCast(COLOR_WHITE, "RACENEWS: The Race Will End In 120 secs");
                            RaceTime[playerid] = Gtickcount;
                            pos1time = RaceTime[playerid] - StartTime[playerid];
                            ConvertTicks(pos1time);
                            GetPlayerName(playerid, name, sizeof(name));
                            raceendtimer = SetTimer("RaceEnd", 120000, 0);
                            if(RaceInfo[rBestms] > pos1time || RaceInfo[rBestms] == 0)
                            {
                                RaceInfo[rBestms] = pos1time;
                                strmid(RaceInfo[rBest],name, 0, strlen(name), 255);
                                BestTime(CurrentRace);
                                format(string, sizeof(string), "RACENEWS: %s Just Won a StreetRace For $%d",name,reward);
                                BroadCast(COLOR_WHITE, string);
                                format(string, sizeof(string), "RACENEWS: %s Has Set A New Best Time In %s T: %d:%d:%d", name,CurrentRace,cmins,csecs,cmils);
                                BroadCast(COLOR_WHITE, string);
                            }
                            else
                            {
                                format(string, sizeof(string), "RACENEWS: %s Just Won a StreetRace For $%d T: %d:%d:%d", name,reward,cmins,csecs,cmils);
                                BroadCast(COLOR_WHITE, string);
                            }
                            SetPlayerCriminal(playerid,255, "Street Racing",1,1);
                            gPlayerMission[playerid] = 2;
                            BetWinner(playerid,1);
                            return 1;
                        }
                        else if (gRaceEnd == 2)
                        {
                            DisablePlayerCheckpoint(playerid);
                            PlayerPlaySound(playerid, 1058, 0.0, 0.0, 0.0);
                        //  if (gdebug){print("DEBUG RACE OVER");}
                            reward = preward/2;
                            GetPlayerName(playerid, name, sizeof(name));
                            GivePlayerMoney(playerid, reward);
                            PlayerPlayMusic(playerid);
                            format(string, sizeof(string), "~g~2nd place~n~~w~Your winnings are ~n~~g~$%d", reward);
                            GameTextForPlayer(playerid, string, 5000, 6);
                            RaceTime[playerid] = Gtickcount;
                            pos3time = RaceTime[playerid] - StartTime[playerid];
                            new splittime = pos3time - pos1time;
                            ConvertTicks(splittime);
                            GetPlayerName(playerid, name, sizeof(name));
                            format(string, sizeof(string), "RACENEWS: %s Just Came 2nd a StreetRace For $%d T: +%d:%d:%d", name,reward,cmins,csecs,cmils);
                            BroadCast(COLOR_WHITE, string);
                            return 1;
                        }
                        else if (gRaceEnd == 3)
                        {
                            CheckpointReset();
                            RaceCheckpointReset();
                            PlayerPlaySound(playerid, 1058, 0.0, 0.0, 0.0);
                        //  if (gdebug){print("DEBUG RACE OVER");}
                            reward = preward/3;
                            GetPlayerName(playerid, name, sizeof(name));
                            GivePlayerMoney(playerid, reward);
                            PlayerPlayMusic(playerid);
                            format(string, sizeof(string), "~g~3rd place~n~~w~Your winnings are ~n~~g~$%d", reward);
                            GameTextForPlayer(playerid, string, 5000, 6);
                            RaceTime[playerid] = Gtickcount;
                            pos2time = RaceTime[playerid] - StartTime[playerid];
                            new splittime = pos2time - pos1time;
                            ConvertTicks(splittime);
                            GetPlayerName(playerid, name, sizeof(name));
                            format(string, sizeof(string), "RACENEWS: %s Just Came 3rd a StreetRace For $%d T: +%d:%d:%d", name,reward,cmins,csecs,cmils);
                            BroadCast(COLOR_WHITE, string);
                            KillTimer(raceendtimer);
                            RaceEnd();
                            return 1;
                        }
                    }
                    PlayerPlaySound(playerid, 1058, 0.0, 0.0, 0.0);
                    SetPlayerRaceCheckpoint(playerid,0,rmx,rmy,rmz,rm2x,rm2y,rm2z, 8.0);
                    gPlayerCheckpointStatus[playerid] = CHECKPOINT_SRB;
                }
                if(RaceInfo[rLaps] == 0 && LapCount[playerid] == 1)
                {
                    PlayerPlaySound(playerid, 1058, 0.0, 0.0, 0.0);
                    SetPlayerRaceCheckpoint(playerid,0,rmx,rmy,rmz,rm2x,rm2y,rm2z, 8.0);
                    gPlayerCheckpointStatus[playerid] = CHECKPOINT_SRB;
                }
          }
        case CHECKPOINT_SRB:
          {
                if (GetPlayerState(playerid) != 2)
                {
                    return 1;
                }
                new tmpcar = GetPlayerVehicleID(playerid);
                if(IsAPlane(tmpcar))
                {
                    GameTextForPlayer(playerid, "~w~No aircraft allowed in the race", 2000, 6);
                    return 1;
                }
                if(gRaceMid != 1 && LapCount[playerid] > gLaps)
                {
                    gRaceMid = 1;
                }
            //  if (gdebug){print("DEBUG CHECKPOINT_SRB");}
                PlayerPlaySound(playerid, 1058, 0.0, 0.0, 0.0);
                SetPlayerRaceCheckpoint(playerid,0,rm2x,rm2y,rm2z,rex,rey,rez, 8.0);
                gPlayerCheckpointStatus[playerid] = CHECKPOINT_SRC;
                gRaceMid++;
            //  if (gdebug){printf("gRaceLeader %d",gRaceLeader);}
          }
        case CHECKPOINT_SRC:
          {
                if (GetPlayerState(playerid) != 2)
                {
                    return 1;
                }
                new tmpcar = GetPlayerVehicleID(playerid);
                if(IsAPlane(tmpcar))
                {
                    GameTextForPlayer(playerid, "~w~No aircraft allowed in the race", 2000, 6);
                    return 1;
                }
                if(gRaceMid2 != 1 && LapCount[playerid] > gLaps)
                {
                    gRaceMid2 = 1;
                }
            //  if (gdebug){print("DEBUG CHECKPOINT_SRB");}
                PlayerPlaySound(playerid, 1058, 0.0, 0.0, 0.0);
                SetPlayerRaceCheckpoint(playerid,0,rex,rey,rez,rsx,rsy,rsz, 8.0);
                gPlayerCheckpointStatus[playerid] = CHECKPOINT_SRD;
                gRaceMid2++;
            //  if (gdebug){printf("gRaceLeader %d",gRaceLeader);}
          }
        case CHECKPOINT_SRD:
          {
                if (GetPlayerState(playerid) != 2)
                {
                    return 1;
                }
                new tmpcar = GetPlayerVehicleID(playerid);
                if(IsAPlane(tmpcar))
                {
                    GameTextForPlayer(playerid, "~w~No aircraft allowed in the race", 2000, 6);
                    return 1;
                }
                if(gRaceFin != 1 && LapCount[playerid] > gLaps)
                {
                    gRaceFin = 1;
                }
            //  if (gdebug){print("DEBUG CHECKPOINT_SRC");}
                gRaceFin++;
                if(RaceInfo[rLaps] > 0)
                {
                    PlayerPlaySound(playerid, 1058, 0.0, 0.0, 0.0);
                    SetPlayerRaceCheckpoint(playerid,1,rsx,rsy,rsz,rsx,rsy,rsz, 8.0);
                    gPlayerCheckpointStatus[playerid] = CHECKPOINT_SRA;
                    SetAllCopCheckpoint(rex,rey,rez, 8.0);
                }
                if(RaceInfo[rLaps] == 0)
                {
                    if (gRaceFin == 1)
                    {
                        DisablePlayerCheckpoint(playerid);
                        PlayerPlaySound(playerid, 1058, 0.0, 0.0, 0.0);
                    //  if (gdebug){print("DEBUG RACE OVER");}
                        RewardCalc(playerid,1000,10000);
                        GetPlayerName(playerid, name, sizeof(name));
                        GivePlayerMoney(playerid, reward);
                        preward = reward;
                        PlayerPlayMusic(playerid);
                        format(string, sizeof(string), "~w~MISSION PASSED! ~n~~g~$%d", reward);
                        //RaceCheckpointReset();
                    DisablePlayerRaceCheckpoint(playerid);
                        //format(string, sizeof(string), "~g~YOU WIN~n~~w~Your winnings are ~n~~g~$%d", reward);
                        GameTextForPlayer(playerid, string, 5000, 0);
                        BroadCast(COLOR_WHITE, "RACENEWS: The Race Will End In 120 secs");
                        RaceTime[playerid] = Gtickcount;
                        pos1time = RaceTime[playerid] - StartTime[playerid];
                        ConvertTicks(pos1time);
                        GetPlayerName(playerid, name, sizeof(name));
                        raceendtimer = SetTimer("RaceEnd", 120000, 0);
                        if(RaceInfo[rBestms] > pos1time || RaceInfo[rBestms] == 0)
                        {
                            RaceInfo[rBestms] = pos1time;
                            strmid(RaceInfo[rBest],name, 0, strlen(name), 255);
                            BestTime(CurrentRace);
                            format(string, sizeof(string), "RACENEWS: %s Just Won a StreetRace For $%d",name,reward);
                            BroadCast(COLOR_WHITE, string);
                            format(string, sizeof(string), "RACENEWS: %s Has Set A New Best Time In %s T: %d:%d:%d", name,CurrentRace,cmins,csecs,cmils);
                            BroadCast(COLOR_WHITE, string);
                        }
                        else
                        {
                            format(string, sizeof(string), "RACENEWS: %s Just Won a StreetRace For $%d T: %d:%d:%d", name,reward,cmins,csecs,cmils);
                            BroadCast(COLOR_WHITE, string);
                        }
                        SetPlayerCriminal(playerid,255, "Street Racing",1,1);
                        gPlayerMission[playerid] = 2;
                        BetWinner(playerid,1);
                    }
                    else if (gRaceFin == 2)
                    {
                        DisablePlayerCheckpoint(playerid);
                        PlayerPlaySound(playerid, 1058, 0.0, 0.0, 0.0);
                    //  if (gdebug){print("DEBUG RACE OVER");}
                        reward = preward/2;
                        GetPlayerName(playerid, name, sizeof(name));
                        GivePlayerMoney(playerid, reward);
                        PlayerPlayMusic(playerid);
                        format(string, sizeof(string), "~g~2nd place~n~~w~Your winnings are ~n~~g~$%d", reward);
                        //RaceCheckpointReset();
                        DisablePlayerRaceCheckpoint(playerid);
                        GameTextForPlayer(playerid, string, 5000, 6);
                        RaceTime[playerid] = Gtickcount;
                        pos3time = RaceTime[playerid] - StartTime[playerid];
                        new splittime = pos3time - pos1time;
                        ConvertTicks(splittime);
                        GetPlayerName(playerid, name, sizeof(name));
                        format(string, sizeof(string), "RACENEWS: %s Just Came 2nd a StreetRace For $%d T: +%d:%d:%d", name,reward,cmins,csecs,cmils);
                        BroadCast(COLOR_WHITE, string);
                    }
                    else if (gRaceFin == 3)
                    {
                        CheckpointReset();
                        RaceCheckpointReset();
                        PlayerPlaySound(playerid, 1058, 0.0, 0.0, 0.0);
                    //  if (gdebug){print("DEBUG RACE OVER");}
                        reward = preward/3;
                        GetPlayerName(playerid, name, sizeof(name));
                        GivePlayerMoney(playerid, reward);
                        PlayerPlayMusic(playerid);
                        format(string, sizeof(string), "~g~3rd place~n~~w~Your winnings are ~n~~g~$%d", reward);
                        DisablePlayerRaceCheckpoint(playerid);
                        //RaceCheckpointReset();
                        GameTextForPlayer(playerid, string, 5000, 6);
                        RaceTime[playerid] = Gtickcount;
                        pos2time = RaceTime[playerid] - StartTime[playerid];
                        new splittime = pos2time - pos1time;
                        ConvertTicks(splittime);
                        GetPlayerName(playerid, name, sizeof(name));
                        format(string, sizeof(string), "RACENEWS: %s Just Came 3rd a StreetRace For $%d T: +%d:%d:%d", name,reward,cmins,csecs,cmils);
                        BroadCast(COLOR_WHITE, string);
                        KillTimer(raceendtimer);
                        RaceEnd();
                    }
Reply
#4

Everything looks fine. They only thing that is MAYBE wrong is this.

#define BUSLINE11 number
is equal with
#define CHECKPOINT_SR1START number

Check the numbers that they are all different. I cant think something else...
Reply
#5

Yeah they are all diffrent:

pawn Код:
#define CHECKPOINT_NONE 0
#define CHECKPOINT_PICKUP 1
#define CHECKPOINT_DROPOFF 2
#define CHECKPOINT_SR1START 3
#define CHECKPOINT_SRA 4
#define CHECKPOINT_SRB 5
#define CHECKPOINT_SRC 6
#define CHECKPOINT_SRD 7
#define CHECKPOINT_SRE 8
#define CHECKPOINT_SRF 9
#define CHECKPOINT_SRG 10
#define CHECKPOINT_CARDROP 11
#define CHECKPOINT_HOME 12
#define CHECKPOINT_DM 13
#define BUSLINE11 14
#define BUSLINE12 15
#define BUSLINE13 16
#define BUSLINE14 17
#define BUSLINE15 18
#define BUSLINE16 19
#define BUSLINE17 20
#define BUSLINE18 21
#define BUSLINE19 23
#define BUSLINE110 24
#define BUSLINE111 25
#define BUSLINE112 26
#define BUSLINE113 27
#define BUSLINE114 28
Reply
#6

under this switch (gPlayerCheckpointStatus[playerid])
put
pawn Код:
if (gdebug) printf("DEBUG Checkpoint ID: %d", gPlayerCheckpointStatus[playerid]);
Enable your debug, and look what it prints when you enter in the first bus checkpoint.
Reply
#7

Quote:
Originally Posted by Dark_Kostas
under this switch (gPlayerCheckpointStatus[playerid])
put
pawn Код:
if (gdebug) printf("DEBUG Checkpoint ID: %d", gPlayerCheckpointStatus[playerid]);
Enable your debug, and look what it prints when you enter in the first bus checkpoint.
Nothing...
Reply
#8

Then the switch is not even called!!

put print("OnPlayerEnterRaceCheckpoint has been called"); between
new name[MAX_PLAYER_NAME];
and
switch (gPlayerCheckpointStatus[playerid])

If you dont see anything, then there is a bug in the callback... i dont know. I cant do something else
Reply


Forum Jump:


Users browsing this thread: