Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CMD:dropcrate(playerid, params[])
- {
- RemovePlayerAttachedObject(playerid, JOB_SLOT);
- SetPlayerSpecialAction(playerid, SPECIAL_ACTION_NONE);
- PlayerData[playerid][pLoading] = 0;
- return 1;
- }
- CMD:takecrate(playerid, params[])
- {
- if(PlayerData[playerid][pJob] != JOB_COURIER)
- return SendErrorMessage(playerid, "You don't have the appropriate job.");
- if(IsPlayerInAnyVehicle(playerid))
- return SendErrorMessage(playerid, "You must exit the vehicle first.");
- if(PlayerData[playerid][pLoading] == 1)
- return SendErrorMessage(playerid, "You still carry the crate");
- PlayerData[playerid][pLoading] = 1;
- ApplyAnimation(playerid, "CARRY", "liftup", 4.1, 0, 0, 0, 0, 0, 1);
- SetPlayerAttachedObject(playerid, JOB_SLOT, 3014, 1, 0.038192, 0.371544, 0.055191, 0.000000, 90.000000, 357.668670, 1.000000, 1.000000, 1.000000);
- SetPlayerSpecialAction(playerid, SPECIAL_ACTION_CARRY);
- return 1;
- }
- CMD:putcrate(playerid, params[])
- {
- for (new i = 1; i != MAX_VEHICLES; i ++) if (IsPlayerNearBoot(playerid, i))
- {
- if (CoreVehicles[i][vehLoadType] != 0 && CoreVehicles[i][vehLoadType] != PlayerData[playerid][pLoadType])
- return SendErrorMessage(playerid, "This vehicle is already loaded with something else.");
- if (CoreVehicles[i][vehLoads] >= 6)
- return SendErrorMessage(playerid, "This vehicle can only hold up to 6 crates.");
- if (IsLoadableVehicle(i))
- {
- ApplyAnimation(playerid, "CARRY", "putdwn", 4.0, 0, 0, 0, 0, 0);
- RemovePlayerAttachedObject(playerid, JOB_SLOT);
- SetPlayerSpecialAction(playerid, SPECIAL_ACTION_NONE);
- PlayerData[playerid][pLoading] = 0;
- CoreVehicles[i][vehLoads]++;
- CoreVehicles[i][vehLoadType] = PlayerData[playerid][pLoadType];
- return 1;
- }
- else
- {
- SendErrorMessage(playerid, "This car is not filled with crates");
- return 1;
- }
- }
- SendErrorMessage(playerid, "You arenot in range of loadable");
- return 1;
- }
- CMD:unloadcrate(playerid, params[])
- {
- new
- id = -1,
- vehid = GetPlayerVehicleID(playerid);
- if (PlayerData[playerid][pJob] != JOB_COURIER)
- return SendErrorMessage(playerid, "You don't have the appropriate job.");
- if(!IsLoadableVehicle(GetPlayerVehicleID(playerid)))
- return SendErrorMessage(playerid, "You must be in truck to use this action.");
- if (!CoreVehicles[vehid][vehLoadType] || CoreVehicles[vehid][vehLoads] < 1)
- return SendErrorMessage(playerid, "There is nothing loaded in this vehicle.");
- if(PlayerData[playerid][pSedangUnload] == 1)
- return SendErrorMessage(playerid, "Kamu sedang unload crate");
- if((id = Business_NearestDeliver(playerid)) != -1)
- {
- if (PlayerData[playerid][pShipment] != -1 && id != PlayerData[playerid][pShipment])
- return SendErrorMessage(playerid, "You didn't accept shipment for this business.");
- }
- PlayerData[playerid][pSedangUnload] = 1;
- TogglePlayerControllable(playerid, 0);
- PlayerData[playerid][pUnloadVehicle] = vehid;
- GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~r~Unloading crates...", 5000, 3);
- SetTimerEx("Unloadcourier", 5000, false, "dd", playerid, vehid);
- return 1;
- }
- function Unloadcourier(playerid, vehid)
- {
- PlayerData[playerid][pSedangUnload] = 0;
- TogglePlayerControllable(playerid, 1);
- CoreVehicles[PlayerData[playerid][pUnloadVehicle]][vehLoads] = 0;
- PlayerTextDrawHide(playerid, PlayerData[playerid][pTextdraws][82]);
- TruckingCheck[playerid] = 0;
- PlayerData[playerid][pDelayTruck] = 1;
- SendServerMessage(playerid, "You did it");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement