Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- COMMAND:vieworders(playerid,params[])
- {
- if(pInfo[playerid][Class] != FARMER)
- return ShowNotification(playerid,"Only a farmer can use this command");
- new Ordertype = rand(1,5);
- new orders = rand(5, 30);
- foreach(new i : FExports)
- {
- if(FExport[i][FexportPlayer] == pInfo[playerid][RealID])
- {
- if(FExport[i][FexportTime] > 0)
- {
- foreach(new store : Stores)
- {
- if(FExport[i][FexportShop] == Store[store][StoreID])
- {
- printf("%d, %d", FExport[i][FexportShop], Store[store][StoreID]);
- return ShowFarmOrder(playerid, i);
- }
- }
- }
- }
- }
- new i = Iter_Free(FExports);
- FExport[i][FexportType] = Ordertype;
- FExport[i][FexportQuan] = orders;
- SetFarmOrder(playerid, i);
- return 1;
- }
- ShowFarmOrder(playerid, i)
- {
- new str[256];
- if(FExport[i][FexportType] == 1)
- {
- 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]));
- Dialog_Show(playerid, DialogFarmcancel, DIALOG_STYLE_MSGBOX, "Available Orders", str, "Cancel", "close");
- }
- if(FExport[i][FexportType] == 2)
- {
- 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]));
- Dialog_Show(playerid, DialogFarmcancel, DIALOG_STYLE_MSGBOX, "Available Orders", str, "Cancel", "close");
- }
- if(FExport[i][FexportType] == 3)
- {
- 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]));
- Dialog_Show(playerid, DialogFarmcancel, DIALOG_STYLE_MSGBOX, "Available Orders", str, "Cancel", "close");
- }
- if(FExport[i][FexportType] == 4)
- {
- 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]));
- Dialog_Show(playerid, DialogFarmcancel, DIALOG_STYLE_MSGBOX, "Available Orders", str, "Cancel", "close");
- }
- return 1;
- }
Add Comment
Please, Sign In to add comment