Hi. i have a problem with second load gave out wrong information. like this one
Code:
Los Santos Warehouse to Military Aviation Fuel Depot
it should be Los Santos Warehouse to Los Santos Police Station
Code:
CMD:work(playerid, params[])
{
SendMessageToAdmins(playerid, "/work", params);
if (GetPlayerTeam(playerid) == 1)
{
new m = GetVehicleModel(GetPlayerVehicleID(playerid));
if(m == 455 || m == 515 || m == 403 || m == 514)
{
new t = GetVehicleModel(GetVehicleTrailer(GetPlayerVehicleID(playerid)));
if( m == 455 || t == 435 || t == 450 || t == 584 )
{
if (GetPlayerVehicleSeat(playerid) == 0)
{
new missionid = PlayerInfo[playerid][MissionID];
Trucker1(playerid);
PlayerInfo[playerid][MissionID] = missionid;
truck_PlayerJob[playerid] = 1;
//truckchecktime = SetTimerEx("TruckCheck", 1000, true, "i", giveplayerid);
}
else
{
SendClientMessage(playerid, WORK, "You are not the driver of this vehicle");
}
}
else
{
SendClientMessage(playerid, WORK, "You do not have a trailer, please go and ATTACH one!");
}
}
else
{
SendClientMessage(playerid, WORK, "You are not in a TRUCK, please go and get one!");
}
}
return 1;
}
Code:
static const trucker[][MissionData] =
{
// Template: {lx, ly, lz, lpname, loadname, ux, uy, uz, upname, cost},
// Dont include comma on last!!!!
{0, 2054.6843,1928.2374,12.1540, "Visage", "Fuel", 2492.5366,2773.2190,10.80422, "Military Aviation Fuel Depot", 1500},
{1, 2492.5366,2773.2190,10.80422, "Military Aviation Fuel Depot", "Fuel", 2054.6843,1928.2374,12.1540, "Visage", 2500},
{2, 2420.6235,-2464.2495,13.6250, "Los Santos Warehouse", "Weapons", 1538.4180,-1674.5314,13.5469, "Los Santos Police Station", 3000, false},
{3, 2244.0317,47.0715,26.4844, "General Store", "Food", 1931.9788,-1776.5302,13.3828, "Los Santos Gas Station", 3000},
{4, -2029.1902,-2403.2869,30.6250 , "Angel Pine Place", "Logs", 2208.2058,-2243.5767,13.5469, "Los Santos Warehouse", 3000, false}
};
Code:
forward Trucker1(playerid);
public Trucker1(playerid)
{
new WorkingBar[250];
new rand = random(sizeof(trucker));
//PlayerInfo[playerid][MissionID] = trucker[playerid][mission_id];
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, trucker[rand][lx], trucker[rand][ly], trucker[rand][lz], 7.5);
format(WorkingBar,sizeof(WorkingBar), "~w~Head to ~r~%s ~w~to load your trailer with ~y~%s", trucker[rand][lpname], trucker[rand][loadname]);
PlayerTextDrawSetString(playerid, work[playerid], WorkingBar);
}
forward Trucker2(playerid);
public Trucker2(playerid)
{
new LoadedWorkingBar[250];
printf("Trucker2 was called");
DisablePlayerCheckpoint(playerid);
TogglePlayerControllable(playerid, 1);
SetPlayerCheckpoint(playerid, trucker[playerid][ux], trucker[playerid][uy], trucker[playerid][uz], 7.5);
truck_PlayerJob[playerid] = 3;
format(LoadedWorkingBar,sizeof(LoadedWorkingBar), "~w~Now Head To ~r~%s ~w~To Unload The ~y~%s", trucker[playerid][ulpname], trucker[playerid][loadname]);
PlayerTextDrawSetString(playerid, work[playerid], LoadedWorkingBar);
}