Advertisement
Guest User

teleport_system by dionisak0s

a guest
Feb 13th, 2015
447
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 12.65 KB | None | 0 0
  1. #include <a_samp>
  2. #include <zcmd>
  3. #include <sscanf2>
  4.  
  5. #define         DIALOG_TELEPORT_MENU        1
  6. #define         DIALOG_GENERAL_STORE        2
  7. #define         DIALOG_AMMU_NATIONS         3
  8. #define         DIALOG_HOUSES               4
  9. #define         DIALOG_SHOPS                5
  10. #define         DIALOG_CLOTHING_STORES      6
  11. #define         DIALOG_MISCELLANIOUS        7
  12.  
  13. #define         COLOR_WHITE             0xFFFFFFFF
  14.  
  15. enum TeleportEnum
  16. {
  17.     telName[128],
  18.     Float:telPosX,
  19.     Float:telPosY,
  20.     Float:telPosZ,
  21.     telInt
  22. }
  23.  
  24. new GeneralStoreInteriors[6][TeleportEnum] =
  25. {
  26.     {"24/7 (Version 1)", -25.884498, -185.868988, 1003.546875, 17},
  27.     {"24/7 (Version 2)", 6.091179, -29.271898, 1003.549438, 10},
  28.     {"24/7 (Version 3)", -30.946699, -89.609596, 1003.546875, 18},
  29.     {"24/7 (Version 4)", -25.132598, -139.066986, 1003.54687, 16},
  30.     {"24/7 (Version 5)", -27.312299, -29.277599, 1003.557250, 4},
  31.     {"24/7 (Version 6)", -26.691598, -55.714897, 1003.546875, 6}
  32. };
  33.  
  34. new AmmuNationInteriors[7][TeleportEnum] =
  35. {
  36.     {"Ammu-Nation (Version 1)", 286.148986, -40.644397, 1001.515625, 1},
  37.     {"Ammu-Nation (Version 2)", 286.800994, -82.547599, 1001.515625, 4},
  38.     {"Ammu-Nation (Version 3)", 296.919982, -108.071998, 1001.515625, 6},
  39.     {"Ammu-Nation (Version 4)", 314.820983, -141.431991, 999.601562, 7},
  40.     {"Ammu-Nation (Version 5)", 316.524993, -167.706985, 999.593750, 6},
  41.     {"Ammu-Nation Booths", 302.292877, -143.139099, 1004.062500, 7},
  42.     {"Ammu-Nation Range", 298.507934,-141.647048,1004.054748, 7}
  43. };
  44.  
  45. new HouseInteriors[26][TeleportEnum] =
  46. {
  47.     {"Burglary House 1", 235.508994, 1189.169897, 1080.339966, 3},
  48.     {"Burglary House 2", 225.756989, 1240.000000, 1082.149902, 2},
  49.     {"Burglary House 3", 223.043991, 1289.259888, 1082.199951, 1},
  50.     {"Burglary House 4", 225.630997, 1022.479980, 1084.069946, 7},
  51.     {"Burglary House 5", 295.138977, 1474.469971,1080.519897, 15},
  52.     {"Burglary House 6", 328.493988, 1480.589966, 1084.449951, 15},
  53.     {"Burglary House 7", 385.803986, 1471.769897, 1080.209961, 15},
  54.     {"Denise's Room", 244.411987, 305.032989, 999.148437, 1},
  55.     {"Katie's Room", 271.884979, 306.631988, 999.148437, 2},
  56.     {"Helena's Room", 291.282989, 310.031982, 999.148437, 3},
  57.     {"Michelle's Room", 302.180999, 300.722991, 999.148437, 4},
  58.     {"Barbara's Room", 322.197998, 302.497985, 999.148437, 5},
  59.     {"Millie's Room", 346.870025, 309.259033, 999.155700, 6},
  60.     {"Johnson's House", 2496.65, -1696.55, 1014.74, 3},
  61.     {"Ryder's House", 2454.717041, -1700.871582, 1013.515197, 2},
  62.     {"Sweet's House", 2527.654052, -1679.388305, 1015.498596, 1},
  63.     {"Golden Bed Motel Room", 2251.85, -1138.16, 1050.63, 9},
  64.     {"Red Bed Motel Room", 2262.83, -1137.71, 1050.63, 10},
  65.     {"Hashbury House", 2260.76, -1210.45, 1049.02, 10},
  66.     {"Verdant Bluffs Safe House", 2365.42, -1131.85, 1050.88, 8},
  67.     {"Unused Safe House", 2324.33, -1144.79, 1050.71, 12},
  68.     {"Madd Dogg's Mansion", 1299.14, -794.77, 1084.00, 5},
  69.     {"Burning Desire", 2350.339843, -1181.649902, 1027.976562, 5},
  70.     {"Crack Den", 318.564971, 1118.209960, 1083.882812, 5},
  71.     {"Woozie's Apartment", -2159.122802, 641.517517, 1052.381713, 1},
  72.     {"Colonel Furhberger's", 2807.619873, -1171.899902, 1025.570312, 8}
  73. };
  74.  
  75. new Shops[14][TeleportEnum] =
  76. {
  77.     {"Sex Shop", -103.559165, -24.225606, 1000.718750, 3},
  78.     {"Zero's RC Shop", -2240.468505, 137.060440, 1035.414062, 6},
  79.     {"Ten Green Bottles", 501.980987, -69.150199, 998.757812, 11},
  80.     {"Lil' Probe Inn", -227.027999, 1401.229980, 27.765625, 18},
  81.     {"Jay's Dinner", 457.304748, -88.428497, 999.554687, 4},
  82.     {"Burger Shot", 375.962463, -65.816848, 1001.507812, 10},
  83.     {"Cluckin' Bell", 369.579528, -4.487294, 1001.858886, 9},
  84.     {"Pizza Stack", 373.825653, -117.270904, 1001.499511, 5},
  85.     {"Donut Shop", 381.169189, -188.803024, 1000.632812, 17},
  86.     {"Barber's Shop 1", 411.625976, -21.433298, 1001.804687, 2},
  87.     {"Barber's Shop 2", 418.652984, -82.639793, 1001.804687, 3},
  88.     {"Barber's Shop 3", 412.021972, -52.649898, 1001.898437, 12},
  89.     {"Tattoo Parlor", -204.439987, -26.453998, 1002.273437, 16},
  90.     {"Off Track Betting Shop", 833.269775, 10.588416, 1004.179687, 3}
  91. };
  92.  
  93. new ClothingStores[6][TeleportEnum] =
  94. {
  95.     {"Binco", 207.737991, -109.019996, 1005.132812, 15},
  96.     {"Didier Sachs", 204.332992,-166.694992,1000.523437, 14},
  97.     {"Pro-Laps", 207.054992,-138.804992,1003.507812, 3},
  98.     {"Sub-Urban", 203.777999, -48.492397, 1001.804687, 1},
  99.     {"Victim", 226.293991, -7.431529,1002.210937, 5},
  100.     {"ZIP", 161.391006, -93.159156, 1001.804687, 18}
  101. };
  102.  
  103. new Miscellanious[21][TeleportEnum] =
  104. {
  105.     {"Los Santos Police Department", 246.783996, 63.900199, 1003.640625, 6},
  106.     {"San Fierro Police Department", 246.375991, 109.245994, 1003.218750, 10},
  107.     {"Las Venturas Police Department", 288.745971, 169.350997, 1007.171875, 3},
  108.     {"Planning Department", 384.808624, 173.804992, 1008.382812, 3},
  109.     {"Ganton Gym", 772.111999, -3.898649, 1000.728820, 5},
  110.     {"Cobra Marital Arts Gym", 774.213989, -48.924297, 1000.585937, 6},
  111.     {"Below the Belt Gym", 773.579956, -77.096694, 1000.655029, 7},
  112.     {"Warehouse 1", 1412.639892, -1.787510, 1000.924377, 1},
  113.     {"Warehouse 2", 1302.519897, -1.787510, 1001.028259, 18},
  114.     {"Jefferson's Motel", 2215.454833, -1147.475585, 1025.796875, 15},
  115.     {"Meat Factory", 963.418762, 2108.292480, 1011.030273, 1},
  116.     {"Caligula's Casino", 2233.8032, 1712.2303, 1011.7632, 1},
  117.     {"4 Dragons Casino", 2016.2699, 1017.7790, 996.8750, 10},
  118.     {"Casino", 1118.8878, -10.2737, 1002.0859, 12},
  119.     {"Pleasure Domes", -2640.762939, 1406.682006, 906.460937, 3},
  120.     {"Atrium", 1710.433715, -1669.379272, 20.225049, 18},
  121.     {"Driving School", 1494.325195, 1304.942871, 1093.289062, 3},
  122.     {"RC Battlefield", -975.975708, 1060.983032, 1345.671875, 10},
  123.     {"Alhambra Club", 493.390991, -22.722799, 1000.679687, 17},
  124.     {"Sherman Dam", -959.564392, 1848.576782, 9.000000, 17},
  125.     {"Big Smoke's Crack Palace", 2543.462646, -1308.379882, 1026.728393, 2}
  126. };
  127.  
  128. CMD:interiors(playerid, params[])
  129. {
  130.     ShowPlayerDialog(playerid, DIALOG_TELEPORT_MENU, DIALOG_STYLE_LIST, "Teleport Menu", "24/7's\nAmmu-Nations\nHouses\nShops\nClothing Stores\nMiscellanious", "Select", "Back");
  131.     return 1;
  132. }
  133.  
  134. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  135. {
  136.     if(dialogid == DIALOG_TELEPORT_MENU)
  137.     {
  138.         if(response)
  139.         {
  140.             switch(listitem)
  141.             {
  142.                 case 0:
  143.                 {
  144.                     new string[512];
  145.                     for(new x;x<sizeof(GeneralStoreInteriors);x++)
  146.                     {
  147.                         format(string, sizeof(string), "%s%s\n", string, GeneralStoreInteriors[x][telName]);
  148.                     }
  149.                     ShowPlayerDialog(playerid, DIALOG_GENERAL_STORE, DIALOG_STYLE_LIST, "Teleport Menu - 24/7's", string, "Select", "Back");
  150.                 }
  151.                 case 1:
  152.                 {
  153.                     new string[512];
  154.                     for(new x;x<sizeof(AmmuNationInteriors);x++)
  155.                     {
  156.                         format(string, sizeof(string), "%s%s\n", string, AmmuNationInteriors[x][telName]);
  157.                     }
  158.                     ShowPlayerDialog(playerid, DIALOG_AMMU_NATIONS, DIALOG_STYLE_LIST, "Teleport Menu - Ammu-Nations", string, "Select", "Back");
  159.                 }
  160.                 case 2:
  161.                 {
  162.                     new string[512];
  163.                     for(new x;x<sizeof(HouseInteriors);x++)
  164.                     {
  165.                         format(string, sizeof(string), "%s%s\n", string, HouseInteriors[x][telName]);
  166.                     }
  167.                     ShowPlayerDialog(playerid, DIALOG_HOUSES, DIALOG_STYLE_LIST, "Teleport Menu - Houses", string, "Select", "Back");
  168.                 }
  169.                 case 3:
  170.                 {
  171.                     new string[512];
  172.                     for(new x;x<sizeof(Shops);x++)
  173.                     {
  174.                         format(string, sizeof(string), "%s%s\n", string, Shops[x][telName]);
  175.                     }
  176.                     ShowPlayerDialog(playerid, DIALOG_SHOPS, DIALOG_STYLE_LIST, "Teleport Menu - Shops", string, "Select", "Back");
  177.                 }
  178.                 case 4:
  179.                 {
  180.                     new string[512];
  181.                     for(new x;x<sizeof(ClothingStores);x++)
  182.                     {
  183.                         format(string, sizeof(string), "%s%s\n", string, ClothingStores[x][telName]);
  184.                     }
  185.                     ShowPlayerDialog(playerid, DIALOG_CLOTHING_STORES, DIALOG_STYLE_LIST, "Teleport Menu - Clothing Stores", string, "Select", "Back");
  186.                 }
  187.                 case 5:
  188.                 {
  189.                     new string[512];
  190.                     for(new x;x<sizeof(Miscellanious);x++)
  191.                     {
  192.                         format(string, sizeof(string), "%s%s\n", string, Miscellanious[x][telName]);
  193.                     }
  194.                     ShowPlayerDialog(playerid, DIALOG_MISCELLANIOUS, DIALOG_STYLE_LIST, "Teleport Menu - Miscellanious", string, "Select", "Back");
  195.                 }
  196.             }
  197.         }
  198.         return 1;
  199.     }
  200.     if(dialogid == DIALOG_GENERAL_STORE)
  201.     {
  202.         if(response)
  203.         {
  204.             new string[128];
  205.             SetPlayerPos(playerid, GeneralStoreInteriors[listitem][telPosX], GeneralStoreInteriors[listitem][telPosY], GeneralStoreInteriors[listitem][telPosZ]);
  206.             SetPlayerInterior(playerid, GeneralStoreInteriors[listitem][telInt]);
  207.             format(string, sizeof(string), "You have been teleported to %s.", GeneralStoreInteriors[listitem][telName]);
  208.             SendClientMessage(playerid, COLOR_WHITE, string);
  209.         }
  210.         else
  211.         {
  212.             ShowPlayerDialog(playerid, DIALOG_TELEPORT_MENU, DIALOG_STYLE_LIST, "Teleport Menu", "24/7's\nAmmu-Nations\nHouses\nShops\nClothing Stores\nMiscellanious", "Select", "Back");
  213.             return 1;
  214.         }
  215.     }
  216.     if(dialogid == DIALOG_AMMU_NATIONS)
  217.     {
  218.         if(response)
  219.         {
  220.             new string[128];
  221.             SetPlayerPos(playerid, AmmuNationInteriors[listitem][telPosX], AmmuNationInteriors[listitem][telPosY], AmmuNationInteriors[listitem][telPosZ]);
  222.             SetPlayerInterior(playerid, AmmuNationInteriors[listitem][telInt]);
  223.             format(string, sizeof(string), "You have been teleported to %s.", AmmuNationInteriors[listitem][telName]);
  224.             SendClientMessage(playerid, COLOR_WHITE, string);
  225.         }
  226.         else
  227.         {
  228.             ShowPlayerDialog(playerid, DIALOG_TELEPORT_MENU, DIALOG_STYLE_LIST, "Teleport Menu", "24/7's\nAmmu-Nations\nHouses\nShops\nClothing Stores\nMiscellanious", "Select", "Back");
  229.             return 1;
  230.         }
  231.     }
  232.     if(dialogid == DIALOG_HOUSES)
  233.     {
  234.         if(response)
  235.         {
  236.             new string[128];
  237.             SetPlayerPos(playerid, HouseInteriors[listitem][telPosX], HouseInteriors[listitem][telPosY], HouseInteriors[listitem][telPosZ]);
  238.             SetPlayerInterior(playerid, HouseInteriors[listitem][telInt]);
  239.             format(string, sizeof(string), "You have been teleported to %s.", HouseInteriors[listitem][telName]);
  240.             SendClientMessage(playerid, COLOR_WHITE, string);
  241.         }
  242.         else
  243.         {
  244.             ShowPlayerDialog(playerid, DIALOG_TELEPORT_MENU, DIALOG_STYLE_LIST, "Teleport Menu", "24/7's\nAmmu-Nations\nHouses\nShops\nClothing Stores\nMiscellanious", "Select", "Back");
  245.             return 1;
  246.         }
  247.     }
  248.     if(dialogid == DIALOG_SHOPS)
  249.     {
  250.         if(response)
  251.         {
  252.             new string[128];
  253.             SetPlayerPos(playerid, Shops[listitem][telPosX], Shops[listitem][telPosY], Shops[listitem][telPosZ]);
  254.             SetPlayerInterior(playerid, Shops[listitem][telInt]);
  255.             format(string, sizeof(string), "You have been teleported to %s.", Shops[listitem][telName]);
  256.             SendClientMessage(playerid, COLOR_WHITE, string);
  257.         }
  258.         else
  259.         {
  260.             ShowPlayerDialog(playerid, DIALOG_TELEPORT_MENU, DIALOG_STYLE_LIST, "Teleport Menu", "24/7's\nAmmu-Nations\nHouses\nShops\nClothing Stores\nMiscellanious", "Select", "Back");
  261.             return 1;
  262.         }
  263.     }
  264.     if(dialogid == DIALOG_CLOTHING_STORES)
  265.     {
  266.         if(response)
  267.         {
  268.             new string[128];
  269.             SetPlayerPos(playerid, ClothingStores[listitem][telPosX], ClothingStores[listitem][telPosY], ClothingStores[listitem][telPosZ]);
  270.             SetPlayerInterior(playerid, ClothingStores[listitem][telInt]);
  271.             format(string, sizeof(string), "You have been teleported to %s.", ClothingStores[listitem][telName]);
  272.             SendClientMessage(playerid, COLOR_WHITE, string);
  273.         }
  274.         else
  275.         {
  276.             ShowPlayerDialog(playerid, DIALOG_TELEPORT_MENU, DIALOG_STYLE_LIST, "Teleport Menu", "24/7's\nAmmu-Nations\nHouses\nShops\nClothing Stores\nMiscellanious", "Select", "Back");
  277.             return 1;
  278.         }
  279.     }
  280.     if(dialogid == DIALOG_MISCELLANIOUS)
  281.     {
  282.         if(response)
  283.         {
  284.             new string[128];
  285.             SetPlayerPos(playerid, Miscellanious[listitem][telPosX], Miscellanious[listitem][telPosY], Miscellanious[listitem][telPosZ]);
  286.             SetPlayerInterior(playerid, Miscellanious[listitem][telInt]);
  287.             format(string, sizeof(string), "You have been teleported to %s.", Miscellanious[listitem][telName]);
  288.             SendClientMessage(playerid, COLOR_WHITE, string);
  289.         }
  290.         else
  291.         {
  292.             ShowPlayerDialog(playerid, DIALOG_TELEPORT_MENU, DIALOG_STYLE_LIST, "Teleport Menu", "24/7's\nAmmu-Nations\nHouses\nShops\nClothing Stores\nMiscellanious", "Select", "Back");
  293.             return 1;
  294.         }
  295.     }
  296.     return 0;
  297. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement