Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //-- Defining the player teams --//
- #define TEAM_TRUCKER 1
- //-- Making the mission things for trucker --//
- enum MisLocationsEnum
- {
- ID,
- LoadName[128],
- Float:LoadX,
- Float:LoadY,
- Float:LoadZ,
- Float:UnloadX,
- Float:UnloadY,
- Float:UnloadZ,
- Pay,
- TrailerID
- }
- //-- Defining the player work --//
- new work;
- //-- Defines for the truckers job or missions --//
- new MisLocations[][MisLocationsEnum] =
- {
- {0, "Beer from Red County Brewery to Bone County Diner",-24.4073,-281.8898,5.9985,-305.4319,1315.6797,54.6189, 5980, /*(GetVehicleModel(GetVehicleTrailer(GetPlayerVehicleID(playerid))) == 435)*/},
- {1, "Fuel from LV Oil Refinery to LV Dirtring",266.8981,1416.5417,10.2001,1097.5164,1741.7422,10.5474, 5700, /*(GetVehicleModel(GetVehicleTrailer(GetPlayerVehicleID(playerid))) == 584)*/},
- {2, "Vehicle Parts from SF Airport ATC to Wang Cars",-1268.8223,13.6925,14.8682,-1986.3477,253.9728,35.8985, 3000, /*(GetVehicleModel(GetVehicleTrailer(GetPlayerVehicleID(playerid))) == 435)*/},
- {3, "Fuel from SF Oil Refinery to RS Haul",-1016.3634,-688.2434,32.7284,-55.3397,-1138.2479,0.8052, 18770, /*(GetVehicleModel(GetVehicleTrailer(GetPlayerVehicleID(playerid))) == 584)*/},
- {4, "Trucking Job, Deliver the Goods",-1690.3000, -93.8587, 5.9922,-1878.6992, -1726.9730, 23.3750, 20770},
- {5, "Trucking Job, Deliver the Goods",-373.1002, -1053.5399, 57.8594,2349.0000, -1411.6610, 26.2266, 20770},
- {6, "Trucking Job, Deliver the Goods",2774.1663, -2401.0645, 14.1719,868.6686, -1233.7817, 17.6406, 20770},
- {7, "Trucking Job, Deliver the Goods",-1522.2748, -631.8068, 25.3359,-2326.2029, -172.0190, 34.6719, 20770},
- {8, "Trucking Job, Deliver the Goods",-2532.1748, -613.5323, 132.4539,-3384.3538, 224.6254, 24.2500, 20770},
- {9, "Trucking Job, Deliver the Goods",-3399.4221, 668.3398, 16.4000,-1491.2068, 2564.9553, 54.7266, 20770}
- };
- //-- Defines for trucker job to work --//
- new Float:unx[MAX_PLAYERS], Float:uny[MAX_PLAYERS], Float:unz[MAX_PLAYERS], iPay[MAX_PLAYERS], MissionStatus[MAX_PLAYERS];
- COMMAND:work(playerid, params[])
- {
- if (work == 0)
- {
- if(GetPlayerTeam(playerid) == TEAM_TRUCKER)
- {
- T_NewJob(playerid);
- }
- }
- else if (work == 1)
- {
- SendClientMessage(playerid,-1,"You're already managing an task. /stopwork to leave it.");
- }
- return 1;
- }
- CMD:stopwork(playerid, params[])
- {
- #pragma unused params
- if(GetPlayerTeam(playerid) == TEAM_TRUCKER) return StopClassWork(playerid);
- return 1;
- }
- //-- Stock to stop the player work --//
- stock StopClassWork(playerid)
- {
- DisablePlayerCheckpoint(playerid);
- SendClientMessage(playerid, COLOR_RED, "Your company was not happy from your work and gave you 1500$ fine.");
- work = 0;
- GivePlayerMoney(playerid, -1500);
- MissionStatus[playerid] = 0;
- return 1;
- }
- //-- Creating the stock for the trucker job. --//
- stock T_NewJob(playerid)
- {
- new vID = GetPlayerVehicleID(playerid);
- if(GetVehicleModel(vID)== 403 || GetVehicleModel(vID)== 515 || GetVehicleModel(vID) == 514)
- {
- if(IsTrailerAttachedToVehicle(vID))
- {
- MissionStatus[playerid] = 1;
- new MisRand = random(sizeof(MisLocations));
- new LoadText[128], Float:x, Float:y, Float:z;
- x = MisLocations[MisRand][LoadX];
- y = MisLocations[MisRand][LoadY];
- z = MisLocations[MisRand][LoadZ];
- unx[playerid] = MisLocations[MisRand][UnloadX];
- uny[playerid] = MisLocations[MisRand][UnloadY];
- unz[playerid] = MisLocations[MisRand][UnloadZ];
- iPay[playerid] = MisLocations[MisRand][Pay];
- SetPlayerCheckpoint(playerid, x, y, z, 7);
- // TextDrawShowForPlayer(playerid, Textdraw1);
- format(LoadText, 128, "%s",MisLocations[MisRand][LoadName]);
- work = 1;
- SendClientMessage(playerid, COLOR_GREEN, "Mission:");
- SendClientMessage(playerid, 0xFFFFFFFF, LoadText);
- // TextDrawHideForPlayer(playerid, msg1[playerid]);
- }
- else
- {
- SendClientMessage(playerid, COLOR_RED, "You need a trailer!");
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_RED, "You must be in a Truck to perform this!");
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement