Major Checkpoint / Job Issue
#1

Ok, So this is my trash cleaner job. Right when it gets to the second checkpoint. It doesn't change, and you can keep driving through it to earn money. And I'm stuck as to how I should fix it in this case, because well, I've never had this problem before. Was hoping one of you would see the issue =3

pawn Код:
new Float:TrashRoutes[][][4] = {
    {
        {2252.80, -2223.42, 13.87},
        {2861.45, -2030.87, 11.48},
        {2804.29, -1654.58, 11.22},
        {2740.87, -1367.50, 42.23},
        {2568.79, -1288.29, 46.52},
        {2547.91, -1487.51, 24.41},
        {2428.09, -1558.11, 24.37},
        {2371.16, -1906.66, 13.93},
        {2341.36, -1969.18, 13.85},
        {2236.40, -2016.21, 14.09},
        {2213.46, -2009.45, 13.86},
        {2113.69, -2095.30, 14.09},
        {0.0, 0.0, 0.0}
    }
};

public OnPlayerEnterCheckpoint(playerid)
{
    //FuncLog("OnPlayerEnterCheckpoint");
    if(GetPVarInt(playerid, "GarbageRoute"))
    {
        new route = GetPVarInt(playerid, "GarbageRoute")-1;
        new cp = GetPVarInt(playerid, "GarbageCP");//-1
       
        if(TrashRoutes[route][cp][0] == 0.0)
        {
            DeletePVar(playerid, "GarbageRoute");
            DeletePVar(playerid, "GarbageCP");
            PlayerPlaySound(playerid, 1056, 0.0, 0.0, 0.0);
            PlayerInfo[playerid][pPayCheck] += 5;
            GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~r~$5 Route Bonus", 2000, 3);
            DestroyVehicleEx(GetPlayerVehicleID(playerid));
            DisablePlayerCheckpoint(playerid);
        }
        else
        {
            SetPVarInt(playerid, "GarbageCP", cp);
            SetPlayerCheckpoint(playerid, TrashRoutes[route][cp][0], TrashRoutes[route][cp][1], TrashRoutes[route][cp][2], 5.0);
            PlayerPlaySound(playerid, 1056, 0.0, 0.0, 0.0);
            GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~r~$25 Bonus", 2000, 3);
            PlayerInfo[playerid][pPayCheck] += 25;
        }
        return 1;
    }
    return 1;
}

CMD:startclean(playerid)
{
    if(GetPVarInt(playerid, "GarbageRoute") > 0)
    {
        SendClientMessage(playerid, COLOR_LIGHTRED, "   You are already on a route!");
        return 1;
    }
    if(IsPlayerBlocked(playerid))
        return SCM(playerid, COLOR_LIGHTRED, "  You can't do that right now!");
    if(GetPVarInt(playerid, "GarbageCooldown") > gettime())
    {
        format(UpdateQuery, 128, "  You have to wait another %d seconds before starting another route!", GetPVarInt(playerid, "GarbageCooldown")-gettime());
        SCM(playerid, COLOR_LIGHTRED, UpdateQuery);
    }

    if(IsPlayerInRangeOfPoint(playerid, 2.0, 2103.95, -2093.75, 13.54))
    {
        SetPVarInt(playerid, "GarbageCooldown", gettime()+180);
        new rand = random(2);
        new car;
        if(rand == 0)
            car = CreateVehicleEx(408, 2108.79, -2088.04, 14.10, 180.0, -1, -1, VehicleSpawnTime);//Trashmaster
        else
            car = CreateVehicleEx(574, 2108.79, -2088.04, 14.10, 180.0, -1, -1, VehicleSpawnTime);//Sweeper
           
        PutPlayerInVehicle(playerid, car, 0);
        SetVehicleParamsEx(car, false, false, false, true, false, false, false);
        rand = random(sizeof(TrashRoutes));
        SetPVarInt(playerid, "GarbageRoute", rand+1);
        SetPVarInt(playerid,"GarbageRoute", 1);
        SetPVarInt(playerid, "GarbageCP", 1);
        SetPlayerCheckpoint(playerid, TrashRoutes[rand][0][0], TrashRoutes[rand][0][1], TrashRoutes[rand][0][2], 5.0);
       
        GameTextForPlayer(playerid, "~w~Get to work", 3000, 3);
        return 1;
    }
    else
        SendClientMessage(playerid, COLOR_LIGHTRED, "   You are not at the Street Cleaning Services HQ.");
    return 1;
}
Reply
#2

https://sampforum.blast.hk/showthread.php?tid=262374
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)