Checkpoint Problem
#1

My problem is that after I enter the first checkpoint then load all passengers. It says "All passengers have boarded the plane. Fly to San Fierro." But the checkpoint didn't change, it was still in Los Santos where I first load all passengers board.


pawn Код:
public OnFilterScriptInit()
{
    CreatePickup(1318,1,2460.6772,-2120.8718,13.5530,17);
    Create3DTextLabel("Pilot Job Starting Position /work to begin", WHITE, 1922.7498,-2235.1013,13.5469, 40.0, 17, 0);
    CreatePickup(1318,1,1922.7498,-2235.1013,13.5469,17);
pawn Код:
public OnPlayerEnterCheckpoint(playerid)
{
    if(flyjob[playerid] == 1)
    {
        if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 553)
        {
            flyjob[playerid] = 2;
            SendClientMessage(playerid, WHITE, "Loading passengers, please wait until they board the Aircraft.");
            TogglePlayerControllable(playerid, 0);
            SetTimerEx("fly1", 6500, false, "i", playerid);
            return 1;
        }
    }
    if(flyjob[playerid] == 2)
    {
        if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 553)
        {
            flyjob[playerid] = 3;
            SendClientMessage(playerid, WHITE, "Dropping off the passengers, please wait until they leave the Aircraft.");
            TogglePlayerControllable(playerid, 0);
            SetTimerEx("fly2", 5000, false, "i", playerid);
            return 1;
        }
    }
    if(flyjob[playerid] == 3)
    {
        if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 553)
        {
            flyjob[playerid] = 4;
            SendClientMessage(playerid, WHITE, "Loading passengers, please wait.");
            TogglePlayerControllable(playerid, 0);
            SetTimerEx("fly3", 4000, false, "i", playerid);
            return 1;
        }
    }
    if(flyjob[playerid] == 4)
    {
        if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 553)
        {
            flyjob[playerid] = 5;
            SendClientMessage(playerid, WHITE, "Dropping off the passengers, please wait until they leave the Aircraft.");
            TogglePlayerControllable(playerid, 0);
            SetTimerEx("fly4", 5000, false, "i", playerid);
            return 1;
        }
    }
    if(flyjob[playerid] == 5)
    {
        if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 553)
        {
            flyjob[playerid] = 6;
            SendClientMessage(playerid, WHITE, "Loading passengers, please wait.");
            TogglePlayerControllable(playerid, 0);
            SetTimerEx("fly5", 4000, false, "i", playerid);
            return 1;
        }
    }
    if(flyjob[playerid] == 6)
    {
        if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 553)
        {
            flyjob[playerid] = 7;
            SendClientMessage(playerid, WHITE, "Dropping off the passengers, please wait until they leave the Aircraft.");
            TogglePlayerControllable(playerid, 0);
            SetTimerEx("fly6", 5000, false, "i", playerid);
            return 1;
        }
    }
    if(flyjob[playerid] == 7)
    {
        if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 553)
        {
            flyjob[playerid] = 8;
            SendClientMessage(playerid, WHITE, "Loading passengers, please wait.");
            TogglePlayerControllable(playerid, 0);
            SetTimerEx("fly7", 5000, false, "i", playerid);
            return 1;
        }
    }
    if(flyjob[playerid] == 8)
    {
        if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 553)
        {
            flyjob[playerid] = 0;
            SendClientMessage(playerid, WHITE, "All passengers leave the plane, and you receive your well-earned paycheck.");
            GivePlayerMoney(playerid, 15000);
            DisablePlayerCheckpoint(playerid);
            return 1;
        }
    }
    return 1;
}
Forwards
pawn Код:
forward fly7(playerid);
public fly7(playerid)
{
    TogglePlayerControllable(playerid, 1);
    SendClientMessage(playerid, WHITE, "All passengers have boarded the plane. Fly to the final location at Los Santos International.");
    CreateDynamicCP(1752.5477,-2436.4402,13.5547, 13.0, 17,-1,-1,300.0);
    return 1;
}

forward fly6(playerid);
public fly6(playerid)
{
    TogglePlayerControllable(playerid, 1);
    SendClientMessage(playerid, WHITE, "All passengers have left the aircraft. Move to the boarding station.");
    CreateDynamicCP(1591.7302,1226.8308,10.8125, 13.0, 17,-1,-1,300.0);
    return 1;
}

forward fly5(playerid);
public fly5(playerid)
{
    TogglePlayerControllable(playerid, 1);
    SendClientMessage(playerid, WHITE, "All passengers have boarded the plane. Fly to Las Venturas International.");
    CreateDynamicCP(1568.2208,1391.5486,10.8503, 13.0, 17,-1,-1,300.0);
    return 1;
}
forward fly4(playerid);
public fly4(playerid)
{
    TogglePlayerControllable(playerid, 1);
    SendClientMessage(playerid, WHITE, "All passengers have left the aircraft. Move to the boarding station.");
    CreateDynamicCP(403.6174,2479.0940,16.4844, 13.0, 17,-1,-1,300.0);
    return 1;
}

forward fly3(playerid);
public fly3(playerid)
{
    TogglePlayerControllable(playerid,0);
    SendClientMessage(playerid, WHITE, "All passengers have boarded the plane. Fly to the checkpoint on your radar.");
    CreateDynamicCP(365.3323,2537.3154,16.6649, 13.0, 17,-1,-1,300.0);
    return 1;
}



forward fly2(playerid);
public fly2(playerid)
{
    TogglePlayerControllable(playerid, 1);
    SendClientMessage(playerid, WHITE, "All passengers have left the plane. Move to the boarding station.");
    CreateDynamicCP(-1269.5527,-631.1264,14.1484, 13.0, 17,-1,-1,300.0);
    return 1;
}

forward fly1(playerid);
public fly1(playerid)
{
    TogglePlayerControllable(playerid, 1);
    SendClientMessage(playerid, WHITE, "All passengers have boarded the plane. Fly to San Fierro.");
    CreateDynamicCP(-1271.1177,19.1501,14.1484, 13.0, 17,-1,-1,300.0);
    return 1;
}
pawn Код:
CMD:work(playerid, params[])
{
    if(IsPlayerInRangeOfPoint(playerid, 18.0,1922.7498,-2235.1013,13.5469))
    {
        if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 460 || GetVehicleModel(GetPlayerVehicleID(playerid)) == 511 || GetVehicleModel(GetPlayerVehicleID(playerid)) == 519 || GetVehicleModel(GetPlayerVehicleID(playerid)) == 553 || GetVehicleModel(GetPlayerVehicleID(playerid)) == 577 || GetVehicleModel(GetPlayerVehicleID(playerid)) == 592)
        {
            flyjob[playerid] = 1;
            SendClientMessage(playerid, WHITE, "You have joined the Pilot Job. Proceed to the checkpoints");
            CreateDynamicCP(1922.7498,-2235.1013,13.5469, 13.0, 17,-1,-1,300.0);
            return 1;
        }
        else SendClientMessage(playerid, COLOR_RED, "You must be in a Aircraft. Pick one up at the Los Santos International Airport");
    }
    return 1;
}
Reply
#2

Quote:
Originally Posted by SaYrOn
Посмотреть сообщение
I think something wrong with CreateDynamicCP arguments. Try to set checkpoint to exact player

Код:
CreateDynamicCP(Float:x, Float:y, Float:z, Float:size, worldid = -1, interiorid = -1, playerid = -1, Float:distance = 100.0);
I don't get it. What you mean is change playerid= -1, to specified one?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)