CMD:loadtruck(playerid, params[])
{
if(Work[playerid] == 0)
{
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 403)
{
if(IsTrailerAttachedToVehicle(GetPlayerVehicleID(playerid)))
{
SetPlayerCheckpoint(playerid, 2509.2415,-2077.5667,13.5469, 7.0);
SendClientMessage(playerid, COLOR_ORANGE, "INFO: {FFFFFF}go to the checkpoint in the map to Load your truck");
Work[playerid] = 1;
}
else return SendClientMessage(playerid, -1, "** you must have trailer to start job");
}
else return SendClientMessage(playerid, -1, "** you must in the truck");
}
else return SendClientMessage(playerid, -1, "** you are still in job");
return 1;
}
public OnPlayerEnterCheckpoint(playerid)
{
if(IsPlayerInRangeOfPoint(playerid, 3.0, 2509.2415,-2077.5667,13.5469)) // Load Truck Checkpoint
{
SetTimerEx("LoadMats", 5000, false, "i", playerid);
GameTextForPlayer(playerid, "~r~Loading Truck", 3000, 3);
TogglePlayerControllable(playerid, 1);
DisablePlayerCheckpoint(playerid);
}
for (new i; i != sizeof (TruckingUnload); ++i)
{
if(IsPlayerInRangeOfPoint(playerid, 7.0, TruckingUnload[i][0], TruckingUnload[i][1], TruckingUnload[i][2]))
{
GivePlayerMoney(playerid, 4000);
SendClientMessage(playerid, COLOR_ORANGE, "INFO: {FFFFFF}you have passed trucking job and get reward $4.000");
DisablePlayerCheckpoint(playerid);
Work[playerid] = 0;
break;
}
}
return 1;
}
public LoadMats(playerid)
{
new rand = random(sizeof(TruckingUnload));
SetPlayerCheckpoint(playerid, TruckingUnload[rand][0], TruckingUnload[rand][1], TruckingUnload[rand][2], 7.0);
SendClientMessage(playerid, COLOR_ORANGE, "INFO: {FFFFFF}Pergilah ke checkpoint yang berada di map");
TogglePlayerControllable(playerid, 0);
return 1;
}
new TruckLoadX[MAX_PLAYERS];
new TruckLoadY[MAX_PLAYERS];
new TruckLoadZ[MAX_PLAYERS];
TruckLoadX[playerid] = 0;
TruckLoadY[playerid] = 0;
TruckLoadZ[playerid] = 0;
public LoadMats(playerid)
{
new rand = random(sizeof(TruckingUnload));
TruckLoadX[playerid] = TruckingUnload[rand][0];
TruckLoadY[playerid] = TruckingUnload[rand][1];
TruckLoadZ[playerid] = TruckingUnload[rand][2];
SetPlayerCheckpoint(playerid, TruckLoadX[playerid],TruckLoadY[playerid],TruckLoadX[playerid], 7.0);
SendClientMessage(playerid, COLOR_ORANGE, "INFO: {FFFFFF}Pergilah ke checkpoint yang berada di map");
TogglePlayerControllable(playerid, 0);
return 1;
}
if(IsPlayerInRangeOfPoint(playerid, 7.0, TruckLoadX[playerid],TruckLoadY[playerid],TruckLoadZ[playerid]))
{
if(work[playerid] == 1)
{
GivePlayerMoney(playerid, 4000);
SendClientMessage(playerid, COLOR_ORANGE, "INFO: {FFFFFF}you have passed trucking job and get reward $4.000");
DisablePlayerCheckpoint(playerid);
Work[playerid] = 0;
return 1;
}
}
|
Okay, this is what I've done in the past.
some where: pawn Код:
pawn Код:
pawn Код:
pawn Код:
Might work, could try it, dunno. |
new Float:TruckingUnload[][3] =
{
{-64.7117,-1133.9790,1.0781},
{-19.0223,-278.8979,5.4297},
{1336.4464,289.4808,19.5615}
};