Why won't this work.
#10

Done. I just made the basically exact same thing, using 'else if' instead of 'if' or just make sure they're closed.
pawn Код:
public OnPlayerEnterCheckpoint(playerid)
{
    new vehicleid = GetPlayerVehicleID(playerid);
    if (GetVehicleModel(vehicleid) == 515)
    if (IsTrailerAttachedToVehicle(vehicleid))
    {
        GameTextForPlayer(playerid, "~r~Congratulations! ~n~Successfully Completed! ~n~~g~$5,000", 2000, 3);
        GivePlayerMoney(playerid, 5000);
        DisablePlayerCheckpoint(playerid);
        SetVehicleToRespawn(vehicleid);
        SetVehicleToRespawn(Trailer[0]);
        SetVehicleToRespawn(Trailer[1]);
    }
    else
    {
        GameTextForPlayer(playerid, "~r~You need a trailer. ~w~~n~Noob", 2000, 3);
    }
    else
    {
        DisablePlayerCheckpoint(playerid);
    }

    if (GetVehicleModel(vehicleid) == 420)
    {
        GameTextForPlayer(playerid, "~r~Congratulations! ~n~Successfully Completed! ~n~~g~$5,000~", 2000, 3);
        GivePlayerMoney(playerid, 5000);
        DisablePlayerCheckpoint(playerid);
        SetVehicleToRespawn(vehicleid);
    }
     else
    {
        GameTextForPlayer(playerid, "You are not in the right~n~~y~vehicle", 2000, 3);
    }
    else
    {
        DisablePlayerCheckpoint(playerid);
    }
    return 1;
}

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if (GetVehicleModel(vehicleid) == 515)
    {
        new rand = random(sizeof(checkpoints));
        SetPlayerCheckpoint(playerid,checkpoints[rand][0],checkpoints[rand][1],checkpoints[rand][2],checkpoints[rand][3]);
    }
   
    else if (GetVehicleModel(vehicleid) == 420)
    {
        new rand = random(sizeof(checkpoints));
        SetPlayerCheckpoint(playerid,checkpoints[rand][0],checkpoints[rand][1],checkpoints[rand][2],checkpoints[rand][3]);
    }
    return 1;
}


public OnPlayerExitVehicle(playerid, vehicleid)
{
  if (GetVehicleModel(vehicleid) == 515)
  {
  DisablePlayerCheckpoint(playerid);
  }
  else if (GetVehicleModel(vehicleid) == 420)
  {
  DisablePlayerCheckpoint(playerid);
  }
    return 1;
}
Reply


Messages In This Thread
Why won't this work. - by Bofhead - 21.06.2009, 07:12
Re: Why won't this work. - by Abernethy - 21.06.2009, 07:18
Re: Why won't this work. - by Bofhead - 21.06.2009, 07:20
Re: Why won't this work. - by MenaceX^ - 21.06.2009, 07:20
Re: Why won't this work. - by Bofhead - 21.06.2009, 07:22
Re: Why won't this work. - by Abernethy - 21.06.2009, 07:24
Re: Why won't this work. - by Bofhead - 21.06.2009, 07:27
Re: Why won't this work. - by Abernethy - 21.06.2009, 07:37
Re: Why won't this work. - by Bofhead - 21.06.2009, 07:38
Re: Why won't this work. - by Abernethy - 21.06.2009, 07:44

Forum Jump:


Users browsing this thread: 1 Guest(s)