22.03.2014, 13:51
pawn Код:
stock T_NewJob(playerid)
{
new vID = GetPlayerVehicleID(playerid), string[2000];
if(GetVehicleModel(vID)== 403 || GetVehicleModel(vID)== 515 || GetVehicleModel(vID) == 514)
{
if(IsTrailerAttachedToVehicle(vID))
{
if(GetVehicleModel(GetVehicleTrailer(vID)) == 435)
{
if(PlayerInfo[playerid][pConvoy] > 0)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(PlayerInfo[i][pConvoy] == PlayerInfo[playerid][pConvoy])
{
MissionStatus[i] = 1;
new MisRand = random(sizeof(MisLocationsCargo));
new LoadText[128], MissionText[128], Float:x, Float:y, Float:z;
x = MisLocationsCargo[MisRand][LoadX];
y = MisLocationsCargo[MisRand][LoadY];
z = MisLocationsCargo[MisRand][LoadZ];
unx[i] = MisLocationsCargo[MisRand][UnloadX];
uny[i] = MisLocationsCargo[MisRand][UnloadY];
unz[i] = MisLocationsCargo[MisRand][UnloadZ];
iPay[i] = MisLocationsCargo[MisRand][Pay];
SetPlayerCheckpoint(i, x, y, z, 7);
format(LoadText, 128, "%s", MisLocationsCargo[MisRand][LoadName]);
format(MissionText, 128, "~w~%s", MisLocationsCargo[MisRand][LoadName]);
PlayerInfo[i][pWork] = 1;
format(string, 2000, "{259400}Mission: {FFFFFF}%s", LoadText);
SendClientMessage(i, 0xFFFFFFFF, string);
PlayerTextDrawSetString(i, Mission[i], MissionText);
}
}
}
else
{
MissionStatus[playerid] = 1;
new MisRand = random(sizeof(MisLocationsCargo));
new LoadText[128], MissionText[128], Float:x, Float:y, Float:z;
x = MisLocationsCargo[MisRand][LoadX];
y = MisLocationsCargo[MisRand][LoadY];
z = MisLocationsCargo[MisRand][LoadZ];
unx[playerid] = MisLocationsCargo[MisRand][UnloadX];
uny[playerid] = MisLocationsCargo[MisRand][UnloadY];
unz[playerid] = MisLocationsCargo[MisRand][UnloadZ];
iPay[playerid] = MisLocationsCargo[MisRand][Pay];
SetPlayerCheckpoint(playerid, x, y, z, 7);
format(LoadText, 128, "%s", MisLocationsCargo[MisRand][LoadName]);
format(MissionText, 128, "~w~%s", MisLocationsCargo[MisRand][LoadName]);
PlayerInfo[playerid][pWork] = 1;
format(string, 2000, "{259400}Mission: {FFFFFF}%s", LoadText);
SendClientMessage(playerid, 0xFFFFFFFF, string);
PlayerTextDrawSetString(playerid, Mission[playerid], MissionText);
}
}
else
{
SendClientMessage(playerid, -1, "You are not pulling a correct type of trailer");
}
}
else
{
SendClientMessage(playerid, COLOR_RED, "Error: You must attach a trailer to your truck or the trailer attached is not used for job.");
}
}
else
{
SendClientMessage(playerid, COLOR_RED, "Error: You must be in a truck to perform this!");
}
return 1;
}