shourya90

Untitled

Jul 15th, 2019
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 3.30 KB | None | 0 0
  1. COMMAND:vieworders(playerid,params[])
  2. {
  3.    
  4.     if(pInfo[playerid][Class] != FARMER)
  5.         return ShowNotification(playerid,"Only a farmer can use this command");
  6.  
  7.  
  8.     new Ordertype = rand(1,5);
  9.     new orders = rand(5, 30);
  10.    
  11.     foreach(new i : FExports)
  12.     {
  13.         if(FExport[i][FexportPlayer] == pInfo[playerid][RealID])
  14.         {
  15.            
  16.             if(FExport[i][FexportTime] > 0)
  17.             {
  18.            
  19.                 foreach(new store : Stores)
  20.                 {
  21.                    
  22.                     if(FExport[i][FexportShop] == Store[store][StoreID])
  23.                     {
  24.                         printf("%d, %d", FExport[i][FexportShop], Store[store][StoreID]);
  25.                         return ShowFarmOrder(playerid, i);
  26.                     }
  27.                 }
  28.             }
  29.         }
  30.     }                  
  31.  
  32.     new i = Iter_Free(FExports);   
  33.            
  34.     FExport[i][FexportType] = Ordertype;
  35.     FExport[i][FexportQuan] = orders;
  36.     SetFarmOrder(playerid, i);
  37.  
  38.     return 1;
  39. }
  40.  
  41. ShowFarmOrder(playerid, i)
  42. {
  43.     new str[256];
  44.     if(FExport[i][FexportType] == 1)
  45.     {
  46.         format(str, 256, "{FFFFFF}Item to export: {FFFF66}%d Wheats\n{FFFFFF}To: {FFFF66}%s\n{FFFFFF}Location: {FFFF66}%s\n{FFFFFF}Time: {FFFF66}%s\n{FFFFFF}Click on {FFFF66}Cancel {FFFFFF}to cancel this order\nCancelation charges: {FFFF66}$5,000", FExport[i][FexportQuan], Store[FExport[i][FexportShop]][StoreName], Get3DZone(Store[FExport[i][FexportShop]][StoreX], Store[FExport[i][FexportShop]][StoreY], Store[FExport[i][FexportShop]][StoreZ]), strtime(FExport[i][FexportTime]));
  47.         Dialog_Show(playerid, DialogFarmcancel, DIALOG_STYLE_MSGBOX, "Available Orders", str, "Cancel", "close");
  48.     }
  49.     if(FExport[i][FexportType] == 2)
  50.     {
  51.         format(str, 256, "{FFFFFF}Item to export: {FFFF66}%d Corns\n{FFFFFF}To: {FFFF66}%s\n{FFFFFF}Location: {FFFF66}%s\n{FFFFFF}Time: {FFFF66}%s\n{FFFFFF}Click on {FFFF66}Cancel {FFFFFF}to cancel this order\nCancelation charges: {FFFF66}$5,000", FExport[i][FexportQuan], Store[FExport[i][FexportShop]][StoreName], Get3DZone(Store[FExport[i][FexportShop]][StoreX], Store[FExport[i][FexportShop]][StoreY], Store[FExport[i][FexportShop]][StoreZ]), strtime(FExport[i][FexportTime]));
  52.         Dialog_Show(playerid, DialogFarmcancel, DIALOG_STYLE_MSGBOX, "Available Orders", str, "Cancel", "close");
  53.     }
  54.     if(FExport[i][FexportType] == 3)
  55.     {
  56.         format(str, 256, "{FFFFFF}Item to export: {FFFF66}%d Carrot\n{FFFFFF}To: {FFFF66}%s\n{FFFFFF}Location: {FFFF66}%s\n{FFFFFF}Time: {FFFF66}%s\n{FFFFFF}Click on {FFFF66}Cancel {FFFFFF}to cancel this order\nCancelation charges: {FFFF66}$5,000", FExport[i][FexportQuan], Store[FExport[i][FexportShop]][StoreName], Get3DZone(Store[FExport[i][FexportShop]][StoreX], Store[FExport[i][FexportShop]][StoreY], Store[FExport[i][FexportShop]][StoreZ]), strtime(FExport[i][FexportTime]));
  57.         Dialog_Show(playerid, DialogFarmcancel, DIALOG_STYLE_MSGBOX, "Available Orders", str, "Cancel", "close");
  58.     }
  59.     if(FExport[i][FexportType] == 4)
  60.     {
  61.         format(str, 256, "{FFFFFF}Item to export: {FFFF66}%d Cotton\n{FFFFFF}To: {FFFF66}%s\n{FFFFFF}Location: {FFFF66}%s\n{FFFFFF}Time: {FFFF66}%s\n{FFFFFF}Click on {FFFF66}Cancel {FFFFFF}to cancel this order\nCancelation charges: {FFFF66}$5,000", FExport[i][FexportQuan], Store[FExport[i][FexportShop]][StoreName], Get3DZone(Store[FExport[i][FexportShop]][StoreX], Store[FExport[i][FexportShop]][StoreY], Store[FExport[i][FexportShop]][StoreZ]), strtime(FExport[i][FexportTime]));
  62.         Dialog_Show(playerid, DialogFarmcancel, DIALOG_STYLE_MSGBOX, "Available Orders", str, "Cancel", "close");
  63.     }
  64.     return 1;  
  65. }
Add Comment
Please, Sign In to add comment