daily pastebin goal
20%
SHARE
TWEET

Untitled

a guest Mar 19th, 2018 65 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. if(pData[playerid][pJob] == 2 && pTemp[playerid][pTruckID] != INVALID_VEHICLE_ID && GetPlayerState(playerid) == PLAYER_STATE_DRIVER && pTemp[playerid][pTruckWagonID] != INVALID_VEHICLE_ID)
  2.             {
  3.                 new vehicleid = GetPlayerVehicleID(playerid);
  4.                 if(!IsTrailerAttachedToVehicle(vehicleid))
  5.                 {
  6.                     SendClientMessage(playerid,CRED,"Вы потеряли прицеп. Заказ аннулирован");
  7.                     if(IsValid3DTextLabel(pTemp[playerid][pTruckWagonText])) DestroyDynamic3DTextLabelEx(pTemp[playerid][pTruckWagonText]);
  8.                     if(pTemp[playerid][pTruckWagonID] != INVALID_VEHICLE_ID) DestroyVehicle(pTemp[playerid][pTruckWagonID]);
  9.                     pTemp[playerid][pTruckWagonID] = INVALID_VEHICLE_ID;
  10.                     pTemp[playerid][pTruckWagonTime] = 0;
  11.                     pTemp[playerid][pTruckWeight] = 0;
  12.                     pTemp[playerid][pTruckLoadID] = 0;
  13.                 }
  14.                 new amount = floatround(pTemp[playerid][pTruckWeight]/100.0);
  15.                 new loadid = pTemp[playerid][pTruckLoadID];
  16.                 new price = amount*gTruckUnloadPrice[loadid];
  17.                 new vbis = price/10;
  18.                 new another;
  19.                 another = (!loadid) ? 1:0;
  20.                 new award = 0;
  21.                 if(!gGunWorkWH[another])  gGunWorkWH[another] = 1;
  22.                 if(gGunWorkWH[another] < gGunWorkWH[loadid]) award = floatround(price / 10.0 * (1 - (float(gGunWorkWH[loadid]) / gGunWorkWH[another])));
  23.                 new mes[128];
  24.                 format(mes,sizeof(mes),"%d кг груза было продано за {"#cGREEN"}$%d.В кассу бизнеса было добавлено: %d$.",amount*100,price,vbis);
  25.                 SendClientMessage(playerid,CWHITE,mes);
  26.                 if(award > 0)
  27.                 {
  28.                     format(mes,sizeof(mes),"Премия за дифицитный груз: {"#cGREEN"}$%d",award);
  29.                     SendClientMessage(playerid,CWHITE,mes);
  30.                     price += award;
  31.                 }
  32.                 pData[playerid][pMoney] += price;
  33.                 gGunWorkWH[loadid] += pTemp[playerid][pTruckWeight];
  34.                 pData[playerid][pTruckSkill] +=  pTemp[playerid][pTruckWeight];
  35.                 UpdatePlayerData(playerid,"truckskill",pData[playerid][pTruckSkill]);
  36.                 if(IsValid3DTextLabel(pTemp[playerid][pTruckWagonText])) DestroyDynamic3DTextLabelEx(pTemp[playerid][pTruckWagonText]);
  37.                 DetachTrailerFromVehicle(vehicleid);
  38.                 DestroyVehicle(pTemp[playerid][pTruckWagonID]);
  39.                 gBusiness[51][busiBank] += vbis;
  40.                 UpdateBusinessData(51,"bank",gBusiness[51][busiBank]);
  41.                 pTemp[playerid][pTruckWagonID] = INVALID_VEHICLE_ID;
  42.                 pTemp[playerid][pTruckWagonTime] = 0;
  43.                 pTemp[playerid][pTruckWeight] = 0;
  44.                 pTemp[playerid][pTruckLoadID] = 0;
  45.                 SetPVarInt(playerid,"informed",0);
  46.             }
RAW Paste Data
Top