Trucking job
#1

Hello.

How i do make trucking job of that....?

Like:
You are at Los Santos, then system takes out of job where is loading at LS and unloading at where (Like SF, Blueberry, or what).
Reply
#2

Try this

Command to load........
Quote:

if(strcmp(cmd, "/Loadmats", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pJob] == 24)
{
if(!IsPlayerInRangeOfPoint(playerid, 6, 2509.0718,-2120.6606,13.5469))//Write you coords here
{
SendClientMessage(playerid, COLOR_GREY,"You are not a at factory.");
}
if(GetPlayerState(playerid) == 2)
{
new vehicle = GetPlayerVehicleID(playerid);
if(IsModelATruck(vehicle))
{
TogglePlayerControllable(playerid, 0);
SendClientMessage(playerid, COLOR_GROVE,"Loading Materials please wait!");
SetPlayerCameraPos(playerid, 2509.0718,-2120.6606,13.5469);//camera pos while loading
SetPlayerCameraLookAt(playerid, 2517.7261,-2099.2830,13.5469);
SetTimer("LoadingMats", 10000, 0);//loading timer 10mins
}
}
return 1;
}
else
{
SendClientMessage(playerid, COLOR_GREY,"You are not a Trucker.");
}
return 1;
}
}

Funtion of loading
Quote:

At top : forward LoadingMats(playerid);
And

public LoadingMats(playerid)
{
new vehicle = GetPlayerVehicleID(playerid);
if(IsPlayerConnected(playerid))
{
SetCameraBehindPlayer(playerid);
TogglePlayerControllable(playerid, 1);
SendClientMessage(playerid, COLOR_GREY,"Materials loaded succesfully.");
GameTextForPlayer(playerid, "Deliver Mats Boxes to Red Mark", 5000, 3);
SetPlayerCheckpoint(playerid, -88.2457,-1591.1256,2.6172, 3.0);//change coords where u want check point
CarInfo[vehicle][Loaded] = 1;
}
return 1;
}

On Reach Checkpoint
Quote:

if(CarInfo[vehicle][Loaded] == 1)
{
if(PlayerInfo[playerid][pJob] == 24)
{
DisablePlayerCheckpoint(playerid);
PlayerPlaySound(playerid, 1056, 0.0, 0.0, 0.0);
SendClientMessage(playerid, COLOR_WHITE, "Factory give you 500 Dollars For 10 Mats Boxes.");
SafeGivePlayerMoney(playerid, 500);
CarInfo[vehicle][Loaded] = 0;
}
return 1;
}

You have to define Loaded in your CarInfo array.......
Reply
#3

-----------
Reply
#4

Use same coods and make coords u want .
Reply
#5

-----------
Reply
#6

-----------
Reply
#7

There is a nice include for truckingmissions by Blabla93
https://sampforum.blast.hk/showthread.php?tid=182789

Just set the startpos to the current pos. You could also add a OnPlayerTruckMissionFinished callback to automatically start the next one.
Reply
#8

So you would like when a player types in a command like /load he get's a random loading point and a random unloading point?
Reply
#9

-----------
Reply
#10

-----------
Reply
#11

Well if you use my system its capable of doing this... in the example script I posted with the random example using an enum set multiple ones for different county's and city's. Then set locations and check them so if there in Los Santos Load the Los Santos Random Mission enum that has all Loading Points in Los Santos

I hope this helps if not I'm sure I can right something up as an example on how to check what area there in then everything should be straight forward from there.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)