k2bi_YT

[FilterScript]: Interiores by: k2bi_YT

Jul 15th, 2021 (edited)
382
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 8.14 KB | None | 0 0
  1. //Sistema Basico para Listagem de Interiores
  2.  
  3. //By: k2bi_YT
  4.  
  5. #include <a_samp>
  6. #include <Pawn.CMD>
  7.  
  8. #define FILTERSCRIPT
  9. #if defined FILTERSCRIPT
  10.  
  11. public OnFilterScriptInit()
  12. {
  13.     print("\n\n***********************************************************\n");
  14.     print("|        By: k2bi_YT                     |");
  15.     print(" [FilterScript] Seleção de Interiores Carregado com sucesso!");
  16.     print("|        By: k2bi_YT                     |");
  17.     print("\n***********************************************************\n\n");
  18.     return 1;
  19. }
  20.  
  21. #define K2::%0(%1)         forward %0(%1);\
  22.                            public %0(%1)
  23.  
  24.  
  25. new Listagem[MAX_PLAYERS];
  26. enum FSInt
  27. {
  28.     InteriorName[50],
  29.     Float:X,
  30.     Float:Y,
  31.     Float:Z,
  32.     Interior,
  33.     Lista
  34. };
  35. new Interiores[][FSInt] =
  36. {
  37.     {"Kickstart Stadium", -1410.72,1591.16,1052.53, 14, 1},
  38.     {"Campo de Guerra", -1079.99,1061.58,1343.04, 10, 2},
  39.     {"Arena Cross", -1395.958,-208.197,1051.170, 7, 3},
  40.     {"Arena Bike", -1424.9319,-664.5869,1059.8585, 4, 4},
  41.     {"24/7 - 1", -25.9423, -185.9284, 1003.7457, 17, 5},
  42.     {"24/7 - 2", 5.7279, -30.1459, 1003.7467, 10, 6},
  43.     {"24/7 - 3", -30.9134, -91.2362, 1003.7469, 18, 7},
  44.     {"24/7 - 4", -25.8434, -140.4682, 1003.7463, 16, 8},
  45.     {"24/7 - 5", -27.3693, -30.2188, 1003.8464, 4, 9},
  46.     {"24/7 - 6", -27.3599, -57.0132, 1003.8460, 6, 10},
  47.     {"Ammu Nation SF", 285.4198, -40.0557, 1001.8151, 1, 11},
  48.     {"Ammu Nation LV", 286.1476, -84.7087, 1001.9285, 4, 12},
  49.     {"Ammu Nation Angel Pine SF", 296.8592, -110.7661, 1001.9582, 6, 13},
  50.     {"Ammu Nation 2 Andares", 315.5938, -142.6737, 999.8000, 7, 14},
  51.     {"Ammu Nation El Quebrados", 316.4774, -168.1234, 999.8909, 6, 15},
  52.     {"Ammu Nation Estande de Tiro", 302.292877, -143.139099, 1004.062500, 7, 16},
  53.     {"Conveniencia de Posto", 664.19,-570.73,16.34, 0, 17},
  54.     {"Rusty Brown's Donuts", 376.99,-191.21,1000.63, 17, 18},
  55.     {"Saida Aeroporto Internacional", -1830.81,16.83,1061.14, 14, 19},
  56.     {"Motel Jefferson", 2220.26,-1148.01,1025.80, 15, 20},
  57.     {"Bagagens Aero Porto Internacional", -1870.80, 59.81, 1056.25, 14, 21},
  58.     {"Casa do Ryder", 2451.77,-1699.80,1013.51, 2, 22},
  59.     {"Pub", 681.66,-453.32,-25.61, 1, 23},
  60.     {"Zero RC Shop", -2240.00,131.00,1035.40, 6, 24},
  61.     {"Tatto", -203.0764,-24.1658,1002.2734, 16, 25},
  62.     {"Burger Shot", 363.4129,-74.5786,1001.5078, 10, 26},
  63.     {"Well Stacked Pizza", 372.3520,-131.6510,1001.4922, 5, 27},
  64.     {"Cluckin' Bell", 365.7158,-9.8873,1001.8516, 9, 28},
  65.     {"Caligulas Casino", 2233.8032, 1712.2303, 1011.7632, 1, 29},
  66.     {"Casino", 1118.8878,-10.2737,1002.0859, 12, 30},
  67.     {"Four Dragons Casino", 2016.2699, 1017.7790, 996.8750, 10, 31},
  68.     {"Academia LS", 771.6130, -2.7349, 1000.8080, 5, 32},
  69.     {"Academia SF", 768.4251, -37.9545, 1000.9843, 6, 33},
  70.     {"Academia LV", 773.5867, -75.4854, 1000.9478, 7, 34},
  71.     {"Casa de Apostas", 833.3909, 7.3095, 1004.3746, 3, 35},
  72.     {"Motel", 963.5654, -53.0267, 1001.5135, 3, 36},
  73.     {"Motel 2", 941.4691, -16.2798, 1001.9398, 3, 37},
  74.     {"Puteiro", 1208.4030, -11.1789, 1001.9225, 2, 38},
  75.     {"Armazem", 1286.9550, -17.5530, 1002.9039, 0, 39},
  76.     {"Armazem Vazio", 1401.0801, -12.0454, 1002.8927, 1, 40},
  77.     {"Bar", 502.7398, -70.7305, 998.9508, 11, 41},
  78.     {"Balada", 488.0612, -15.3945, 1001.1556, 17, 42},
  79.     {"SubUrban", 204.7000, -45.4901, 1001.9353, 1, 43},
  80.     {"Binco", 207.8036, -106.5122, 1005.1501, 15, 44},
  81.     {"Pro-Laps", 206.8884, -136.3246, 1002.9662, 3, 45},
  82.     {"DS", 204.3314, -165.5309, 1000.6178, 14, 46},
  83.     {"ZIP", 161.7886, -94.2764, 1002.8009, 0, 47},
  84.     {"Victim", 225.8927, -8.4293, 1002.2307, 5, 48},
  85.     {"Loco Low LS", 616.7820,-74.8151, 997.6350, 2, 49},
  86.     {"Wheel Arch Angels", 615.2851,-124.2390,997.6350, 3, 50},
  87.     {"Transfender", 617.5380, -1.9900, 1000.6829, 1, 51},
  88.     {"Casa 1", 235.4227, 1187.9962, 1080.3564, 3, 52},
  89.     {"Casa 2", 225.1174, 1240.1389, 1082.5353, 2, 53},
  90.     {"Casa 3", 223.2494, 1288.4028, 1082.5355, 1, 54},
  91.     {"Casa 4", 225.6445, 1023.8162, 1084.5031, 7, 55},
  92.     {"Casa 5", 295.3956, 1474.2166, 1080.4376, 15, 56},
  93.     {"Casa 6", 328.0774, 1479.3639, 1084.6354, 15, 57},
  94.     {"Casa 7", 385.4252, 1471.6716, 1080.5425, 15, 58},
  95.     {"Casa 8", 380.9062, 1466.2152, 1080.1829, 15, 59},
  96.     {"Casa 9", 446.9320, 1400.8756, 1084.3019, 2, 60},
  97.     {"Casa 10", 446.3732, 509.0471, 1001.4163, 12, 61},
  98.     {"Casa 11", 295.5905, 1478.4093, 1080.2583, 15, 62},
  99.     {"Casa 12", 139.3309, 1368.9408, 1083.8602, 5, 63},
  100.     {"Casa 13", 84.4217, 1323.7705, 1083.8611, 9, 64},
  101.     {"Casa 14", 24.4360, 1341.8451, 1084.3688, 10, 65},
  102.     {"Casa 15", -68.9299, 1353.0726, 1080.2123, 6, 66},
  103.     {"House +18", 745.7979, 1440.9464, 1102.7001, 6, 67},
  104.     {"Casa 17", 234.6448, 1066.9340, 1084.2025, 6, 68},
  105.     {"Casa 18", 229.7284, 1114.4078, 1080.9872, 5, 69},
  106.     {"Quarto Golden Bed Motel", 2251.5356, -1139.0465, 1050.8318, 9, 70},
  107.     {"Hashbury House", 2260.5166, -1210.0226, 1049.5371, 10, 71},
  108.     {"Johnsons House", 2496.1089, -1694.0446, 1014.9439, 3, 72},
  109.     {"Mansao Madd Doggs", 1298.8080, -794.7337, 1084.2444, 5, 73},
  110.     {"Quarto Red Bed Motel", 2261.0967, -1136.2394, 1050.8322, 10, 74},
  111.     {"Verdant Bluffs Safehouse", 2365.3169, -1134.3051, 1051.7450, 8, 75},
  112.     {"Casa Segura Nao Usada", 2324.6868, -1146.9592, 1050.9134, 12, 76},
  113.     {"Casa Queimada", 2350.6614, -1180.9188, 1028.5739, 5, 77},
  114.     {"Casa Tio Sam", 2807.63,-1170.15, 1025.57, 8, 78},
  115.     {"Palacio Jizzy's", -2637.69,1404.24,906.46, 3, 79},
  116.     {"Garagem San Fierro",  -2042.42,178.59,28.84, 1, 80},
  117.     {"Casa do Sweets", 2535.83,-1674.32,1015.50, 1, 81},
  118.     {"Apartamento Woozies", -2158.72,641.29,1052.38, 1, 82},
  119.     {"Casa de Crack", 318.565,1115.210,1082.98, 5, 83},
  120.     {"Quarto Pequeno", 247.2933, 303.7934, 999.1485, 1, 84},
  121.     {"Quarto Pequeno 2", 269.9006, 304.4876, 999.1475, 2, 85},
  122.     {"Celeiro", 291.4038, 310.0945, 999.1482, 3, 86},
  123.     {"Fazenda", 302.1178, 309.0974, 1003.2997, 4, 87},
  124.     {"Quarto Sexual", 347.4583, 308.7669, 999.1468, 8},
  125.     {"Departamento SF", 246.40,110.84,1003.22, 10, 89},
  126.     {"Departamento LS", 246.8182, 64.2112, 1003.6406, 6, 90},
  127.     {"Departamento LV", 238.7373, 141.8880, 1003.0234, 3, 91},
  128.     {"Departamento Geral", 366.1646, 174.2116, 1008.3804, 3, 92},
  129.     {"Departamento LV", 321.6228, 304.6485, 999.1475, 5, 93}
  130. };
  131.  
  132. public OnPlayerSpawn(playerid)
  133. {
  134.     SendClientMessage(playerid, 0xFFFF0AAA, "[FS Interiores]: Para ver todos os interiores disponíveis, use: /interiores.");
  135.     SendClientMessage(playerid, 0xFFFF0AAA, "[FS Interiores]: Para salvar o interior, use: /sinterior.");
  136.     Listagem[playerid] = 0;
  137.     return 1;
  138. }
  139.  
  140. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  141. {
  142.     if(newkeys & KEY_YES)
  143.     {
  144.         if(Listagem[playerid])
  145.         {
  146.             Listagem[playerid]++;
  147.             ProxList(playerid);
  148.         }
  149.     }
  150.     if(newkeys & KEY_NO)
  151.     {
  152.         if(Listagem[playerid])
  153.         {
  154.             Listagem[playerid]--;
  155.             ProxList(playerid);
  156.         }
  157.     }
  158.     return 1;
  159. }
  160.  
  161. K2::ProxList(playerid)
  162. {
  163.     new i = Listagem[playerid], str[128];
  164.     switch(Listagem[playerid])
  165.     {
  166.         case 1..93:
  167.         {
  168.             SetPlayerPos(playerid, Interiores[i][X], Interiores[i][Y], Interiores[i][Z]);
  169.             SetPlayerInterior(playerid, Interiores[i][Interior]);
  170.             format(str, sizeof(str), "Nome: %s  |  Interior ID: %d", Interiores[i][InteriorName], Interiores[Listagem[playerid]][Interior]);
  171.             SendClientMessage(playerid, 0x4CEA9BAA, str);  
  172.         }
  173.         default:
  174.         {
  175.             Listagem[playerid] = 0;
  176.             SetPlayerPos(playerid, 2489.6042, -1667.4849, 13.9405);
  177.             SetPlayerInterior(playerid, 0);
  178.             SetPlayerVirtualWorld(playerid, 0);
  179.             SendClientMessage(playerid, 0x4CEA9BAA, "Erro ao tentar conectar com o próximo interior.");
  180.         }
  181.     }
  182.     return 1;
  183. }
  184.  
  185. CMD:sinterior(playerid)
  186. {
  187.     if(Listagem[playerid] > 1 && Listagem[playerid] < 94)
  188.     {
  189.         new str[256];
  190.         new i = Listagem[playerid];
  191.         format(str, sizeof(str), "Int Nome: %s  |  Interior ID: %d  |  Coord: %f, %f, %f", Interiores[i][InteriorName],
  192.         Interiores[i][Interior], Interiores[i][X], Interiores[i][Y], Interiores[i][Z]);
  193.         SInteriores(str);
  194.         SendClientMessage(playerid, 0xF07F0EAA, "Interior salvo com sucesso!");
  195.         return 1;
  196.     }
  197.     return 1;
  198. }
  199.  
  200. CMD:interiores(playerid)
  201. {
  202.     Listagem[playerid] = 1;
  203.     ProxList(playerid);
  204.     return 1;
  205. }
  206.  
  207. stock SInteriores(const string[])
  208. {
  209.     new entry[256], strlog[128];
  210.     format(entry, sizeof(entry), "%s\r\n",string);
  211.     new File:hFile;
  212.     format(strlog, sizeof strlog, "Interiores.ini");
  213.     hFile = fopen(strlog, io_append);
  214.     fwrite(hFile, entry);
  215.     fclose(hFile);
  216.     return 0;
  217. }
  218.  
  219.  #endif
Add Comment
Please, Sign In to add comment