Checkpoint in a plane, help!
#1

Hey,

I am just started with scripting. And now i have a problem with some checkpoint.
When i enter a plane i want it to set a checkpoint, and when i enter the checkpoint i want it to give it a new checkpoint. My problem is that the when i go in to the second checkpoint, the checkpoint just give me the score for all checkpoints i made, and not set the next checkpoint. What have i done wrong? please help!

Breilid


pawn Код:
new plane1;
new plane2;





public OnGameModeInit()
{
plane1 = AddStaticVehicle(476,-694.00000000,2184.50000000,59.90000153,0.00000000,105,88); //Rustler
plane2 = AddStaticVehicle(476,839.90002441,2240.39990234,12.00000000,315.00000000,215,142); //Rustler

     return 1;
}






public OnPlayerStateChange(playerid, newstate, oldstate)
{
    new playervehicleid = GetPlayerVehicleID(playerid);//Playerid = GetPlayerVehicle ID Easier for me

        if(gTeam[playerid] == TEAM_ONE && vehicleid == plane2)
        {
            GameTextForPlayer(playerid, "Support Plane! ~g~Circle It Around", 5000, 5);
            SetPlayerRaceCheckpoint(playerid, 3,951.75390625,2065.3466796875,200,0.0,0.0,0.0,10);
            SendClientMessageToAll(COLOR_RED,"Team Two Has Send Up The Support");
        }
        else if(gTeam[playerid] == TEAM_ONE && vehicleid == plane1)
        {
            GameTextForPlayer(playerid, "You Don't Have The Key To The Plane", 5000, 5);
            RemovePlayerFromVehicle(playerid); // player out of vehicle
        }
        else if(gTeam[playerid] == TEAM_TWO && vehicleid == plane1)
        {
            GameTextForPlayer(playerid, "Support Plane! ~g~Circle It Around", 5000, 5);
            SetPlayerRaceCheckpoint(playerid, 3,951.75390625,2065.3466796875,200,0.0,0.0,0.0,10);
            SendClientMessageToAll(COLOR_RED,"Team One Has Send Up The Support");
        }
        else if(gTeam[playerid] == TEAM_TWO && vehicleid == plane2)
        {
            GameTextForPlayer(playerid, "You Don't Have The Key To The Plane", 5000, 5);
            RemovePlayerFromVehicle(playerid); // player out of vehicle
        }
}





public OnPlayerEnterRaceCheckpoint(playerid)
{
    new playervehicleid = GetPlayerVehicleID(playerid);
    if(gTeam[playerid] == TEAM_ONE)
    {
        switch(playervehicleid == plane2)
        {
        case 1:
            {
            DisablePlayerRaceCheckpoint(playerid);
            SetPlayerScore(playerid, GetPlayerScore(playerid) + 4);
            GameTextForPlayer(playerid,"+4 Points For Driving The Support Plane", 3000, 5);
            GameTextForAll("Team Two Is Driving The Support Plane", 3000, 5);
            SetPlayerRaceCheckpoint(playerid, 3,230.10000610352,2500.1000976563,200,0.0,0.0,0.0,10);
            return 1;
            }
        case 2:
            {
            DisablePlayerRaceCheckpoint(playerid);
            SetPlayerScore(playerid, GetPlayerScore(playerid) + 4);
            GameTextForPlayer(playerid,"+4 Points For Driving The Support Plane", 3000, 5);
            GameTextForAll("Team Two Is Driving The Support Plane", 3000, 5);
            SetPlayerRaceCheckpoint(playerid, 3,-408.294921875,2229.166015625,200,0,0,0,10);
            return 1;
            }
        case 3:
            {
            DisablePlayerRaceCheckpoint(playerid);
            SetPlayerScore(playerid, GetPlayerScore(playerid) + 4);
            GameTextForPlayer(playerid,"+4 Points For Driving The Support Plane", 3000, 5);
            GameTextForAll("Team Two Is Driving The Support Plane", 3000, 5);
            SetPlayerRaceCheckpoint(playerid, 3,-296.1201171875,1504.65625,240,0,0,0,10);
            return 1;
            }
        case 4:
            {
            DisablePlayerRaceCheckpoint(playerid);
            SetPlayerScore(playerid, GetPlayerScore(playerid) + 4);
            GameTextForPlayer(playerid,"+4 Points For Driving The Support Plane", 3000, 5);
            GameTextForAll("Team Two Is Driving The Support Plane", 5000, 5);
            SetPlayerRaceCheckpoint(playerid, 4,198.4560546875,1903.197265625,200,0,0,0,10);
            return 1;
            }
        case 5:
            {
            DisablePlayerRaceCheckpoint(playerid);
            SetPlayerScore(playerid, GetPlayerScore(playerid) + 4);
            GameTextForPlayer(playerid,"+4 Points For Driving The Support Plane", 3000, 5);
            GameTextForAll("Team Two Is Done With The Support Plane", 5000, 5);did it
            return 1;
            }
  }
    }
    else if(gTeam[playerid] == TEAM_TWO)
    {
        switch(playervehicleid == plane1)
        {
        case 1:
            {
            DisablePlayerRaceCheckpoint(playerid);
            SetPlayerScore(playerid, GetPlayerScore(playerid) + 4);
            GameTextForPlayer(playerid,"+4 Points For Driving The Support Plane", 3000, 5);
            GameTextForAll("Team Two Is Driving The Support Plane", 3000, 5);
            SetPlayerRaceCheckpoint(playerid, 3,230.10000610352,2500.1000976563,200,0.0,0.0,0.0,10);
            return 1;
            }
        case 2:
            {
            DisablePlayerRaceCheckpoint(playerid);
            SetPlayerScore(playerid, GetPlayerScore(playerid) + 4);
            GameTextForPlayer(playerid,"+4 Points For Driving The Support Plane", 3000, 5);
            GameTextForAll("Team Two Is Driving The Support Plane", 3000, 5);
            SetPlayerRaceCheckpoint(playerid, 3,-408.294921875,2229.166015625,200,0,0,0,10);
            return 1;
            }
        case 3:
            {
            DisablePlayerRaceCheckpoint(playerid);
            SetPlayerScore(playerid, GetPlayerScore(playerid) + 4);
            GameTextForPlayer(playerid,"+4 Points For Driving The Support Plane", 3000, 5);
            GameTextForAll("Team Two Is Driving The Support Plane", 3000, 5);
            SetPlayerRaceCheckpoint(playerid, 3,-296.1201171875,1504.65625,240,0,0,0,10);
            return 1;
            }
        case 4:
            {
            DisablePlayerRaceCheckpoint(playerid);
            SetPlayerScore(playerid, GetPlayerScore(playerid) + 4);
            GameTextForPlayer(playerid,"+4 Points For Driving The Support Plane", 3000, 5);
            GameTextForAll("Team Two Is Driving The Support Plane", 5000, 5);//
            SetPlayerRaceCheckpoint(playerid, 4,198.4560546875,1903.197265625,200,0,0,0,10);
            return 1;
            }
        case 5:
            {
            DisablePlayerRaceCheckpoint(playerid);
            SetPlayerScore(playerid, GetPlayerScore(playerid) + 4);
            GameTextForPlayer(playerid,"+4 Points For Driving The Support Plane", 3000, 5);
            GameTextForAll("Team Two Is Done With The Support Plane", 5000, 5);
            return 1;
            }
        }
    }
    return 1;
}
Reply
#2

add [PAWN] tags
it is unreadable
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)