Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * Sasino's Los Angeles Real Life Roleplay v1
- *
- * AUTORE: [GF]Sasino97
- */
- /*******************************************************[ SLARP HOUSES ]*******************************************************/
- #include <a_samp> //GRAZIE ALLA SA-MP TEAM
- #include <SII> //GRAZIE A [DRuG]Slick PER "Slick's INI Include (SII)"
- #define FILTERSCRIPT
- #define INVALID_HOUSE_ID -255 //Usa Un Qualsiasi Numero Negativo Per Questo (Default -255)
- #define MAX_HOUSES 100 //Massimo Case
- #define MAX_BUSINESSES 100 //Massimo Negozi
- #define HOUSE_FILE "SlarpHouses/Houses/HouseID%d.ini" //Se Vuoi Cambia Percorso, Ma Non Rimuovere %d.ini
- #define BIZ_FILE "SlarpHouses/Stores/BizID%d.ini" //Se Vuoi Cambia Percorso, Ma Non Rimuovere %d.ini
- #define COSTO_MERCI 100 //$/Merce
- #define PRINT_HOUSES //Metti Due Barre Davanti Se Non Vuoi Che Si Stampino Le Azioni Delle Case E Dei Negozi
- #define KEY_ENTER_PROPERTY KEY_SPRINT //Cambia Questo Con Il Tasto Che Preferisci Si Usi Per Entrare/Uscire(Default Mouse Cen).
- #define DIALOG_FORSALE_HOUSE 1500 //Non Usare 2 ID Uguali Per I Dialoghi!
- #define DIALOG_OTHERS_HOUSE 1501
- #define DIALOG_FORSALE_STORE 1504
- #define DIALOG_MY_HOUSE 1502
- #define DIALOG_SELL_HOUSE 1503
- #define DIALOG_OTHERS_STORE 1505
- #define DIALOG_MY_STORE 1506
- #define DIALOG_SELL_STORE 1507
- #define DIALOG_RENAME_STORE 1508
- #define DIALOG_MAIN_STORAGE 1509
- #define DIALOG_DEPOSIT_MONEY 1510
- #define DIALOG_WITHDRAW_MONEY 1511
- #define DIALOG_DEPOSIT_WEAPONS 1512
- #define DIALOG_WITHDRAW_WEAPONS 1513
- #define DIALOG_ORDER_GOODS 1514
- forward AddBusinessMoney(bizid, money);
- forward SaveHouseAndStoreInformation();
- new HousePickup[MAX_HOUSES];
- new BizPickup[MAX_BUSINESSES];
- new LastHouse[MAX_PLAYERS];
- enum StorageInfo
- {
- sMoney,
- Weap0,
- Ammo0,
- Weap1,
- Ammo1,
- Weap2,
- Ammo2,
- Weap3,
- Ammo3,
- Weap4,
- Ammo4,
- Weap5,
- Ammo5,
- Weap6,
- Ammo6,
- Weap7,
- Ammo7,
- Weap8,
- Ammo8,
- Weap9,
- Ammo9,
- Weap10,
- Ammo10,
- Weap11,
- Ammo11,
- Weap12,
- Ammo12,
- }
- new sInfo[MAX_HOUSES][StorageInfo];
- enum HouseInfo
- {
- Name[24],
- Cost,
- Sell,
- Interior,
- Exterior,
- VirtualWorld,
- Locked,
- Float:InteriorX,
- Float:InteriorY,
- Float:InteriorZ,
- Float:ExteriorX,
- Float:ExteriorY,
- Float:ExteriorZ,
- }
- new hInfo[MAX_HOUSES][HouseInfo];
- enum BusinessInfo
- {
- bName[24],
- bTitle[51],
- bCost,
- bSell,
- bInterior,
- bVirtualWorld,
- bLocked,
- bCashRegister,
- bRifornimenti,
- bEnter,
- Float:bInteriorX,
- Float:bInteriorY,
- Float:bInteriorZ,
- Float:bExteriorX,
- Float:bExteriorY,
- Float:bExteriorZ,
- }
- new bInfo[MAX_BUSINESSES][BusinessInfo];
- public OnFilterScriptInit()
- {
- print("\n-------------FILTERSCRIPT-----------------");
- print(" SLARP - Gamemode di [GF]Sasino97 - 2011 ");
- print("------------------------------------------\n");
- //CASE
- /*LOS ANGELES*/
- /*
- 0 CreateSlarpObject(14714, 1500.8342, -1723.4686, -50.3142, 0.0000, 0.0000, 0.0000, STREAM_DISTANCE); //Piani: 1. Corridoio a L, tre stanze con tappeto, una con parquet e una con mattonelle.
- 1 CreateSlarpObject(14700, 1550.8342, -1723.4686, -50.3142, 0.0000, 0.0000, 0.0000, STREAM_DISTANCE); //Piani: 1. Breve corridoio, tre stanze con tappeto e 2 con mattonelle.
- 2 CreateSlarpObject(14711, 1600.8342, -1723.4686, -50.3142, 0.0000, 0.0000, 0.0000, STREAM_DISTANCE); //Piani: 1. Corridoio a L, 1 salotto una stanza e una cucina.
- 3 CreateSlarpObject(14701, 1650.8342, -1723.4686, -50.3142, 0.0000, 0.0000, 0.0000, STREAM_DISTANCE); //Piani: 1. Corridoio a L, 3 stanze parquet, 2 mattonelle.
- 4 CreateSlarpObject(14710, 1700.8342, -1723.4686, -50.3142, 0.0000, 0.0000, 0.0000, STREAM_DISTANCE); //Piani: 1. Corridoio a mezza svastica, 4 stanze di differenti dimensioni.
- 5 CreateSlarpObject(14712, 1750.8342, -1723.4686, -50.3142, 0.0000, 0.0000, 0.0000, STREAM_DISTANCE); //Piani: 1. Entrata in salotto con tappeto, cucina e bagno con mattonelle, stanza da letto con tappeto.
- 6 CreateSlarpObject(14708, 1800.8342, -1723.4686, -50.3142, 0.0000, 0.0000, 0.0000, STREAM_DISTANCE); //Piani: 2. Corridoio a I, 4 stanze con parquet, due con mattonelle.
- 7 CreateSlarpObject(14707, 1850.8342, -1723.4686, -50.3142, 0.0000, 0.0000, 0.0000, STREAM_DISTANCE); //Piani: 2. 2 Corridoi, uno a I e uno a L, 2 stanze parquet grandi, 2 parquet piccole e 2 mattonellate.
- 8 CreateSlarpObject(14758, 1900.8342, -1723.4686, -50.3142, 0.0000, 0.0000, 0.0000, STREAM_DISTANCE); //Piani: 2. Casa che uso io al momento.
- 9 CreateSlarpObject(14754, 1950.8342, -1723.4686, -50.3142, 0.0000, 0.0000, 0.0000, STREAM_DISTANCE); //Piani: 2. Corridoio a I. 2 camere parquet, una mattonelle grande e 2 piccole.
- 10 CreateSlarpObject(14750, 2000.8342, -1723.4686, -50.3142, 0.0000, 0.0000, 0.0000, STREAM_DISTANCE); //Piani: 2. Corridoio a I. Salotto e altre 3 stanze in parquet, un bagno in mattonelle.
- */
- CreateHouse(0, 2249.9990, -1238.4978, 25.8984, 1550.7722, -1726.3321, -50.8142, 55000, 50000, 1, 0, 0);//Case normali
- CreateHouse(1, 822.3635,-1504.9675,14.3474, 1753.8463, -1729.9902, -50.8845, 200000, 150000, 1, 0, 0);// *
- CreateHouse(2, 2579.5705, -1034.4310, 69.5809, 1550.7722, -1726.3321, -50.8142, 30000, 20000, 1, 0, 1);// *
- CreateHouse(3, 2576.1394,-1070.8746,69.8322, 1500.8623, -1730.9697, -51.1188, 50000, 30000, 1, 0, 0);// *
- CreateHouse(4, 2527.6689,-1060.7572,69.5688, 1500.8623, -1730.9697, -51.1188, 20000, 12000, 1, 0, 1);// *
- CreateHouse(5, 2389.8701,-1037.7082,53.5693, 1608.7480, -1716.1524, -50.9083, 40000, 25000, 1, 0, 0);// *
- CreateHouse(6, 2279.1657,-1076.7059,47.6714, 1650.4968, -1732.9945, -51.3845, 50000, 30000, 1, 0, 0);// *
- CreateHouse(7, 2186.2875,-998.2521,66.4687, 1753.8463, -1729.9902, -50.8845, 80000, 60000, 1, 0, 1);// *
- CreateHouse(8, 2091.2529,-973.0701,51.9824, 1650.4968, -1732.9945, -51.3845, 60000, 40000, 1, 0, 1);// *
- CreateHouse(9, 1886.1549,-1113.7022,26.2758, 1650.4968, -1732.9945, -51.3845, 100000, 65000, 1, 0, 2);// *
- CreateHouse(10, 1939.0140, -1114.4953, 27.4522, 1997.5093, -1731.8872, -55.8142, 150000, 100000, 1, 0, 0);// *
- CreateHouse(11, 2092.1232, -1166.6259, 26.5859, 1997.5093, -1731.8872, -55.8142, 150000, 100000, 1, 0, 1);// *
- CreateHouse(12, 2148.0493,-1484.8009,26.6241, 1948.2426, -1731.9064, -53.2526, 200000, 140000, 1, 0, 0);// *
- CreateHouse(13, 2495.3466,-1690.5718,14.7656, 1948.2426, -1731.9064, -53.2526, 300000, 280000, 1, 0, 1);// *
- CreateHouse(14, 2486.4008,-1645.7712,14.0771, 1948.2426, -1731.9064, -53.2526, 300000, 280000, 1, 0, 2);// *
- CreateHouse(15, 2459.3266,-1690.4101,13.5467, 1753.8463, -1729.9902, -50.8845, 300000, 260000, 1, 0, 2);// *
- CreateHouse(16, 2368.2141,-1674.7031,14.1681, 1550.7722, -1726.3321, -50.8142, 100000, 80000, 1, 0, 0);// *
- CreateHouse(17, 2327.7263,-1682.0593,14.9296, 1709.2257, -1726.6661, -50.8298, 100000, 70000, 1, 0, 0);// *
- CreateHouse(18, 2240.1894,-1159.8574,1029.7968, 2236.7822,-1159.6846,1029.7968, 750, 0, 15, 15, 0);// Hotel jefferson
- CreateHouse(19, 2240.4987,-1170.8002,1029.7968, 2236.7731,-1170.7275,1029.7968, 750, 0, 15, 15, 0);//
- CreateHouse(20, 2225.5041,-1187.4376,1029.7968, 2225.4670,-1184.3275,1029.7968, 750, 0, 15, 15, 0);//
- CreateHouse(21, 2209.5314,-1189.3044,1029.7968, 2209.3708,-1192.3546,1029.7968, 750, 0, 15, 15, 0);//
- CreateHouse(22, 2193.8833,-1172.9208,1029.7968, 2197.7578,-1173.0030,1029.8043, 750, 0, 15, 15, 0);//
- CreateHouse(23, 2192.3337,-1157.0329,1029.7968, 2188.4440,-1156.9011,1029.7968, 750, 0, 15, 15, 0);//
- CreateHouse(24, 2266.6511, 1633.4680, 1084.2343, 2217.4606, -1076.2921, 1050.4843, 1000, 1000, 1, 1, 0); //Suite college
- CreateHouse(25, 2271.1032, 1633.5720, 1084.2343, 2217.4606, -1076.2921, 1050.4843, 1000, 1000, 1, 1, 1);
- CreateHouse(26, 2266.8315, 1642.3613, 1084.2343, 2217.4606, -1076.2921, 1050.4843, 1000, 1000, 1, 1, 2);
- CreateHouse(27, 2271.0366, 1642.0928, 1084.2343, 2217.4606, -1076.2921, 1050.4843, 1000, 1000, 1, 1, 3);
- CreateHouse(28, 2266.8239, 1652.6484, 1084.2343, 2217.4606, -1076.2921, 1050.4843, 1000, 1000, 1, 1, 4);
- CreateHouse(29, 2270.8886, 1652.5377, 1084.2343, 2217.4606, -1076.2921, 1050.4843, 1000, 1000, 1, 1, 5);
- CreateHouse(30, 2266.5461, 1662.5410, 1084.2343, 2217.4606, -1076.2921, 1050.4843, 1000, 1000, 1, 1, 6);
- CreateHouse(31, 2270.7197, 1662.4924, 1084.2343, 2217.4606, -1076.2921, 1050.4843, 1000, 1000, 1, 1, 7); //Fine suite
- /*SAN FRANCISCO*/
- CreateHouse(32, -1842.4879, 1114.6098, 45.4453, 1799.7270, -1731.6682, -51.0754, 200000, 180000, 1, 0, 0);
- CreateHouse(33, -2574.0520, 1151.8555, 55.7265, 1838.3778, -1736.8720, -53.9010, 250000, 200000, 1, 0, 0);
- CreateHouse(34, -2534.5698, 1142.8642, 55.7265, 1838.3778, -1736.8720, -53.9010, 250000, 200000, 1, 0, 1);
- CreateHouse(35, -2493.5131, 1141.3239, 55.7265, 1838.3778, -1736.8720, -53.9010, 250000, 200000, 1, 0, 2);
- CreateHouse(36, -2280.8898, 916.4746, 66.6484, 1709.2257, -1726.6661, -50.8298, 300000, 300000, 1, 0, 1);
- CreateHouse(37, -2168.8242, 743.9059, 64.9659, 1550.7722, -1726.3321, -50.8142, 100000, 70000, 1, 0, 3);
- CreateHouse(38, -2721.4953, 14.4938, 4.3359, 1948.2426, -1731.9064, -53.2526, 400000, 400000, 1, 0, 3);
- //CreateHouse(houseid, Float:eX, Float:eY, Float:eZ, Float:iX, Float:iY, Float:iZ, BuyPrice, SellPrice, INT, EXT, VW);
- //NEGOZI
- /*LOS ANGELES*/
- CreateBusiness(0, "Negozio Di Armi", 1367.5292, -1279.8209, 13.5468, 285.8361, -39.0166, 1001.5156, 150000, 100000, 5000, 1, 0, 0);//
- CreateBusiness(1, "Bar", 2309.5498, -1643.9216, 14.8270, 501.9578, -70.5648, 998.7578, 80000, 50000, 500, 11, 0, 0);//
- CreateBusiness(2, "Fast Food", 2420.7973, -1508.8027, 24.0000, 366.0002, -9.4338, 1001.8516, 50000, 40000, 1000, 9, 0, 0);//
- CreateBusiness(3, "Night Club", 2421.6008, -1220.7491, 25.4641, 1204.6689, -13.5429, 1000.9219, 200000, 150000, 1000, 2, 0, 100);//
- CreateBusiness(4, "Discoteca", 816.0202, -1386.9570, 13.6083, 493.1443, -24.2607, 1000.6797, 100000, 80000, 3000, 17, 0, 20);//
- CreateBusiness(5, "Burger King", 811.3378, -1616.1252, 13.5468, 366.0248, -73.3478, 1001.5078, 100000, 80000, 1000, 10, 0, 0);//
- CreateBusiness(6, "Supermercato", 1832.5937, -1842.5585, 13.5781, -25.7220, -187.8216, 1003.5469, 300000, 200000, 5000, 17, 0, 0);//
- CreateBusiness(7, "Bar", 1952.4853, -2041.3128, 13.5468, 501.9578, -70.5648, 998.7578, 70000, 40000, 500, 11, 1, 0);//
- CreateBusiness(8, "Sexy Shop", 1940.8619, -2116.1708, 13.6953, -100.2674, -22.9376, 1000.7188, 100000, 50000, 800, 3, 0, 0);//
- CreateBusiness(9, "Fast Food", 927.5415, -1352.9653, 13.3437, 366.0002, -9.4338, 1001.8516, 150000, 40000, 1000, 9, 1, 0);//
- CreateBusiness(10, "Colazione", 1038.1558, -1339.2880, 13.7265, 449.0172,-88.9894,999.5547, 50000, 40000, 800, 4, 0, 0);//
- CreateBusiness(11, "Supermercato", 2152.5615, -1013.5268, 62.8583, -25.7220, -187.8216, 1003.5469, 300000, 200000, 2000, 17, 1, 0);//
- CreateBusiness(12, "Pizzeria", 2103.7822, -1806.6022, 13.5546, 372.5565, -131.3607, 1001.4922, 200000, 150000, 1000, 5, 0, 0);//
- CreateBusiness(13, "Bar", 2057.6054, -1898.6342, 13.5538, 501.9578, -70.5648, 998.7578, 70000, 40000, 500, 11, 2, 0);//
- CreateBusiness(14, "Supermercato", 1929.9487, -1776.2971, 13.5468, -25.7220, -187.8216, 1003.5469, 300000, 200000, 5000, 17, 2, 0);//
- CreateBusiness(15, "Discoteca", 1835.8925, -1682.4217, 13.3707, -2638.8232, 1407.3395, 906.4609, 250000, 180000, 5000, 3, 0, 20);//
- CreateBusiness(16, "Sub Urban", 2112.7836, -1212.0937, 23.9637, 203.7967, -50.1281, 1001.8046, 300000, 200000, 5000, 1, 0, 0);//
- CreateBusiness(17, "Supermercato", 1352.3432, -1758.1309, 13.5078, -25.7220,-187.8216,1003.5469, 300000, 200000, 5000, 1, 3, 0);//
- CreateBusiness(18, "Scuola Guida", 919.1737, -1252.4110, 16.2109, -2026.8864, -104.5427, 1035.1718, 500000, 300000, 10000, 3, 0, 0);//
- CreateBusiness(19, "Motel", 2232.5322, -1159.7178, 25.8906, 2217.8987, -1150.5592, 1025.7969, 750000, 500000, 20000, 15, 0, 0);//
- CreateBusiness(20, "Palestra", 2226.6572, -1723.6589, 13.5517, 1459.5135, -1731.0631, -1.1080, 200000, 100000, 2000, 1, 0, 100); //
- CreateBusiness(21, "Bar", 2362.0966, -1332.4641, 24.0078, 501.9578, -70.5648, 998.7578, 50000, 10000, 500, 11, 3, 0);//
- CreateBusiness(22, "Fast Food", 2398.2177, -1898.2623, 13.5468, 366.0002, -9.4338, 1001.8516, 150000, 1000, 1000, 9, 2, 0);//
- CreateBusiness(23, "Pronto Soccorso", 2034.1430, -1402.6352, 17.2945, 2365.840087,-1128.746582,1060.790039, 1000000, 900000, 10000, 1, 0, 0);//
- CreateBusiness(24, "College", 1279.5942, -1509.5168, 10.0468, 389.2320, 173.6734, 1008.3828, 1000000, 780000, 20000, 3, 0, 0); //
- CreateBusiness(25, "Supermercato", 2140.2929, -1176.6031, 23.9921, -25.7220, -187.8216, 1003.5469, 300000, 200000, 5000, 17, 4, 0);//
- CreateBusiness(26, "Negozio Arredamento", 2351.3559, -1412.2904, 23.9924, 1250.3684, 6.0684, 1008.2578, 800000, 600000, 10000, 18, 0, 0);//
- /*SAN FRANCISCO*/
- CreateBusiness(27, "Cluckin' Bell", -2671.4484, 258.5975, 4.6328, 366.0002, -9.4338, 1001.8516, 80000, 60000, 5000, 9, 3, 5);
- CreateBusiness(28, "Banca SF", -2765.6757, 375.4502, 6.335, 2306.3826, -15.2365, 26.7496, 3500000, 3000000, 30000, 0, 1, -10); // -10 = (Interessi)
- CreateBusiness(29, "Pronto Soccorso", -2658.3635, 638.8464, 14.4531, 2365.840087,-1128.746582,1060.790039, 1500000, 120000, 10000, 1, 1, 0);//
- CreateBusiness(30, "Cluckin' Bell", -2671.4484, 258.5975, 4.6328, 366.0002, -9.4338, 1001.8516, 80000, 60000, 5000, 9, 4, 5);//
- CreateBusiness(31, "Distretto Polizia", -1605.5728, 711.6525, 13.8671, 288.4723, 170.0647, 1007.1794, 2500000, 2000000, 25000, 3, 0, 0);//
- CreateBusiness(32, "Burger King", -1911.7137, 828.4608, 35.1726, 366.0248, -73.3478, 1001.5078, 50000, 45000, 1000, 10, 1, 5);//
- CreateBusiness(33, "Pizzeria", -1807.9168, 944.7548, 24.8906, 372.5565, -131.3607, 1001.4922, 80000, 60000, 1500, 5, 1, 5);//
- CreateBusiness(34, "Burger King", -2356.8049, 1008.2071, 50.8984, 366.0248, -73.3478, 1001.5078, 50000, 45000, 1000, 10, 2, 5);//
- CreateBusiness(35, "Negozio RC", -2242.7067, 128.6041, 35.3203, -2240.1028, 136.973, 1035.4141, 40000, 30000, 1000, 6, 0, 10);//
- CreateBusiness(36, "Bar", -2243.0686, -88.0907, 35.3203, 501.9578, -70.5648, 998.7578, 40000, 30000, 1000, 11, 4, 5);//
- CreateBusiness(37, "Muay Thai", -2269.8142, -155.9803, 35.3203, 773.8887, -47.7698, 1000.5859, 350000, 275000, 3000, 6, 0, 200);//
- CreateBusiness(38, "Burger King", -2335.8691, -166.8283, 35.5546, 366.0248, -73.3478, 1001.5078, 60000, 50000, 1200, 10, 3, 5);//
- CreateBusiness(39, "Supermercato", -2509.6132, -50.0326, 25.6826, -26.8339, -55.5846, 1003.5469, 200000, 180000, 5000, 6, 0, 10);//
- CreateBusiness(40, "Sub Urban", -2491.3344, -29.0582, 25.7656, 204.1174, -46.8047, 1001.8047, 250000, 225000, 6000, 1, 1, 5);//
- CreateBusiness(41, "Bar", -2491.3415, -16.8991, 25.7656, 501.9578, -70.5648, 998.7578, 60000, 50000, 600, 11, 5, 15);//
- CreateBusiness(42, "Scuola Guida", -2026.6647, -101.8719, 35.1640, -2026.8864, -104.5427, 1035.1718, 600000, 600000, 15000, 3, 1, 0);//
- CreateBusiness(43, "Victim", -1695.6286, 951.2150, 24.8906, 225.0306, -9.1838, 1002.218, 300000, 350000, 8000, 5, 0, 5);//
- CreateBusiness(44, "Supermercato", -1675.7785, 431.7738, 7.1796, -30.9875, -89.6806, 1003.5469, 100000, 150000, 5000, 18, 0, 5);//
- CreateBusiness(45, "Solarin Industries", -1827.2707, 9.6928, 15.1227, -944.2402, 1886.1536, 5.0051, 5000000, 3000000, 50000, 17, 0, 0);//
- //CreateBusiness(bizid, defaultname[51], Float:eX, Float:eY, Float:eZ, Float:iX, Float:iY, Float:iZ, BuyPrice, SellPrice, Earn, INT, VW, EnterPrice);//
- SetTimer("SaveHouseAndStoreInformation", 1000, true);
- return 1;
- }
- public OnFilterScriptExit()
- {
- DestroyAllHouses();
- DestroyAllStores();
- return 1;
- }
- stock DestroyAllHouses()
- {
- for(new i=0;i<MAX_HOUSES;i++)
- {
- DestroyPickup(HousePickup[i]);
- }
- return 1;
- }
- stock DestroyAllStores()
- {
- new Text3D:labelid;
- for(new i=0;i<MAX_BUSINESSES;i++)
- {
- DestroyPickup(BizPickup[i]);
- }
- for(new i=0;i<MAX_3DTEXT_GLOBAL;i++)
- {
- Delete3DTextLabel(labelid);
- labelid ++;
- }
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- switch(dialogid)
- {
- case DIALOG_DEPOSIT_MONEY:
- {
- new houseid = LastHouse[playerid];
- if(strval(inputtext) > 100000) return ShowPlayerDialog(playerid, 1499, DIALOG_STYLE_MSGBOX, "{FF0000}ERRORE", "Il Massimo E' $100000","OK","");
- if(strval(inputtext) > GetPlayerMoney(playerid))
- {
- new str[256];
- format(str,sizeof(str),"Non Hai $%d Nel Portafogli", strval(inputtext));
- ShowPlayerDialog(playerid, 1499, DIALOG_STYLE_MSGBOX, "{FF0000}ERRORE", str,"OK","");
- return 1;
- }
- new string[256];
- format(string,sizeof(string),HOUSE_FILE, houseid);
- INI_Open(string);
- new X = INI_ReadInt("StorageMoney");
- INI_WriteInt("StorageMoney", X+strval(inputtext));
- INI_Save();
- INI_Close();
- GivePlayerMoney(playerid, -strval(inputtext));
- return 1;
- }
- case DIALOG_WITHDRAW_MONEY:
- {
- new houseid = LastHouse[playerid];
- if(strval(inputtext) > 100000) return ShowPlayerDialog(playerid, 1499, DIALOG_STYLE_MSGBOX, "{FF0000}ERRORE", "Il Massimo E' $100000","OK","");
- new string[256];
- format(string,sizeof(string),HOUSE_FILE, houseid);
- INI_Open(string);
- new X = INI_ReadInt("StorageMoney");
- if(strval(inputtext) > X)
- {
- new str[256];
- format(str,sizeof(str),"Non Hai $%d Nello Storage", strval(inputtext));
- ShowPlayerDialog(playerid, 1499, DIALOG_STYLE_MSGBOX, "{FF0000}ERRORE", str,"OK","");
- INI_Close();
- return 1;
- }
- INI_WriteInt("StorageMoney", X-strval(inputtext));
- INI_Save();
- INI_Close();
- GivePlayerMoney(playerid, strval(inputtext));
- return 1;
- }
- case DIALOG_MAIN_STORAGE:
- {
- new houseid = LastHouse[playerid];
- if(!response) return 1;
- switch(listitem)
- {
- case 0:
- {
- new string[256];
- new X;
- format(string,sizeof(string), HOUSE_FILE, houseid);
- INI_Open(string);
- X = INI_ReadInt("StorageMoney");
- INI_Close();
- new str[128];
- format(str,sizeof(str),"{FFFFFF}Hai {33AA33}$%d {FFFFFF}Nello Storage",X);
- ShowPlayerDialog(playerid, DIALOG_DEPOSIT_MONEY, DIALOG_STYLE_INPUT, "{33AA33}Inserisci La Quantità Da Inserire",str, "OK", "Annulla");
- }
- case 1:
- {
- new string[256];
- new X;
- format(string,sizeof(string), HOUSE_FILE, houseid);
- INI_Open(string);
- X = INI_ReadInt("StorageMoney");
- INI_Close();
- new str[128];
- format(str,sizeof(str),"{FFFFFF}Hai {33AA33}$%d {FFFFFF}Nello Storage",X);
- ShowPlayerDialog(playerid, DIALOG_WITHDRAW_MONEY,DIALOG_STYLE_INPUT, "{33AA33}Inserisci La Quantità Da Prelevare",str, "OK", "Annulla");
- }
- case 2:
- {
- GetPlayerWeaponData(playerid, 0, sInfo[houseid][Weap0],sInfo[houseid][Ammo0]);
- GetPlayerWeaponData(playerid, 1, sInfo[houseid][Weap1],sInfo[houseid][Ammo1]);
- GetPlayerWeaponData(playerid, 2, sInfo[houseid][Weap2],sInfo[houseid][Ammo2]);
- GetPlayerWeaponData(playerid, 3, sInfo[houseid][Weap3],sInfo[houseid][Ammo3]);
- GetPlayerWeaponData(playerid, 4, sInfo[houseid][Weap4],sInfo[houseid][Ammo4]);
- GetPlayerWeaponData(playerid, 5, sInfo[houseid][Weap5],sInfo[houseid][Ammo5]);
- GetPlayerWeaponData(playerid, 6, sInfo[houseid][Weap6],sInfo[houseid][Ammo6]);
- GetPlayerWeaponData(playerid, 7, sInfo[houseid][Weap7],sInfo[houseid][Ammo7]);
- GetPlayerWeaponData(playerid, 8, sInfo[houseid][Weap8],sInfo[houseid][Ammo8]);
- GetPlayerWeaponData(playerid, 9, sInfo[houseid][Weap9],sInfo[houseid][Ammo9]);
- GetPlayerWeaponData(playerid, 10, sInfo[houseid][Weap10],sInfo[houseid][Ammo10]);
- GetPlayerWeaponData(playerid, 11, sInfo[houseid][Weap11],sInfo[houseid][Ammo11]);
- GetPlayerWeaponData(playerid, 12, sInfo[houseid][Weap12],sInfo[houseid][Ammo12]);
- new string[256];
- format(string,sizeof(string),HOUSE_FILE, houseid);
- INI_Open(string);
- INI_WriteInt("Weapon0", sInfo[houseid][Weap0]);
- INI_WriteInt("Ammo0", sInfo[houseid][Ammo0]);
- INI_WriteInt("Weapon1", sInfo[houseid][Weap1]);
- INI_WriteInt("Ammo1", sInfo[houseid][Ammo1]);
- INI_WriteInt("Weapon2", sInfo[houseid][Weap2]);
- INI_WriteInt("Ammo2", sInfo[houseid][Ammo2]);
- INI_WriteInt("Weapon3", sInfo[houseid][Weap3]);
- INI_WriteInt("Ammo3", sInfo[houseid][Ammo3]);
- INI_WriteInt("Weapon4", sInfo[houseid][Weap4]);
- INI_WriteInt("Ammo4", sInfo[houseid][Ammo4]);
- INI_WriteInt("Weapon5", sInfo[houseid][Weap5]);
- INI_WriteInt("Ammo5", sInfo[houseid][Ammo5]);
- INI_WriteInt("Weapon6", sInfo[houseid][Weap6]);
- INI_WriteInt("Ammo6", sInfo[houseid][Ammo6]);
- INI_WriteInt("Weapon7", sInfo[houseid][Weap7]);
- INI_WriteInt("Ammo7", sInfo[houseid][Ammo7]);
- INI_WriteInt("Weapon8", sInfo[houseid][Weap8]);
- INI_WriteInt("Ammo8", sInfo[houseid][Ammo8]);
- INI_WriteInt("Weapon9", sInfo[houseid][Weap9]);
- INI_WriteInt("Ammo9", sInfo[houseid][Ammo9]);
- INI_WriteInt("Weapon10", sInfo[houseid][Weap10]);
- INI_WriteInt("Ammo10", sInfo[houseid][Ammo10]);
- INI_WriteInt("Weapon11", sInfo[houseid][Weap11]);
- INI_WriteInt("Ammo11", sInfo[houseid][Ammo11]);
- INI_WriteInt("Weapon12", sInfo[houseid][Weap12]);
- INI_WriteInt("Ammo12", sInfo[houseid][Ammo12]);
- INI_Save();
- INI_Close();
- ResetPlayerWeapons(playerid);
- ShowPlayerDialog(playerid, 1499, DIALOG_STYLE_MSGBOX,"{33AA33}COMANDO", "Hai Depositato Le Tue Armi", "OK", "");
- }
- case 3:
- {
- new string[256];
- format(string,sizeof(string),HOUSE_FILE, houseid);
- INI_Open(string);
- if(INI_ReadInt("Weapon0") != 0) GivePlayerWeapon(playerid, INI_ReadInt("Weapon0"), INI_ReadInt("Ammo0"));
- if(INI_ReadInt("Weapon1") != 0) GivePlayerWeapon(playerid, INI_ReadInt("Weapon1"), INI_ReadInt("Ammo1"));
- if(INI_ReadInt("Weapon2") != 0) GivePlayerWeapon(playerid, INI_ReadInt("Weapon2"), INI_ReadInt("Ammo2"));
- if(INI_ReadInt("Weapon3") != 0) GivePlayerWeapon(playerid, INI_ReadInt("Weapon3"), INI_ReadInt("Ammo3"));
- if(INI_ReadInt("Weapon4") != 0) GivePlayerWeapon(playerid, INI_ReadInt("Weapon4"), INI_ReadInt("Ammo4"));
- if(INI_ReadInt("Weapon5") != 0) GivePlayerWeapon(playerid, INI_ReadInt("Weapon5"), INI_ReadInt("Ammo5"));
- if(INI_ReadInt("Weapon6") != 0) GivePlayerWeapon(playerid, INI_ReadInt("Weapon6"), INI_ReadInt("Ammo6"));
- if(INI_ReadInt("Weapon7") != 0) GivePlayerWeapon(playerid, INI_ReadInt("Weapon7"), INI_ReadInt("Ammo7"));
- if(INI_ReadInt("Weapon8") != 0) GivePlayerWeapon(playerid, INI_ReadInt("Weapon8"), INI_ReadInt("Ammo8"));
- if(INI_ReadInt("Weapon9") != 0) GivePlayerWeapon(playerid, INI_ReadInt("Weapon9"), INI_ReadInt("Ammo9"));
- if(INI_ReadInt("Weapon10") != 0) GivePlayerWeapon(playerid, INI_ReadInt("Weapon10"), INI_ReadInt("Ammo10"));
- if(INI_ReadInt("Weapon11") != 0) GivePlayerWeapon(playerid, INI_ReadInt("Weapon11"), INI_ReadInt("Ammo11"));
- if(INI_ReadInt("Weapon12") != 0) GivePlayerWeapon(playerid, INI_ReadInt("Weapon12"), INI_ReadInt("Ammo12"));
- INI_WriteInt("Weapon0", 0);
- INI_WriteInt("Ammo0", 0);
- INI_WriteInt("Weapon1", 0);
- INI_WriteInt("Ammo1", 0);
- INI_WriteInt("Weapon2", 0);
- INI_WriteInt("Ammo2", 0);
- INI_WriteInt("Weapon3", 0);
- INI_WriteInt("Ammo3", 0);
- INI_WriteInt("Weapon4", 0);
- INI_WriteInt("Ammo4", 0);
- INI_WriteInt("Weapon5", 0);
- INI_WriteInt("Ammo5", 0);
- INI_WriteInt("Weapon6", 0);
- INI_WriteInt("Ammo6", 0);
- INI_WriteInt("Weapon7", 0);
- INI_WriteInt("Ammo7", 0);
- INI_WriteInt("Weapon8", 0);
- INI_WriteInt("Ammo8", 0);
- INI_WriteInt("Weapon9", 0);
- INI_WriteInt("Ammo9", 0);
- INI_WriteInt("Weapon10", 0);
- INI_WriteInt("Ammo10", 0);
- INI_WriteInt("Weapon11", 0);
- INI_WriteInt("Ammo11", 0);
- INI_WriteInt("Weapon12", 0);
- INI_WriteInt("Ammo12", 0);
- sInfo[houseid][Weap0] = 0;
- sInfo[houseid][Weap1] = 0;
- sInfo[houseid][Weap2] = 0;
- sInfo[houseid][Weap3] = 0;
- sInfo[houseid][Weap4] = 0;
- sInfo[houseid][Weap5] = 0;
- sInfo[houseid][Weap6] = 0;
- sInfo[houseid][Weap7] = 0;
- sInfo[houseid][Weap9] = 0;
- sInfo[houseid][Weap10] = 0;
- sInfo[houseid][Weap11] = 0;
- sInfo[houseid][Weap12] = 0;
- sInfo[houseid][Ammo0] = 0;
- sInfo[houseid][Ammo1] = 0;
- sInfo[houseid][Ammo2] = 0;
- sInfo[houseid][Ammo3] = 0;
- sInfo[houseid][Ammo4] = 0;
- sInfo[houseid][Ammo5] = 0;
- sInfo[houseid][Ammo6] = 0;
- sInfo[houseid][Ammo7] = 0;
- sInfo[houseid][Ammo9] = 0;
- sInfo[houseid][Ammo10] = 0;
- sInfo[houseid][Ammo11] = 0;
- sInfo[houseid][Ammo12] = 0;
- INI_Close();
- ShowPlayerDialog(playerid, 1499, DIALOG_STYLE_MSGBOX,"{33AA33}COMANDO", "Hai Raccolto Le Tue Armi", "OK", "");
- }
- case 4:
- {
- if(hInfo[LastHouse[playerid]][Locked] == 1)
- {
- hInfo[LastHouse[playerid]][Locked] = 0;
- UnlockYourHouseMessage(playerid);
- }
- else
- {
- hInfo[LastHouse[playerid]][Locked] = 1;
- LockYourHouseMessage(playerid);
- }
- return 1;
- }
- }
- return 1;
- }
- case DIALOG_FORSALE_HOUSE:
- {
- if(!response) return 1;
- if(GetPlayerMoney(playerid) < hInfo[GetHouseID(playerid)][Cost]) return ShowNoMoneyMessage(playerid);
- BuyHouse(playerid, GetHouseID(playerid));
- return 1;
- }
- case DIALOG_FORSALE_STORE:
- {
- if(!response) return 1;
- switch(listitem)
- {
- case 0:
- {
- EnterBusiness(playerid, GetBizID(playerid));
- }
- case 1:
- {
- if(GetPlayerMoney(playerid) < bInfo[GetBizID(playerid)][bCost]) return ShowNoMoneyMessage(playerid);
- BuyBusiness(playerid, GetBizID(playerid));
- }
- }
- return 1;
- }
- case DIALOG_OTHERS_HOUSE:
- {
- if(!response) return 1;
- if(hInfo[GetHouseID(playerid)][Locked] == 1) return ShowLockedHouseMessage(playerid);
- EnterHouse(playerid, GetHouseID(playerid));
- return 1;
- }
- case DIALOG_OTHERS_STORE:
- {
- if(!response) return 1;
- if(bInfo[GetBizID(playerid)][bLocked] == 1) return ShowLockedStoreMessage(playerid);
- EnterBusiness(playerid, GetBizID(playerid));
- return 1;
- }
- case DIALOG_MY_HOUSE:
- {
- if(!response) return 1;
- switch(listitem)
- {
- case 0:
- {
- if(hInfo[GetHouseID(playerid)][Locked] == 1) return ShowLockedHouseMessage(playerid);
- EnterHouse(playerid, GetHouseID(playerid));
- return 1;
- }
- case 1:
- {
- if(hInfo[GetHouseID(playerid)][Locked] == 1)
- {
- hInfo[GetHouseID(playerid)][Locked] = 0;
- UnlockYourHouseMessage(playerid);
- }
- else
- {
- hInfo[GetHouseID(playerid)][Locked] = 1;
- LockYourHouseMessage(playerid);
- }
- return 1;
- }
- case 2:
- {
- new string[101];
- format(string,sizeof(string), "Vuoi Veramente Vendere La Tua Casa Per $%d?", hInfo[GetHouseID(playerid)][Sell]);
- ShowPlayerDialog(playerid, DIALOG_SELL_HOUSE, DIALOG_STYLE_MSGBOX, "{33AA33}COMANDO", string, "Si", "No");
- return 1;
- }
- }
- return 1;
- }
- case DIALOG_MY_STORE:
- {
- if(!response) return 1;
- switch(listitem)
- {
- case 0:
- {
- if(bInfo[GetBizID(playerid)][bLocked] == 1) return ShowLockedStoreMessage(playerid);
- EnterBusiness(playerid, GetBizID(playerid));
- return 1;
- }
- case 1:
- {
- if(bInfo[GetBizID(playerid)][bLocked] == 1)
- {
- bInfo[GetBizID(playerid)][bLocked] = 0;
- UnlockYourStoreMessage(playerid);
- }
- else
- {
- bInfo[GetBizID(playerid)][bLocked] = 1;
- LockYourStoreMessage(playerid);
- }
- return 1;
- }
- case 2:
- {
- ShowPlayerDialog(playerid, DIALOG_RENAME_STORE,DIALOG_STYLE_INPUT, "Scrivi Un Nuovo Nome Per Il Tuo Negozio","TIP: Se Conosci La Notazione Esadecimale Puoi Fare I Colori Usando \"{RRGGBB}Nome\"", "OK", "Annulla");
- return 1;
- }
- case 3:
- {
- GetBusinessMoney(playerid, GetBizID(playerid));
- return 1;
- }
- case 4:
- {
- new string[256];
- format(string,sizeof(string), "Quante merci vuoi ordinare? Prezzo: %d$/Merce.", COSTO_MERCI);
- ShowPlayerDialog(playerid, DIALOG_ORDER_GOODS, DIALOG_STYLE_INPUT, "{33AA33}COMANDO", string, "OK", "Annulla");
- return 1;
- }
- case 5:
- {
- new string[256];
- format(string,sizeof(string), "Vuoi Veramente Vendere Il Tuo Negozio Per $%d?", bInfo[GetBizID(playerid)][bSell]);
- ShowPlayerDialog(playerid, DIALOG_SELL_STORE, DIALOG_STYLE_MSGBOX, "{33AA33}COMANDO", string, "Si", "No");
- return 1;
- }
- }
- return 1;
- }
- case DIALOG_ORDER_GOODS:
- {
- if(strval(inputtext) == 0) return 1;
- if(GetPlayerMoney(playerid) < (strval(inputtext)*COSTO_MERCI)) return ShowNoMoneyMessage(playerid);
- GivePlayerMoney(playerid, -strval(inputtext)*COSTO_MERCI);
- bInfo[GetBizID(playerid)][bRifornimenti] += strval(inputtext);
- new string[256];
- format(string, sizeof(string), "Hai Rifornito Di %d Merci Il Tuo Negozio Per $%d!", strval(inputtext), strval(inputtext)*COSTO_MERCI);
- ShowPlayerDialog(playerid, 1499, DIALOG_STYLE_MSGBOX, "{33AA33}COMANDO", string, "OK", "");
- return 1;
- }
- case DIALOG_SELL_HOUSE:
- {
- if(!response) return 1;
- SellHouse(playerid, GetHouseID(playerid));
- return 1;
- }
- case DIALOG_SELL_STORE:
- {
- if(!response) return 1;
- SellBusiness(playerid, GetBizID(playerid));
- return 1;
- }
- case DIALOG_RENAME_STORE:
- {
- if(!response) return 1;
- if(strlen(inputtext) >= 51)
- {
- ShowPlayerDialog(playerid, 1499, DIALOG_STYLE_MSGBOX, "{FF0000}ERRORE", "La Massima Lunghezza E' 50 Caratteri", "OK", "");
- return 1;
- }
- new string[256];
- format(bInfo[GetBizID(playerid)][bTitle],51, inputtext);
- format(string, 256, BIZ_FILE, GetBizID(playerid));
- INI_Open(string);
- INI_WriteString("Title",bInfo[GetBizID(playerid)][bTitle]);
- INI_Save();
- INI_Close();
- return 1;
- }
- }
- return 0;
- }
- public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
- {
- if(newkeys & KEY_ENTER_PROPERTY)
- {
- new name[24];
- GetPlayerName(playerid,name,24);
- if(LastHouse[playerid] != INVALID_HOUSE_ID
- && !IsPlayerNearPoint(2.0, playerid, hInfo[LastHouse[playerid]][InteriorX], hInfo[LastHouse[playerid]][InteriorY], hInfo[LastHouse[playerid]][InteriorZ])
- && strcmp(name,hInfo[LastHouse[playerid]][Name],true) == 0)
- {
- ShowPlayerDialog(playerid,DIALOG_MAIN_STORAGE, DIALOG_STYLE_LIST, "{33AA33}Cosa Vuoi Fare Con Lo Storage?","{00FFFF}Deposita Soldi\n{00FFFF}Preleva Soldi\n{AFAFAF}Deposita Armi\n{AFAFAF}Preleva Armi\n{00FF00}Apri/Chiudi A Chiave La Porta","OK","Annulla");
- return 1;
- }
- for(new i=0; i<MAX_HOUSES; i++)
- {
- if(IsPlayerNearPoint(2.0, playerid, hInfo[i][InteriorX], hInfo[i][InteriorY], hInfo[i][InteriorZ]) && GetPlayerVirtualWorld(playerid) == hInfo[i][VirtualWorld])
- {
- ExitHouse(playerid, i);
- }
- }
- for(new i=0; i<MAX_BUSINESSES; i++)
- {
- if(IsPlayerNearPoint(2.0, playerid, bInfo[i][bInteriorX], bInfo[i][bInteriorY], bInfo[i][bInteriorZ]) && bInfo[i][bVirtualWorld] == GetPlayerVirtualWorld(playerid))
- {
- ExitBusiness(playerid, i);
- }
- }
- if(GetHouseID(playerid) != INVALID_HOUSE_ID)
- {
- OpenHouseDialog(playerid, GetHouseID(playerid));
- return 1;
- }
- else if(GetBizID(playerid) != INVALID_HOUSE_ID)
- {
- OpenBusinessDialog(playerid, GetBizID(playerid));
- return 1;
- }
- }
- return 1;
- }
- /*
- CreateHouse
- Funzione: Crea Una Casa.
- Da Usare Con: OnFilterScriptInit
- Parametri:
- -houseid: L'ID della casa. Non creare 2 case con lo stesso ID.
- -eX, eY, eZ: La posizione esteriore della casa (L'entrata)
- -iX, iY, iZ: La posizione interiore della casa (L'uscita)
- -BuyPrice: Il costo della casa
- -SellPrice: La quantità che viene data al proprietario quando la rivende
- -INT: L' ID dell'interior della casa
- -VW: Il mondo virtuale della casa (Usa 2 VW diversi se vuoi avere 2 case con lo stesso interior)
- Riporta:
- -true(1): Quando la casa esisteva gia, ed è stata caricata
- -null(-1): Quando la casa non esisteva ed è stata creata
- -false(0): Quando è impossibile caricare o creare
- */
- stock CreateHouse(houseid, Float:eX, Float:eY, Float:eZ, Float:iX, Float:iY, Float:iZ, BuyPrice, SellPrice, INT, EXT, VW)
- {
- new housefile[51];
- format(housefile, sizeof(housefile), HOUSE_FILE, houseid);
- if(!INI_Exist(housefile)) //Se il file non esiste:
- {
- INI_Open(housefile);
- format(hInfo[houseid][Name], 24, "ForSale");
- INI_WriteString("Name", "ForSale");
- hInfo[houseid][Cost] = BuyPrice;
- INI_WriteInt("Cost", BuyPrice);
- hInfo[houseid][Sell] = SellPrice;
- INI_WriteInt("Sell", SellPrice);
- hInfo[houseid][Interior] = INT;
- INI_WriteInt("Interior", INT);
- hInfo[houseid][Exterior] = EXT;
- INI_WriteInt("Exterior", EXT);
- hInfo[houseid][VirtualWorld] = VW;
- INI_WriteInt("VirtualWorld", VW);
- hInfo[houseid][Locked] = 1;
- INI_WriteInt("Locked", 1);
- hInfo[houseid][InteriorX] = iX;
- hInfo[houseid][InteriorY] = iY;
- hInfo[houseid][InteriorZ] = iZ;
- INI_WriteFloat("InteriorX", iX);
- INI_WriteFloat("InteriorY", iY);
- INI_WriteFloat("InteriorZ", iZ);
- hInfo[houseid][ExteriorX] = eX;
- hInfo[houseid][ExteriorY] = eY;
- hInfo[houseid][ExteriorZ] = eZ;
- INI_WriteFloat("ExteriorX", eX);
- INI_WriteFloat("ExteriorY", eY);
- INI_WriteFloat("ExteriorZ", eZ);
- HousePickup[houseid] = CreatePickup(1273, 23, eX, eY, eZ);
- Create3DTextLabel("Usa Spazio Per Aprire Il Menu", 0x00FF00FF, eX, eY, eZ+1, 20, 0, 0);
- Create3DTextLabel("Usa Spazio Per Uscire", 0x00FF00FF, iX, iY, iZ+1, 20, VW, 0);
- #if defined PRINT_HOUSES
- print("------------Nuova Casa Creata------------");
- printf("- Houseid: %d", houseid);
- printf("- Costo: %d", BuyPrice);
- printf("- Ricavo Vendita: %d", SellPrice);
- printf("- Interior: %d", INT);
- printf("- Virtual World: %d", VW);
- print("-----------------------------------------");
- #endif
- INI_Save();
- INI_Close();
- return -1;
- }
- else if(INI_Exist(housefile))//altrimenti, se esiste il file
- {
- new destination[24];
- INI_Open(housefile);
- INI_ReadString(destination, "Name");
- format(hInfo[houseid][Name], 24, destination);
- hInfo[houseid][Locked] = INI_ReadInt("Locked");
- INI_Close();
- hInfo[houseid][Cost] = BuyPrice;
- hInfo[houseid][Sell] = SellPrice;
- hInfo[houseid][Interior] = INT;
- hInfo[houseid][Exterior] = EXT;
- hInfo[houseid][VirtualWorld] = VW;
- hInfo[houseid][InteriorX] = iX;
- hInfo[houseid][InteriorY] = iY;
- hInfo[houseid][InteriorZ] = iZ;
- hInfo[houseid][ExteriorX] = eX;
- hInfo[houseid][ExteriorY] = eY;
- hInfo[houseid][ExteriorZ] = eZ;
- if(strcmp(hInfo[houseid][Name],"ForSale",true) == 0)
- {
- HousePickup[houseid] = CreatePickup(1273, 23, eX, eY, eZ);
- }
- else
- {
- HousePickup[houseid] = CreatePickup(1272, 23, eX, eY, eZ);
- }
- Create3DTextLabel("Usa Spazio Per Aprire Il Menu", 0x00FF00FF, eX, eY, eZ+1, 20, 0, 0);
- Create3DTextLabel("Usa Spazio Per Uscire", 0x00FF00FF, iX, iY, iZ+1, 20, VW, 0);
- #if defined PRINT_HOUSES
- print("------------Casa Esistente Caricata------------");
- printf("- Houseid: %d", houseid);
- printf("- Costo: %d", BuyPrice);
- printf("- Ricavo Vendita: %d", SellPrice);
- printf("- Interior: %d", INT);
- printf("- Virtual World: %d", VW);
- print("----------------------------------------------");
- #endif
- return 1;
- }
- print("E Impossibile Creare Una Casa. Controlla Di Avere Le Seguenti Cartelle In Scriptfiles:");
- print("SasiHouses ------>");
- print(" Houses");
- print(" Stores");
- print(" Users");
- return 0;
- }
- /*
- CreateBusiness
- Funzione: Crea Un Negozio.
- Da Usare Con: OnFilterScriptInit
- Parametri:
- -bizid: L'ID del negozio. Non creare 2 negozi con lo stesso ID.
- -defaultname: Il nome iniziale del negozio.
- -eX, eY, eZ: La posizione esteriore del negozio (L'entrata)
- -iX, iY, iZ: La posizione interiore del negozio (L'uscita)
- -BuyPrice: Il costo del negozio
- -SellPrice: La quantità che viene data al proprietario quando lo rivende
- -INT: L'ID dell'interior del negozio
- -VW: Il mondo virtuale del negozio (Usa 2 VW diversi se vuoi avere 2 negozi con lo stesso interior)
- Riporta:
- -true(1): Quando il negozio esisteva gia, ed è stata caricata
- -null(-1): Quando il negozio non esisteva ed è stata creata
- -false(0): Quando è impossibile caricare o creare
- */
- stock CreateBusiness(bizid, defaultname[51], Float:eX, Float:eY, Float:eZ, Float:iX, Float:iY, Float:iZ, BuyPrice, SellPrice, Earn, INT, VW, EnterPrice)
- {
- new bizfile[51];
- format(bizfile, sizeof(bizfile), BIZ_FILE, bizid);
- if(!INI_Exist(bizfile))
- {
- INI_Open(bizfile);
- format(bInfo[bizid][bName], 24, "ForSale");
- INI_WriteString("Name", "ForSale");
- format(bInfo[bizid][bTitle], 51, defaultname);
- INI_WriteString("Title", defaultname);
- bInfo[bizid][bCost] = BuyPrice;
- INI_WriteInt("Cost", BuyPrice);
- bInfo[bizid][bSell] = SellPrice;
- INI_WriteInt("Sell", SellPrice);
- bInfo[bizid][bCashRegister] = 0;
- INI_WriteInt("Money", 0);
- bInfo[bizid][bInterior] = INT;
- INI_WriteInt("Interior", INT);
- bInfo[bizid][bVirtualWorld] = VW;
- INI_WriteInt("VirtualWorld", VW);
- bInfo[bizid][bLocked] = 0;
- INI_WriteInt("Locked", 0);
- bInfo[bizid][bEnter] = EnterPrice;
- INI_WriteInt("EnterPrice", bInfo[bizid][bEnter]);
- bInfo[bizid][bRifornimenti] = 0;
- INI_WriteInt("Merci", bInfo[bizid][bRifornimenti]);
- bInfo[bizid][bInteriorX] = iX;
- bInfo[bizid][bInteriorY] = iY;
- bInfo[bizid][bInteriorZ] = iZ;
- INI_WriteFloat("bInteriorX", iX);
- INI_WriteFloat("bInteriorY", iY);
- INI_WriteFloat("bInteriorZ", iZ);
- bInfo[bizid][bExteriorX] = eX;
- bInfo[bizid][bExteriorY] = eY;
- bInfo[bizid][bExteriorZ] = eZ;
- INI_WriteFloat("ExteriorX", eX);
- INI_WriteFloat("ExteriorY", eY);
- INI_WriteFloat("ExteriorZ", eZ);
- BizPickup[bizid] = CreatePickup(1318, 23, eX, eY, eZ);
- Create3DTextLabel("Usa Spazio Per Aprire Il Menu", 0x00FF00FF, eX, eY, eZ+1, 20, 0, 0);
- Create3DTextLabel("Usa Spazio Per Uscire", 0x00FF00FF, iX, iY, iZ+1, 20, VW, 0);
- SetTimerEx("AddBusinessMoney", 600000, true, "ii", bizid, Earn); //Millisecondi * Secondi * Minuti
- #if defined PRINT_HOUSES
- print("------------Nuovo Negozio Creato------------");
- printf("- Business ID: %d", bizid);
- printf("- Buy Cost: %d", BuyPrice);
- printf("- Sell Cost: %d", SellPrice);
- printf("- Interior: %d", INT);
- printf("- Virtual World: %d", VW);
- print("--------------------------------------------");
- #endif
- INI_Save();
- INI_Close();
- return -1;
- }
- else if(INI_Exist(bizfile))
- {
- new destination[24];
- new dest2[24];
- INI_Open(bizfile);
- INI_ReadString(destination, "Name");
- INI_ReadString(dest2, "Title");
- format(bInfo[bizid][bName], 24, destination);
- format(bInfo[bizid][bTitle], 51, dest2);
- bInfo[bizid][bLocked] = INI_ReadInt("Locked");
- bInfo[bizid][bCashRegister] = INI_ReadInt("Money");
- bInfo[bizid][bRifornimenti] = INI_ReadInt("Merci");
- INI_Close();
- bInfo[bizid][bCost] = BuyPrice;
- bInfo[bizid][bSell] = SellPrice;
- bInfo[bizid][bEnter] = EnterPrice;
- bInfo[bizid][bInterior] = INT;
- bInfo[bizid][bVirtualWorld] = VW;
- bInfo[bizid][bInteriorX] = iX;
- bInfo[bizid][bInteriorY] = iY;
- bInfo[bizid][bInteriorZ] = iZ;
- bInfo[bizid][bExteriorX] = eX;
- bInfo[bizid][bExteriorY] = eY;
- bInfo[bizid][bExteriorZ] = eZ;
- BizPickup[bizid] = CreatePickup(1318, 23, eX, eY, eZ);
- Create3DTextLabel("Usa Spazio Per Aprire Il Menu", 0x00FF00FF, eX, eY, eZ+1, 20, 0, 0);
- Create3DTextLabel("Usa Spazio Per Uscire", 0x00FF00FF, iX, iY, iZ+1, 20, VW, 0);
- SetTimerEx("AddBusinessMoney", 600000, true, "ii", bizid, Earn); //Millisecondi * Secondi * Minuti
- #if defined PRINT_HOUSES
- print("--------------Negozio Caricato--------------");
- printf("- Business ID: %d", bizid);
- printf("- Buy Cost: %d", BuyPrice);
- printf("- Sell Cost: %d", SellPrice);
- printf("- Interior: %d", INT);
- printf("- Virtual World: %d", VW);
- print("--------------------------------------------");
- #endif
- return 1;
- }
- print("E Impossibile Creare Un Negozio. Controlla Di Avere Le Seguenti Cartelle In Scriptfiles:");
- print("SasiHouses ------>");
- print(" Houses");
- print(" Stores");
- print(" Users");
- return 0;
- }
- /*
- OpenHouseDialog
- Function: Shows the dialog.
- Parameters:
- -playerid: The ID of the player.
- -houseid: The ID of the house.
- Returns:
- -true(1): When the house is for sale.
- -null(-1): When the house is bought.
- -false(0): When the house is bought and playerid is the owner.
- */
- stock OpenHouseDialog(playerid, houseid)
- {
- if(strcmp(hInfo[houseid][Name], "ForSale",true) == 0)
- {
- new string[180];
- if(GetPlayerMoney(playerid) >= hInfo[houseid][Cost]) { format(string,sizeof(string),"{33AA33}Compra Questa Casa Per $%d", hInfo[houseid][Cost]); }
- else { format(string,sizeof(string),"{FF0000}Compra Questa Casa Per $%d", hInfo[houseid][Cost]); }
- ShowPlayerDialog(playerid, DIALOG_FORSALE_HOUSE, DIALOG_STYLE_LIST, "{33AA33}Casa In Vendita!", string, "OK", "Chiudi");
- return 1;
- }
- else
- {
- new string2[180];
- new name[24];
- GetPlayerName(playerid,name,sizeof(name));
- if(strcmp(hInfo[houseid][Name], name, true) == 0)
- {
- ShowPlayerDialog(playerid, DIALOG_MY_HOUSE,DIALOG_STYLE_LIST, "{33AA33}Bentornato A Casa", "{33AA33}Entra In Casa\n{33AA33}Apri/Chiudi A Chiave La Porta\n{33AA33}Rivendi La Tua Casa", "OK", "Chiudi");
- return 0;
- }
- else
- {
- if(hInfo[houseid][Locked] == 1) { format(string2, sizeof(string2), "{FF0000}Entra In Questa Casa");}
- else { format(string2, sizeof(string2), "{33AA33}Entra In Questa Casa"); }
- new string3[256];
- format(string3,sizeof(string3), "{33AA33}Casa ID %d", houseid);
- ShowPlayerDialog(playerid, DIALOG_OTHERS_HOUSE,DIALOG_STYLE_LIST, string3, string2, "OK", "Chiudi");
- return -1;
- }
- }
- }
- /*
- OpenBusinessDialog
- Function: Shows the dialog.
- Parameters:
- -playerid: The ID of the player.
- -bizid: The ID of the business.
- Returns:
- -true(1): When the biz is for sale.
- -null(-1): When the biz is bought.
- -false(0): When the biz is bought and playerid is the owner.
- */
- stock OpenBusinessDialog(playerid, bizid)
- {
- if(strcmp(bInfo[bizid][bName], "ForSale",true) == 0)
- {
- new string[256];
- new str2[180];
- if(GetPlayerMoney(playerid) >= bInfo[bizid][bCost]) { format(string,sizeof(string),"{33AA33}Entra In Questo Negozio\n{33AA33}Compra Questo Negozio Per $%d", bInfo[bizid][bCost]); }
- else { format(string,sizeof(string),"{33AA33}Entra In Questo Negozio\n{FF0000}Compra Questo Negozio Per $%d", bInfo[bizid][bCost]); }
- format(str2,sizeof(str2),"{FF0000}\"%s\" {33AA33}Negozio In Vendita!",bInfo[bizid][bTitle]);
- ShowPlayerDialog(playerid, DIALOG_FORSALE_STORE, DIALOG_STYLE_LIST, str2, string, "OK", "Chiudi");
- return 1;
- }
- else
- {
- new string[180];
- new string2[180];
- new name[24];
- GetPlayerName(playerid,name,sizeof(name));
- if(strcmp(bInfo[bizid][bName], name, true) == 0)
- {
- new str[1001];
- new str2[256];
- format(str,sizeof(str), "{0000FF}\"%s\" - Merci Rimanenti: %d", bInfo[bizid][bTitle], bInfo[bizid][bRifornimenti]);
- if(bInfo[bizid][bCashRegister] == 0)
- {
- format(str2,sizeof(str2),"{33AA33}Entra Nel Tuo Negozio\n{33AA33}Apri/Chiudi Il Tuo Negozio\n{33AA33}Rinomina Il Tuo Negozio\n{FF0000}Ritira Incasso\n{33AA33}Rifornisci Il Negozio\n{33AA33}Vendi Il Negozio");
- }
- else
- {
- format(str2,sizeof(str2),"{33AA33}Entra Nel Tuo Negozio\n{33AA33}Apri/Chiudi Il Tuo Negozio\n{33AA33}Rinomina Il Tuo Negozio\n{33AA33}Ritira Incasso\n{33AA33}Rifornisci Il Negozio\n{33AA33}Vendi Il Negozio");
- }
- ShowPlayerDialog(playerid, DIALOG_MY_STORE, DIALOG_STYLE_LIST, str, str2, "OK", "Chiudi");
- return 0;
- }
- else
- {
- format(string, sizeof(string), "%s -=-=- Costo Entrata: {33AA33}$%d", bInfo[bizid][bTitle], bInfo[bizid][bEnter]);
- if(bInfo[bizid][bLocked] == 1) { format(string2, sizeof(string2), "{FF0000}Entra In Questo Negozio");}
- else { format(string2, sizeof(string2), "{33AA33}Entra In Questo Negozio"); }
- ShowPlayerDialog(playerid, DIALOG_OTHERS_STORE, DIALOG_STYLE_LIST, string, string2, "OK", "Chiudi");
- return -1;
- }
- }
- }
- /*
- GetHouseID
- Function: Gets the house ID of the player.
- Parameters:
- -playerid: The ID of the player.
- Returns:
- -houseid(): When playerid is near to any house pickup
- -invalid(-255): When playerid isn't near to any house
- */
- stock GetHouseID(playerid)
- {
- for(new i=0; i<MAX_HOUSES; i++)
- {
- if(IsPlayerNearPoint(2.0, playerid, hInfo[i][ExteriorX], hInfo[i][ExteriorY], hInfo[i][ExteriorZ]))
- {
- return i;
- }
- }
- return INVALID_HOUSE_ID;
- }
- /*
- GetBizID
- Function: Gets the biz ID of the player.
- Parameters:
- -playerid: The ID of the player.
- Returns:
- -bizid): When playerid is near to any biz pickup
- -invalid(-255): When playerid isn't near to any biz
- */
- stock GetBizID(playerid)
- {
- for(new i=0; i<MAX_HOUSES; i++)
- {
- if(IsPlayerNearPoint(2.0, playerid, bInfo[i][bExteriorX], bInfo[i][bExteriorY], bInfo[i][bExteriorZ]))
- {
- return i;
- }
- }
- return INVALID_HOUSE_ID;
- }
- /*
- IsPlayerNearPoint
- Function: Returns wheter playerid is near a point
- Parameters:
- -radi: The radius of the sphere.
- -playerid: The ID of the player.
- -x, y, z: The coordinates of the second point
- Returns:
- -true: When playerid is connected and near x,y,z
- -false: When playerid is connected but isn't near x,y,z
- -null: When playerid isn't connected
- */
- stock IsPlayerNearPoint(Float:radi, playerid, Float:x, Float:y, Float:z)
- {
- if(IsPlayerConnected(playerid))
- {
- new Float:oldposx, Float:oldposy, Float:oldposz;
- new Float:tempposx, Float:tempposy, Float:tempposz;
- GetPlayerPos(playerid, oldposx, oldposy, oldposz);
- tempposx = (oldposx -x);
- tempposy = (oldposy -y);
- tempposz = (oldposz -z);
- if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
- {
- return 1;
- }
- return 0;
- }
- return -1;
- }
- /*
- BuyHouse
- Function: The player buys the house
- Parameters:
- -playerid: The ID of the player.
- -houseid: The ID of the house.
- Returns:
- -true(1): When bought successfully
- -false(0): When an error has occurred
- */
- stock BuyHouse(playerid, houseid)
- {
- new string2[256];
- new name[24];
- GetPlayerName(playerid, name, sizeof(name));
- #if defined PRINT_HOUSES
- printf("%s Ha Comprato La Casa ID %d", name, houseid);
- #endif
- GivePlayerMoney(playerid, -hInfo[houseid][Cost]);
- format(string2,sizeof(string2), HOUSE_FILE, houseid);
- INI_Open(string2);
- INI_WriteString("Name", name);
- INI_WriteInt("Locked", 0);
- INI_Save();
- INI_Close();
- hInfo[houseid][Name] = name;
- hInfo[houseid][Locked] = 0;
- DestroyPickup(HousePickup[houseid]);
- HousePickup[houseid] = CreatePickup(1272, 23, hInfo[houseid][ExteriorX], hInfo[houseid][ExteriorY], hInfo[houseid][ExteriorZ]);
- ShowBoughtHouseMessage(playerid);
- return 1;
- }
- /*
- BuyBusiness
- Function: The player buys the biz
- Parameters:
- -playerid: The ID of the player.
- -bizid: The ID of the biz.
- Returns:
- -true(1): When bought successfully
- -false(0): When an error has occurred
- */
- stock BuyBusiness(playerid, bizid)
- {
- new string2[256];
- new name[24];
- GetPlayerName(playerid, name, sizeof(name));
- #if defined PRINT_HOUSES
- printf("%s Ha Comprato Il Negozio ID %d", name, bizid);
- #endif
- GivePlayerMoney(playerid, -bInfo[bizid][bCost]);
- format(string2,sizeof(string2), BIZ_FILE, bizid);
- INI_Open(string2);
- INI_WriteString("Name", name);
- INI_WriteInt("Locked", 0);
- INI_Save();
- INI_Close();
- bInfo[bizid][bName] = name;
- bInfo[bizid][bLocked] = 0;
- ResetBusinessMoney(bizid);
- ShowBoughtStoreMessage(playerid);
- return 1;
- }
- /*
- SellHouse
- Function: The player sells the house
- Parameters:
- -playerid: The ID of the player.
- -houseid: The ID of the house.
- Returns:
- -true(1): When sold successfully
- -false(0): When an error has occurred
- */
- stock SellHouse(playerid, houseid)
- {
- new string[256];
- new name[24];
- GetPlayerName(playerid, name, sizeof(name));
- format(string,sizeof(string),HOUSE_FILE, houseid);
- INI_Open(string);
- INI_WriteString("Name","ForSale");
- INI_WriteInt("Locked", 1);
- INI_Save();
- INI_Close();
- #if defined PRINT_HOUSES
- printf("%s Ha Venduto La Casa ID %d", name, houseid);
- #endif
- GivePlayerMoney(playerid, hInfo[houseid][Sell]);
- hInfo[houseid][Locked] = 1;
- format(hInfo[houseid][Name], 255, "ForSale");
- DestroyPickup(HousePickup[houseid]);
- HousePickup[houseid] = CreatePickup(1273, 23, hInfo[houseid][ExteriorX], hInfo[houseid][ExteriorY], hInfo[houseid][ExteriorZ]);
- ShowSoldHouseMessage(playerid);
- return 1;
- }
- /*
- SellBusiness
- Function: The player sells the business
- Parameters:
- -playerid: The ID of the player.
- -bizid: The ID of the biz.
- Returns:
- -true(1): When sold successfully
- -false(0): When an error has occurred
- */
- stock SellBusiness(playerid, bizid)
- {
- new string[256];
- new name[24];
- GetPlayerName(playerid, name, sizeof(name));
- format(string,sizeof(string),BIZ_FILE, bizid);
- INI_Open(string);
- INI_WriteString("Name","ForSale");
- INI_WriteInt("Locked", 1);
- INI_Save();
- INI_Close();
- #if defined PRINT_HOUSES
- printf("%s Ha Venduto Il Negozio ID %d", name, bizid);
- #endif
- GivePlayerMoney(playerid, bInfo[bizid][bSell]);
- bInfo[bizid][bLocked] = 0;
- format(bInfo[bizid][bName], 255, "ForSale");
- ShowSoldStoreMessage(playerid);
- return 1;
- }
- /*
- EnterHouse
- Function: The player enters the house
- Parameters:
- -playerid: The ID of the player.
- -houseid: The ID of the house.
- Returns:
- -true(1): Everyway
- */
- stock EnterHouse(playerid, houseid)
- {
- SetPlayerPos(playerid, hInfo[houseid][InteriorX], hInfo[houseid][InteriorY], hInfo[houseid][InteriorZ]);
- SetPlayerInterior(playerid, hInfo[houseid][Interior]);
- SetPlayerVirtualWorld(playerid, hInfo[houseid][VirtualWorld]);
- LastHouse[playerid] = houseid;
- return 1;
- }
- /*
- EnterBusiness
- Function: The player enters the business
- Parameters:
- -playerid: The ID of the player.
- -bizid: The ID of the biz.
- Returns:
- -true(1): Everyway
- */
- stock EnterBusiness(playerid, bizid)
- {
- new name[24];
- GetPlayerName(playerid,name,sizeof(name));
- if(strcmp(bInfo[bizid][bName], name, true) != 0)
- {
- if(bInfo[bizid][bRifornimenti] <= 0 && strcmp(bInfo[bizid][bName], "ForSale", true) != 0) return ShowNoGoodsMessage(playerid);
- if(GetPlayerMoney(playerid) < bInfo[bizid][bEnter]) return ShowNoMoneyMessage(playerid);
- GivePlayerMoney(playerid, -bInfo[bizid][bEnter]);
- AddBusinessMoney(bizid, bInfo[bizid][bEnter]);
- }
- else
- {
- if(bInfo[bizid][bRifornimenti] <= 0) ShowOwnerNoGoodsMessage(playerid);
- }
- SetPlayerPos(playerid, bInfo[bizid][bInteriorX], bInfo[bizid][bInteriorY], bInfo[bizid][bInteriorZ]);
- SetPlayerInterior(playerid, bInfo[bizid][bInterior]);
- SetPlayerVirtualWorld(playerid, bInfo[bizid][bVirtualWorld]);
- new string[180];
- format(string,sizeof(string),"Benvenuto A %s!", bInfo[bizid][bTitle]);
- ShowPlayerDialog(playerid,1499,DIALOG_STYLE_MSGBOX, string, "", "OK", "");
- return 1;
- }
- /*
- ExitHouse
- Function: The player exits the house
- Parameters:
- -playerid: The ID of the player.
- -houseid: The ID of the house.
- Returns:
- -true(1): Everyway
- */
- stock ExitHouse(playerid, houseid)
- {
- SetPlayerPos(playerid, hInfo[houseid][ExteriorX], hInfo[houseid][ExteriorY], hInfo[houseid][ExteriorZ]);
- SetPlayerInterior(playerid, hInfo[houseid][Exterior]);
- SetPlayerVirtualWorld(playerid, 0);
- LastHouse[playerid] = INVALID_HOUSE_ID;
- return 1;
- }
- /*
- ExitBusiness
- Function: The player exits the business
- Parameters:
- -playerid: The ID of the player.
- -bizid: The ID of the biz.
- Returns:
- -true(1): Everyway
- */
- stock ExitBusiness(playerid, bizid)
- {
- SetPlayerPos(playerid, bInfo[bizid][bExteriorX], bInfo[bizid][bExteriorY], bInfo[bizid][bExteriorZ]);
- SetPlayerInterior(playerid, 0);
- SetPlayerVirtualWorld(playerid, 0);
- new name[24];
- GetPlayerName(playerid, name, 24);
- if(strcmp(bInfo[bizid][bName], name, true) != 0 && strcmp(bInfo[bizid][bName], "ForSale", true) != 0) bInfo[bizid][bRifornimenti] -= 1;
- return 1;
- }
- stock GetBusinessMoney(playerid, bizid)
- {
- if(bInfo[bizid][bCashRegister] == 0)
- {
- ShowPlayerDialog(playerid, 1499, DIALOG_STYLE_MSGBOX, "{FF0000}ERRORE", "Il Registratore Di Cassa E' Vuoto!", "OK", "");
- return 0;
- }
- new string2[180];
- GivePlayerMoney(playerid, bInfo[bizid][bCashRegister]);
- format(string2, sizeof(string2), "$%d Ritirati Dal Registratore Di Cassa!", bInfo[bizid][bCashRegister]);
- ShowPlayerDialog(playerid, 1499, DIALOG_STYLE_MSGBOX, "{33AA33}COMANDO", string2, "OK", "");
- new string[180];
- bInfo[bizid][bCashRegister] = 0;
- format(string,sizeof(string),BIZ_FILE, bizid);
- INI_Open(string);
- INI_WriteInt("Money", bInfo[bizid][bCashRegister]);
- INI_Save();
- INI_Close();
- return 1;
- }
- stock ResetBusinessMoney(bizid)
- {
- new string[180];
- bInfo[bizid][bCashRegister] = 0;
- format(string,sizeof(string), BIZ_FILE, bizid);
- INI_Open(string);
- INI_WriteInt("Money", 0);
- INI_Save();
- INI_Close();
- return 1;
- }
- public AddBusinessMoney(bizid, money)
- {
- if(bInfo[bizid][bRifornimenti] <= 0)
- {
- bInfo[bizid][bRifornimenti] = 0;
- return 1;
- }
- new string[180];
- bInfo[bizid][bCashRegister] += money;
- bInfo[bizid][bRifornimenti] -= money/1000;
- format(string, sizeof(string), BIZ_FILE, bizid);
- INI_Open(string);
- INI_WriteInt("Money", bInfo[bizid][bCashRegister]);
- INI_WriteInt("Merci", bInfo[bizid][bRifornimenti]);
- INI_Save();
- INI_Close();
- return 1;
- }
- public SaveHouseAndStoreInformation()
- {
- new string[180];
- for(new i=0;i<MAX_HOUSES;i++)
- {
- if(hInfo[i][InteriorX] != 0.0)
- {
- format(string,sizeof(string), HOUSE_FILE, i);
- INI_Open(string);
- INI_WriteInt("Locked", bInfo[i][bLocked]);
- INI_Save();
- INI_Close();
- }
- }
- for(new i=0;i<MAX_BUSINESSES;i++)
- {
- if(bInfo[i][bInteriorX] != 0.0)
- {
- format(string,sizeof(string), BIZ_FILE, i);
- INI_Open(string);
- INI_WriteInt("Locked", bInfo[i][bLocked]);
- INI_WriteInt("Merci", bInfo[i][bRifornimenti]);
- INI_Save();
- INI_Close();
- }
- }
- return 1;
- }
- //MESSAGES
- stock ShowLockedHouseMessage(playerid)
- {
- ShowPlayerDialog(playerid, 1499, DIALOG_STYLE_MSGBOX, "{FF0000}ERRORE","La Porta E' Chiusa A Chiave!","OK","");
- return 1;
- }
- stock ShowLockedStoreMessage(playerid)
- {
- ShowPlayerDialog(playerid, 1499, DIALOG_STYLE_MSGBOX, "{FF0000}ERRORE","Ci Dispiace Ma Questo Negozio E' Chiuso. Torna Piu Tardi.","OK","");
- return 1;
- }
- stock ShowNoMoneyMessage(playerid)
- {
- ShowPlayerDialog(playerid, 1499, DIALOG_STYLE_MSGBOX, "{FF0000}ERRORE","Non Hai Abbastanza Soldi!","OK","");
- return 1;
- }
- stock ShowNoGoodsMessage(playerid)
- {
- ShowPlayerDialog(playerid, 1499, DIALOG_STYLE_MSGBOX, "{FF0000}ERRORE","Ci Dispiace Ma Questo Negozio Ha Esaurito Le Merci.","OK","");
- return 1;
- }
- stock ShowOwnerNoGoodsMessage(playerid)
- {
- ShowPlayerDialog(playerid, 1499, DIALOG_STYLE_MSGBOX, "{FFAA00}WARNING","Il Tuo Negozio Non Ha Rifornimenti.","OK","");
- return 1;
- }
- stock ShowSoldHouseMessage(playerid)
- {
- new string[51];
- format(string,sizeof(string),"Casa Venduta Per $%d!", hInfo[GetHouseID(playerid)][Sell]);
- ShowPlayerDialog(playerid, 1499, DIALOG_STYLE_MSGBOX, "{33AA33}COMANDO", string, "OK", "");
- return 1;
- }
- stock ShowSoldStoreMessage(playerid)
- {
- new string[51];
- format(string,sizeof(string),"Negozio Venduto Per $%d!", hInfo[GetHouseID(playerid)][Sell]);
- ShowPlayerDialog(playerid, 1499, DIALOG_STYLE_MSGBOX, "{33AA33}COMANDO", string, "OK", "");
- return 1;
- }
- stock ShowBoughtHouseMessage(playerid)
- {
- new string[51];
- format(string,sizeof(string),"Casa Acquistata Per $%d!", hInfo[GetHouseID(playerid)][Cost]);
- ShowPlayerDialog(playerid, 1499, DIALOG_STYLE_MSGBOX, "{33AA33}COMANDO", string, "OK", "");
- return 1;
- }
- stock ShowBoughtStoreMessage(playerid)
- {
- new string[51];
- format(string,sizeof(string),"Negozio Acquistato Per $%d!", hInfo[GetHouseID(playerid)][Cost]);
- ShowPlayerDialog(playerid, 1499, DIALOG_STYLE_MSGBOX, "{33AA33}COMANDO", string, "OK", "");
- return 1;
- }
- stock LockYourHouseMessage(playerid)
- {
- ShowPlayerDialog(playerid, 1499, DIALOG_STYLE_MSGBOX, "{33AA33}COMANDO","Hai Chiuso A Chiave La Porta!","OK","");
- return 1;
- }
- stock LockYourStoreMessage(playerid)
- {
- ShowPlayerDialog(playerid, 1499, DIALOG_STYLE_MSGBOX, "{33AA33}COMANDO","Hai Chiuso Il Negozio!","OK","");
- return 1;
- }
- stock UnlockYourHouseMessage(playerid)
- {
- ShowPlayerDialog(playerid, 1499, DIALOG_STYLE_MSGBOX, "{33AA33}COMANDO","Hai Aperto La Porta!","OK","");
- return 1;
- }
- stock UnlockYourStoreMessage(playerid)
- {
- ShowPlayerDialog(playerid, 1499, DIALOG_STYLE_MSGBOX, "{33AA33}COMANDO","Hai Aperto Il Negozio!","OK","");
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement