Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //========Include
- #include <a_samp>
- #include <zcmd>
- //========enum
- enum cLoad
- {
- vObject,
- };
- new CLoad[MAX_VEHICLES][cLoad];
- //========NEW===
- new Float:Destinations[5][3] = {
- { 2401.7175,-1506.1350,23.5402 },
- { 1191.0847,-888.5489,42.7969 },
- { -69.6424,-1162.2354,1.5007 },
- { 334.1184,-1340.1366,14.2125 },
- { 481.7301,-1533.2468,19.6644 }
- };
- new InJob[MAX_PLAYERS];
- new CBox[MAX_PLAYERS];
- new CARJOB[10];
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print("Loading and transfer Script By Vinpure Loaded");
- print("--------------------------------------\n");
- CreateObject(1353, 131.60876, -312.07294, 10.40896, 0.00000, 0.00000, 0.00000);
- CreateObject(16075, 125.95828, -312.23090, 10.55951, 0.00000, 0.00000, -13.80000);
- CreateObject(1353, 110.25183, -312.44418, 14.06505, 0.00000, 0.00000, 0.00000);
- CreateObject(5259, 139.20663, -248.17480, 2.20197, 0.00000, 0.00000, 0.00000);
- CreateObject(5259, 135.70665, -243.32465, -2.28366, 0.00000, 0.00000, 0.00000);
- CreateObject(2912, 134.79820, -247.66443, 0.57190, 0.00000, 0.00000, 0.00000);
- CreateObject(3630, 130.28340, -248.94138, 0.57191, 0.00000, 0.00000, -90.12000);
- CreateObject(1431, 134.68222, -250.51930, 1.17033, 0.00000, 0.00000, 89.58002);
- CreateObject(2912, 134.68008, -248.66817, 0.51430, 0.00000, 0.00000, 0.00000);
- CreateObject(3402, 136.79509, -297.14508, 0.55466, 0.00000, 0.00000, -90.18002);
- CreateObject(16075, 136.29149, -297.68588, 2.52110, 0.36000, -3.12000, 73.92002);
- CARJOB[0] = AddStaticVehicleEx(414,102.7622,-291.0716,1.6719,356.1079,28,1,10); // car1
- CARJOB[1] = AddStaticVehicleEx(414,90.1440,-289.7167,1.6717,359.4936,28,1,10); // car2
- CARJOB[2] = AddStaticVehicleEx(414,78.6996,-290.0421,1.6718,358.5424,28,1,10); // car3
- CARJOB[3] = AddStaticVehicleEx(414,65.5257,-290.7251,1.6748,359.2201,28,1,10); // car4
- CARJOB[4] = AddStaticVehicleEx(414,52.1448,-290.3650,1.7921,359.7499,28,1,10); // car5
- CARJOB[5] = AddStaticVehicleEx(530,150.4664,-288.1756,1.3439,0.9100,111,1,10); // car6
- CARJOB[6] = AddStaticVehicleEx(530,153.6219,-287.9236,1.3436,2.9352,111,1,10); // car7
- CARJOB[7] = AddStaticVehicleEx(530,156.8793,-287.9218,1.3405,3.9752,111,1,10); // car8
- CARJOB[8] = AddStaticVehicleEx(530,156.2867,-277.7878,1.3399,181.0125,111,1,10); // car9
- CARJOB[9] = AddStaticVehicleEx(530,151.5143,-278.5036,1.3431,181.8579,111,1,10); // car10
- Create3DTextLabel("/getjob to join the job or /quitjob", 0x008080FF, 83.5783,-187.3263,1.5411, 10.0, 0, 0);
- Create3DTextLabel("/takebox to take one box", 0x008080FF, 133.3776,-249.7599,1.3426, 10.0, 0, 0);
- Create3DTextLabel("/putbox to put box to facory", 0x008080FF, 136.2264,-280.3665,1.3444, 10.0, 0, 0);
- return 1;
- }
- public OnFilterScriptExit()
- {
- print("\n--------------------------------------------");
- print("Loading and transfer Script By Vinpure UnLoaded");
- print("----------------------------------------------\n");
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- RemoveBuildingForPlayer(playerid, 12956, 96.3281, -261.1953, 3.8594, 0.25);
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- return 1;
- }
- stock IsAJobCar(carid)
- {
- if(carid == CARJOB[0] || carid == CARJOB[1] || carid == CARJOB[2]|| carid == CARJOB[3]|| carid == CARJOB[4]|| carid == CARJOB[5]|| carid == CARJOB[6]|| carid == CARJOB[7]|| carid == CARJOB[8]|| carid == CARJOB[9]) // Check if that's that vehicles
- {
- return 1;
- }
- return 0;
- }
- stock IsATruck(vehicleid) {
- switch(GetVehicleModel(vehicleid)) {
- case 414: return 1;
- }
- return 0;
- }
- CMD:getjob(playerid,params[])
- {
- if(IsPlayerInRangeOfPoint(playerid, 5.0,83.5783,-187.3263,1.5411))
- {
- SendClientMessage(playerid,-1,"You has join the job");
- InJob[playerid] = 1;
- CBox[playerid] = 10;
- }
- else
- {
- SetPlayerPos(playerid,83.5783,-187.3263,1.5411);//test
- }
- return 1;
- }
- CMD:quitjob(playerid,params[])
- {
- InJob[playerid] = 0;
- CBox[playerid] = -1;
- SendClientMessage(playerid,-1,"You has quit the job");
- return 1;
- }
- CMD:takebox(playerid,params[])
- {
- new pCar = GetPlayerVehicleID(playerid);
- if(InJob[playerid] != 1) return SendClientMessage(playerid,-1,"You no have job");
- if(GetVehicleModel(pCar) != 530) return SendClientMessage(playerid, 0xFFFFFF77, "You have to be in a Forklift! (CAR ID:530)");
- if(!IsPlayerInRangeOfPoint(playerid, 7.0,133.3776,-249.7599,1.3426)) return SendClientMessage(playerid, 0xFFFFFF77, "You are not at the correct place.");
- CLoad[pCar][vObject] = CreateObject(2912, 0, 0.9, -0.2, 0, 0, 0);
- AttachObjectToVehicle(CLoad[pCar][vObject], GetPlayerVehicleID(playerid), 0, 0.8, -0.1, 0, 0, 0 );
- return 1;
- }
- CMD:putbox(playerid,params[])
- {
- new pCar = GetPlayerVehicleID(playerid);
- if(InJob[playerid] != 1) return SendClientMessage(playerid,-1,"You no have job");
- if(GetVehicleModel(pCar) != 530) return SendClientMessage(playerid, 0xFFFFFF77, "You have to be in a Forklift! (CAR ID:530)");
- if(!IsPlayerInRangeOfPoint(playerid, 7.0,136.2264,-280.3665,1.3444)) return SendClientMessage(playerid, 0xFFFFFF77, "You are not at the correct place.");
- if(CBox[playerid] == 10)
- {
- DestroyObject(CLoad[pCar][vObject]);
- SendClientMessage(playerid, 0xFFFFFF77, "left 9 box");
- CBox[playerid] = 9;
- return 1;
- }
- if(CBox[playerid] == 9)
- {
- DestroyObject(CLoad[pCar][vObject]);
- SendClientMessage(playerid, 0xFFFFFF77, "left 8 box");
- CBox[playerid] = 8;
- return 1;
- }
- if(CBox[playerid] == 8)
- {
- DestroyObject(CLoad[pCar][vObject]);
- SendClientMessage(playerid, 0xFFFFFF77, "left 7 box");
- CBox[playerid] = 7;
- return 1;
- }
- if(CBox[playerid] == 7)
- {
- DestroyObject(CLoad[pCar][vObject]);
- SendClientMessage(playerid, 0xFFFFFF77, "left 6 box");
- CBox[playerid] = 6;
- return 1;
- }
- if(CBox[playerid] == 6)
- {
- DestroyObject(CLoad[pCar][vObject]);
- SendClientMessage(playerid, 0xFFFFFF77, "left 5 box");
- CBox[playerid] = 5;
- return 1;
- }
- if(CBox[playerid] == 5)
- {
- DestroyObject(CLoad[pCar][vObject]);
- SendClientMessage(playerid, 0xFFFFFF77, "left 4 box");
- CBox[playerid] = 4;
- return 1;
- }
- if(CBox[playerid] == 4)
- {
- DestroyObject(CLoad[pCar][vObject]);
- SendClientMessage(playerid, 0xFFFFFF77, "left 3 box");
- CBox[playerid] = 3;
- return 1;
- }
- if(CBox[playerid] == 3)
- {
- DestroyObject(CLoad[pCar][vObject]);
- SendClientMessage(playerid, 0xFFFFFF77, "left 2 box");
- CBox[playerid] = 2;
- return 1;
- }
- if(CBox[playerid] == 2)
- {
- DestroyObject(CLoad[pCar][vObject]);
- SendClientMessage(playerid, 0xFFFFFF77, "left 1 box");
- CBox[playerid] = 1;
- return 1;
- }
- if(CBox[playerid] == 1)
- {
- DestroyObject(CLoad[pCar][vObject]);
- SendClientMessage(playerid, 0xFFFFFF77, "Complete ,now you need go to the car mule to load truck {/loadtruck}");
- RemovePlayerFromVehicle(playerid);
- CBox[playerid] = 0;
- return 1;
- }
- if(CBox[playerid] == 0)
- {
- DestroyObject(CLoad[pCar][vObject]);
- SendClientMessage(playerid, 0xFFFFFF77, "You need go to the car mule now!");
- RemovePlayerFromVehicle(playerid);
- CBox[playerid] = 0;
- return 1;
- }
- return 1;
- }
- CMD:loadtruck(playerid,params[])
- {
- new pCar = GetPlayerVehicleID(playerid);
- if(InJob[playerid] != 1) return SendClientMessage(playerid,-1,"You no have job");
- if(GetVehicleModel(pCar) != 414) return SendClientMessage(playerid, 0xFFFFFF77, "You have to be in a Mule! (CAR ID:414)");
- if(CBox[playerid] == 0 )
- {
- new rand = random(sizeof(Destinations)); // defines the rand variable.
- SetPlayerCheckpoint(playerid, Destinations[rand][0], Destinations[rand][1], Destinations[rand][2], 5.0);
- }
- else
- {
- SendClientMessage(playerid,-1,"You need Complete take box and put box before load truck");
- }
- return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- InJob[playerid] = 0;
- CBox[playerid] = -1;
- return 1;
- }
- public OnVehicleSpawn(vehicleid)
- {
- return 1;
- }
- public OnVehicleDeath(vehicleid, killerid)
- {
- return 1;
- }
- public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
- {
- new Float:x,Float:y,Float:z;
- GetPlayerPos(playerid,x,y,z);
- if(IsAJobCar(vehicleid))
- {
- if(InJob[playerid] != 1) return SetPlayerPos(playerid,x,y,z),SendClientMessage(playerid, -1,"You are not a part of job.");
- }
- return 1;
- }
- public OnPlayerExitVehicle(playerid, vehicleid)
- {
- return 1;
- }
- public OnPlayerStateChange(playerid, newstate, oldstate)
- {
- return 1;
- }
- public OnPlayerEnterCheckpoint(playerid)
- {
- new pCar = GetPlayerVehicleID(playerid);
- if(GetVehicleModel(pCar) == 414)
- {
- if(IsPlayerInRangeOfPoint(playerid, 7.0,2401.7175,-1506.1350,23.5402 )||IsPlayerInRangeOfPoint(playerid, 7.0,1191.0847,-888.5489,42.7969)||IsPlayerInRangeOfPoint(playerid, 7.0, -69.6424,-1162.2354,1.5007)||IsPlayerInRangeOfPoint(playerid, 7.0,334.1184,-1340.1366,14.2125 )||IsPlayerInRangeOfPoint(playerid, 7.0, 481.7301,-1533.2468,19.6644))
- {
- DisablePlayerCheckpoint(playerid);
- SetPlayerCheckpoint(playerid,121.1767,-294.3844,1.1443,5.0);
- SendClientMessage(playerid,-1,"Come back the hq job for give money");
- }
- else if(IsPlayerInRangeOfPoint(playerid, 5.0,121.1767,-294.3844,1.1443))
- {
- CBox[playerid] = 10;
- DisablePlayerCheckpoint(playerid);
- SendClientMessage(playerid,-1,"Complete load truck for 100$");
- GivePlayerMoney(playerid,100);
- return 1;
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment