/loadtruck problem
#1

If i do /loadtruck as trucker it gives me checkpoint. And if i drive into that checkpoint it just dissapears. It wont give me dialog
NB! I use Roleplay script
pawn Код:
CMD:loadtruck(playerid, params[])
{
    if(PlayerInfo[playerid][pJob] == 20 || PlayerInfo[playerid][pJob2] == 20)
    {
        new vehicleid = GetPlayerVehicleID(playerid);
        if(IsATruckerCar(vehicleid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
        {
            if(gPlayerCheckpointStatus[playerid] == CHECKPOINT_NONE || GetPVarInt(playerid, "Packages") >= 1 || TaxiAccepted[playerid] != 999 || EMSAccepted[playerid] != 999 || BusAccepted[playerid] != 999 || MedicAccepted[playerid] != 999 || MechanicCallTime[playerid] >= 1)
            {
                if(GetProgressBarValue(LoadTruckBar[playerid]) > 10)
                {
                    SendClientMessageEx(playerid, COLOR_WHITE, "You are currently loading your Truck!");
                    return 1;
                }
                if(TruckUsed[playerid] != INVALID_VEHICLE_ID)
                {
                    SendClientMessageEx(playerid, COLOR_WHITE, "You are already on another delivery, type /cancel truck to cancel that delivery.");
                    return 1;
                }
                gPlayerCheckpointStatus[playerid] = CHECKPOINT_LOADTRUCK;
                SetPlayerCheckpoint(playerid,2441.302, -2115.123, 13.554687, 4);
                GameTextForPlayer(playerid, "~w~Waypoint set ~r~San Fierro Docks", 5000, 1);
                SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "* Pick up some goods to transport with your Truck at San Fierro Docks (see checkpoint on radar).");
            }
            else return SendClientMessageEx(playerid, COLOR_WHITE, "Please ensure that your current checkpoint is destroyed first (you either have material packages, or another existing checkpoint).");
        }
        else return SendClientMessageEx(playerid, COLOR_GREY, "You are not driving a San Fierro Docks Truck!");
    }
    else return SendClientMessageEx(playerid, COLOR_GREY, "You are not a Trucker!");
    return 1;
}

forward LoadTruck(playerid);
public LoadTruck(playerid)
{
    LoadTruckTime[playerid]--;
    SetProgressBarValue(LoadTruckBar[playerid], GetProgressBarValue(LoadTruckBar[playerid])-10.0);
    UpdateProgressBar(LoadTruckBar[playerid], playerid);
    if(GetProgressBarValue(LoadTruckBar[playerid]) > 10) SetTimerEx("LoadTruck", 1000, 0, "d", playerid);

    if(GetProgressBarValue(LoadTruckBar[playerid]) == 50.0)
    {
        SetProgressBarColor(LoadTruckBar[playerid], COLOR_YELLOW);
        UpdateProgressBar(LoadTruckBar[playerid], playerid);
    }
    else if(GetProgressBarValue(LoadTruckBar[playerid]) == 20.0)
    {
        SetProgressBarColor(LoadTruckBar[playerid], COLOR_RED);
        UpdateProgressBar(LoadTruckBar[playerid], playerid);
    }
    else if(GetProgressBarValue(LoadTruckBar[playerid]) <= 10.0)
    {
        DeletePVar(playerid, "IsFrozen");
        TogglePlayerControllable(playerid, 1);
        DestroyProgressBar(LoadTruckBar[playerid]);
        LoadTruckBar[playerid] = INVALID_BAR_ID;

        new vehicleid = GetPlayerVehicleID(playerid);
        new truckdeliver = GetPVarInt(playerid, "TruckDeliver");
        TruckContents[vehicleid] = truckdeliver;
        TruckUsed[playerid] = vehicleid;

        if(truckdeliver == 1)
        {
            SendClientMessageEx(playerid, COLOR_LIGHTBLUE,"* Your Truck was filled with food & beverages.");
            SetPlayerCheckpoint(playerid, 920.421142, -1361.637084, 13.003659, 5);
        }
        else if(truckdeliver == 2)
        {
            SendClientMessageEx(playerid, COLOR_LIGHTBLUE,"* Your Truck was filled with food & beverages.");
            SetPlayerCheckpoint(playerid, 1197.744384, -886.373901, 42.819854, 5);
        }
        else if(truckdeliver == 3)
        {
            SendClientMessageEx(playerid, COLOR_LIGHTBLUE,"* Your Truck was filled with food & beverages.");
            SetPlayerCheckpoint(playerid, 2111.115722, -1783.749877, 13.188007, 5);
        }
        else if(truckdeliver == 4)
        {
            SendClientMessageEx(playerid, COLOR_LIGHTBLUE,"* Your Truck was filled with clothing.");
            SetPlayerCheckpoint(playerid, 2236.051757, -1690.114990, 13.744861, 5);
        }
        else if(truckdeliver == 5)
        {
            SendClientMessageEx(playerid, COLOR_LIGHTBLUE,"* Your Truck was filled with clothing.");
            SetPlayerCheckpoint(playerid, 454.168640, -1501.456909, 30.757781, 5);
        }
        else if(truckdeliver == 6)
        {
            SendClientMessageEx(playerid, COLOR_LIGHTBLUE,"* Your Truck was filled with clothing.");
            SetPlayerCheckpoint(playerid, 2111.877929, -1218.093139, 23.604995, 5);
        }
        else if(truckdeliver == 7)
        {
            SendClientMessageEx(playerid, COLOR_LIGHTBLUE,"* Your Truck was filled with materials.");
            SetPlayerCheckpoint(playerid, 2197.721923, -1975.567260, 13.359717, 5);
        }
        else if(truckdeliver == 8)
        {
            SendClientMessageEx(playerid, COLOR_LIGHTBLUE,"* Your Truck was filled with 24/7 items.");
            SetPlayerCheckpoint(playerid, 1339.484497, -1763.289916, 13.332603, 5);
        }
        else if(truckdeliver == 9)
        {
            SendClientMessageEx(playerid, COLOR_LIGHTBLUE,"* Your Truck was filled with 24/7 items.");
            SetPlayerCheckpoint(playerid, 1003.885925, -906.400634, 41.986915, 5);
        }
        else if(truckdeliver == 10)
        {
            SendClientMessageEx(playerid, COLOR_LIGHTBLUE,"* Your Truck was filled with 24/7 items.");
            SetPlayerCheckpoint(playerid, 1837.636108, -1832.414062, 13.385854, 5);
        }
        else if(truckdeliver >= 11 && truckdeliver <= 15)
        {
            SendClientMessageEx(playerid, COLOR_LIGHTBLUE,"* Your Truck was filled with weapons.");
            SetPlayerCheckpoint(playerid, 2781.596435, -2494.261230, 13.457942, 5);
        }
        else if(truckdeliver >= 16 && truckdeliver <= 20)
        {
            SendClientMessageEx(playerid, COLOR_LIGHTBLUE,"* Your Truck was filled with drugs.");
            SetPlayerCheckpoint(playerid, 2443.682373, -1426.901489, 23.796508, 5);
        }
        else if(truckdeliver >= 21 && truckdeliver <= 25)
        {
            SendClientMessageEx(playerid, COLOR_LIGHTBLUE,"* Your Truck was filled with illegal materials.");
            SetPlayerCheckpoint(playerid, 2166.486083, -2273.158935, 13.166786, 5);
        }

        SendClientMessageEx(playerid, COLOR_WHITE, "HINT: Deliver the goods to the specified location (see checkpoint on radar).");
        SendClientMessageEx(playerid, COLOR_REALRED, "WARNING: Watch out for truck hijackers, they can hijack your truck and get away with the goods.");
        if(truckdeliver >= 11)
        {
            SendClientMessageEx(playerid, COLOR_REALRED, "WARNING #2: You are transporting illegal goods so watch out for law enforcement.");
        }
        SetPVarInt(playerid, "tpTruckRunTimer", 30);
        SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_TPTRUCKRUNTIMER);
    }
    return 1;
}
Reply
#2

People tend to delete some parts in next-generations rp leaked scripts. There are nonedited ones on ****** tho.
If its the checkpoint, that doesnt trigger the dialog, you should search the code under OnPlayerEnterCheckpoint
Reply
#3

Well the thing is That Trucker job was in SF before, so i edited the coordinates to LS Docks and after that the dialog wont show.
Reply
#4

I tried everything. Doesnt seem to work. When it was in SF it worked
Reply
#5

Fixed. I didnt edit
CHECKPOINT_LOADTRUCK
CHECKPOINT_RETURNTRUCK coordinates
Reply
#6

This is the kind of coding i hate, replace the following.

pawn Код:
if(GetProgressBarValue(LoadTruckBar[playerid]) > 10)
{                  
           SendClientMessageEx(playerid, COLOR_WHITE, "You are currently loading your Truck!");                          
           return 1;                
}                

if(TruckUsed[playerid] != INVALID_VEHICLE_ID)
{                    
            SendClientMessageEx(playerid, COLOR_WHITE, "You are already on another delivery, type /cancel truck to cancel that delivery.");                    
            return 1;              
}
Replace it with

pawn Код:
if(GetProgressBarValue(LoadTruckBar[playerid]) > 10) return SendClientMessageEx(playerid, COLOR_WHITE, "You are currently loading your Truck!");
if(TruckUsed[playerid] != INVALID_VEHICLE_ID) return  SendClientMessageEx(playerid, COLOR_WHITE, "You are already on another delivery, type /cancel truck to cancel that delivery.");
I know you understand it the way you currently have it but you've got un-needed lines that you could shorten and make into one line like the ones above, only replace it if you want too.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)