Advertisement
Guest User

bizz system

a guest
Aug 27th, 2022
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 119.46 KB | None | 0 0
  1. /*
  2. /hwithdraw - changed to /hdeposit
  3. /hdeposit - changed to /hwithdraw
  4. -Fixed my bad english. Special thanks to Pillhead2007
  5. -Fixed bug with /removehouse (Added to destroy MapIcon)
  6. -Fixed bug with labels,pickups on coordinates 0,0,0
  7. */
  8. #define filterscript
  9. #define SSCANF_NO_NICE_FEATURES
  10. #include <a_samp>
  11. #include <foreach>
  12. #include <sscanf2>
  13. #include <YSI_Storage/y_ini>
  14. #include <YSI_Visual/y_commands>
  15. #include <streamer>
  16.  
  17. #define MAX_HOUSE 500 //This is limit u can change
  18. #define House_File "House/%d.ini" //Place where save houses
  19. #define FILE_FOR_PLAYER "House/Player/%s.ini"
  20. #define DIALOG_HOUSE 1391//Dialog for house
  21. #define MAX_DAYS 7
  22. //-Colors-
  23. #define COL_YELLOW "{F5E618}"
  24. #define COL_GREEN "{2EAD15}"
  25. #define COL_WHITE "{FFFFFF}"
  26. #define COL_BLUE "{345ACF}"
  27. #define COLOR_RED 0xE01B4CFF
  28. #define COLOR_PURPLE 0xC21BE0
  29. #define randomEx(%0,%1) (random((%1) - (%0)) + (%0))
  30. new bool:False = false, _S_T_R_[128];
  31. #define SendFormatMSG(%0,%1,%2,%3)\
  32. do{\
  33. format(_S_T_R_, sizeof (_S_T_R_), (%2), %3);\
  34. SendClientMessage((%0),(%1), _S_T_R_);\
  35. }\
  36. while (False)
  37.  
  38. new Text:LockTD0[MAX_PLAYERS],
  39. Text:LockTD1[MAX_PLAYERS],
  40. Text:LockTD2[MAX_PLAYERS],
  41. Text:LockTD3[MAX_PLAYERS],
  42. Text:LockTD4[MAX_PLAYERS],
  43. Text:LockTD5[MAX_PLAYERS],
  44. Text:LockTD6[MAX_PLAYERS],
  45. Text:Phone0[MAX_PLAYERS],
  46. Text:Phone1[MAX_PLAYERS],
  47. Text:Phone2[MAX_PLAYERS],
  48. Text:Phone3[MAX_PLAYERS],
  49. Text:Phone4[MAX_PLAYERS],
  50. Text:Phone5[MAX_PLAYERS],
  51. Text:hUp[MAX_PLAYERS],
  52. Choose[MAX_PLAYERS],
  53. TypeText[5][MAX_PLAYERS],
  54. HouseOwner[32][MAX_VEHICLES],
  55. ChooseInt[MAX_PLAYERS],
  56. HouseID1[MAX_PLAYERS],
  57. PhoneChoose[MAX_PLAYERS],
  58. Calling[MAX_PLAYERS],
  59. TalkWith[MAX_PLAYERS],
  60. CallFrom[MAX_PLAYERS],
  61. PlayerCP[MAX_PLAYERS];
  62.  
  63. enum plinfo
  64. {
  65. Float:SpawnX,
  66. Float:SpawnY,
  67. Float:SpawnZ,
  68. SpawnInt,
  69. SpawnVW,
  70. Spawn,
  71. RobHouse,
  72. Houseid,
  73. Sec,
  74. Min,
  75. }
  76. new Player[MAX_PLAYERS][plinfo];
  77. enum house
  78. {
  79. Float:EnterX,
  80. Float:EnterY,
  81. Float:EnterZ,
  82. Float:ExitX,
  83. Float:ExitY,
  84. Float:ExitZ,
  85. Text3D:DLabel,
  86. PickupU,
  87. HouseName[48],
  88. Owner[32],
  89. IntID,
  90. VW,
  91. On_Sell,
  92. Price,
  93. Level,
  94. Lock,
  95. LockPass[5],
  96. RentPrice,
  97. Player_Rent[48],
  98. Money,
  99. Gun1,
  100. Gun2,
  101. Ammo1,
  102. Ammo2,
  103. Icon,
  104. Float:hCarX,
  105. Float:hCarY,
  106. Float:hCarZ,
  107. Float:hCarA,
  108. hCarC1,
  109. hCarC2,
  110. hCarID,
  111. hCar,
  112. hCarMoney,
  113. hCarGun1,
  114. hCarGun2,
  115. hCarAmmo1,
  116. hCarAmmo2,
  117. PhoneNum[5],
  118. Address[48],
  119. DayEnter,
  120. MonthEnter,
  121. }
  122. new House[MAX_HOUSE][house];
  123.  
  124. enum MainZone
  125. {
  126. Zone_Name[28],
  127. Float:Zone_Area[6]
  128. };
  129.  
  130. static const SanAndreasZones[][MainZone] = {
  131.  
  132. {"The Big Ear", {-410.00,1403.30,-3.00,-137.90,1681.20,200.00}},
  133. {"Aldea Malvada", {-1372.10,2498.50,0.00,-1277.50,2615.30,200.00}},
  134. {"Angel Pine", {-2324.90,-2584.20,-6.10,-1964.20,-2212.10,200.00}},
  135. {"Arco del Oeste", {-901.10,2221.80,0.00,-592.00,2571.90,200.00}},
  136. {"Avispa Country Club", {-2646.40,-355.40,0.00,-2270.00,-222.50,200.00}},
  137. {"Avispa Country Club", {-2831.80,-430.20,-6.10,-2646.40,-222.50,200.00}},
  138. {"Avispa Country Club", {-2361.50,-417.10,0.00,-2270.00,-355.40,200.00}},
  139. {"Avispa Country Club", {-2667.80,-302.10,-28.80,-2646.40,-262.30,71.10}},
  140. {"Avispa Country Club", {-2470.00,-355.40,0.00,-2270.00,-318.40,46.10}},
  141. {"Avispa Country Club", {-2550.00,-355.40,0.00,-2470.00,-318.40,39.70}},
  142. {"Back o Beyond", {-1166.90,-2641.10,0.00,-321.70,-1856.00,200.00}},
  143. {"Battery Point", {-2741.00,1268.40,-4.50,-2533.00,1490.40,200.00}},
  144. {"Bayside", {-2741.00,2175.10,0.00,-2353.10,2722.70,200.00}},
  145. {"Bayside Marina", {-2353.10,2275.70,0.00,-2153.10,2475.70,200.00}},
  146. {"Beacon Hill", {-399.60,-1075.50,-1.40,-319.00,-977.50,198.50}},
  147. {"Blackfield", {964.30,1203.20,-89.00,1197.30,1403.20,110.90}},
  148. {"Blackfield", {964.30,1403.20,-89.00,1197.30,1726.20,110.90}},
  149. {"Blackfield Chapel", {1375.60,596.30,-89.00,1558.00,823.20,110.90}},
  150. {"Blackfield Chapel", {1325.60,596.30,-89.00,1375.60,795.00,110.90}},
  151. {"Blackfield Intersection", {1197.30,1044.60,-89.00,1277.00,1163.30,110.90}},
  152. {"Blackfield Intersection", {1166.50,795.00,-89.00,1375.60,1044.60,110.90}},
  153. {"Blackfield Intersection", {1277.00,1044.60,-89.00,1315.30,1087.60,110.90}},
  154. {"Blackfield Intersection", {1375.60,823.20,-89.00,1457.30,919.40,110.90}},
  155. {"Blueberry", {104.50,-220.10,2.30,349.60,152.20,200.00}},
  156. {"Blueberry", {19.60,-404.10,3.80,349.60,-220.10,200.00}},
  157. {"Blueberry Acres", {-319.60,-220.10,0.00,104.50,293.30,200.00}},
  158. {"Caligula's Palace", {2087.30,1543.20,-89.00,2437.30,1703.20,110.90}},
  159. {"Caligula's Palace", {2137.40,1703.20,-89.00,2437.30,1783.20,110.90}},
  160. {"Calton Heights", {-2274.10,744.10,-6.10,-1982.30,1358.90,200.00}},
  161. {"Chinatown", {-2274.10,578.30,-7.60,-2078.60,744.10,200.00}},
  162. {"City Hall", {-2867.80,277.40,-9.10,-2593.40,458.40,200.00}},
  163. {"Come-A-Lot", {2087.30,943.20,-89.00,2623.10,1203.20,110.90}},
  164. {"Commerce", {1323.90,-1842.20,-89.00,1701.90,-1722.20,110.90}},
  165. {"Commerce", {1323.90,-1722.20,-89.00,1440.90,-1577.50,110.90}},
  166. {"Commerce", {1370.80,-1577.50,-89.00,1463.90,-1384.90,110.90}},
  167. {"Commerce", {1463.90,-1577.50,-89.00,1667.90,-1430.80,110.90}},
  168. {"Commerce", {1583.50,-1722.20,-89.00,1758.90,-1577.50,110.90}},
  169. {"Commerce", {1667.90,-1577.50,-89.00,1812.60,-1430.80,110.90}},
  170. {"Conference Center", {1046.10,-1804.20,-89.00,1323.90,-1722.20,110.90}},
  171. {"Conference Center", {1073.20,-1842.20,-89.00,1323.90,-1804.20,110.90}},
  172. {"Cranberry Station", {-2007.80,56.30,0.00,-1922.00,224.70,100.00}},
  173. {"Creek", {2749.90,1937.20,-89.00,2921.60,2669.70,110.90}},
  174. {"Dillimore", {580.70,-674.80,-9.50,861.00,-404.70,200.00}},
  175. {"Doherty", {-2270.00,-324.10,-0.00,-1794.90,-222.50,200.00}},
  176. {"Doherty", {-2173.00,-222.50,-0.00,-1794.90,265.20,200.00}},
  177. {"Downtown", {-1982.30,744.10,-6.10,-1871.70,1274.20,200.00}},
  178. {"Downtown", {-1871.70,1176.40,-4.50,-1620.30,1274.20,200.00}},
  179. {"Downtown", {-1700.00,744.20,-6.10,-1580.00,1176.50,200.00}},
  180. {"Downtown", {-1580.00,744.20,-6.10,-1499.80,1025.90,200.00}},
  181. {"Downtown", {-2078.60,578.30,-7.60,-1499.80,744.20,200.00}},
  182. {"Downtown", {-1993.20,265.20,-9.10,-1794.90,578.30,200.00}},
  183. {"Downtown Los Santos", {1463.90,-1430.80,-89.00,1724.70,-1290.80,110.90}},
  184. {"Downtown Los Santos", {1724.70,-1430.80,-89.00,1812.60,-1250.90,110.90}},
  185. {"Downtown Los Santos", {1463.90,-1290.80,-89.00,1724.70,-1150.80,110.90}},
  186. {"Downtown Los Santos", {1370.80,-1384.90,-89.00,1463.90,-1170.80,110.90}},
  187. {"Downtown Los Santos", {1724.70,-1250.90,-89.00,1812.60,-1150.80,110.90}},
  188. {"Downtown Los Santos", {1370.80,-1170.80,-89.00,1463.90,-1130.80,110.90}},
  189. {"Downtown Los Santos", {1378.30,-1130.80,-89.00,1463.90,-1026.30,110.90}},
  190. {"Downtown Los Santos", {1391.00,-1026.30,-89.00,1463.90,-926.90,110.90}},
  191. {"Downtown Los Santos", {1507.50,-1385.20,110.90,1582.50,-1325.30,335.90}},
  192. {"East Beach", {2632.80,-1852.80,-89.00,2959.30,-1668.10,110.90}},
  193. {"East Beach", {2632.80,-1668.10,-89.00,2747.70,-1393.40,110.90}},
  194. {"East Beach", {2747.70,-1668.10,-89.00,2959.30,-1498.60,110.90}},
  195. {"East Beach", {2747.70,-1498.60,-89.00,2959.30,-1120.00,110.90}},
  196. {"East Los Santos", {2421.00,-1628.50,-89.00,2632.80,-1454.30,110.90}},
  197. {"East Los Santos", {2222.50,-1628.50,-89.00,2421.00,-1494.00,110.90}},
  198. {"East Los Santos", {2266.20,-1494.00,-89.00,2381.60,-1372.00,110.90}},
  199. {"East Los Santos", {2381.60,-1494.00,-89.00,2421.00,-1454.30,110.90}},
  200. {"East Los Santos", {2281.40,-1372.00,-89.00,2381.60,-1135.00,110.90}},
  201. {"East Los Santos", {2381.60,-1454.30,-89.00,2462.10,-1135.00,110.90}},
  202. {"East Los Santos", {2462.10,-1454.30,-89.00,2581.70,-1135.00,110.90}},
  203. {"Easter Basin", {-1794.90,249.90,-9.10,-1242.90,578.30,200.00}},
  204. {"Easter Basin", {-1794.90,-50.00,-0.00,-1499.80,249.90,200.00}},
  205. {"Easter Bay Airport", {-1499.80,-50.00,-0.00,-1242.90,249.90,200.00}},
  206. {"Easter Bay Airport", {-1794.90,-730.10,-3.00,-1213.90,-50.00,200.00}},
  207. {"Easter Bay Airport", {-1213.90,-730.10,0.00,-1132.80,-50.00,200.00}},
  208. {"Easter Bay Airport", {-1242.90,-50.00,0.00,-1213.90,578.30,200.00}},
  209. {"Easter Bay Airport", {-1213.90,-50.00,-4.50,-947.90,578.30,200.00}},
  210. {"Easter Bay Airport", {-1315.40,-405.30,15.40,-1264.40,-209.50,25.40}},
  211. {"Easter Bay Airport", {-1354.30,-287.30,15.40,-1315.40,-209.50,25.40}},
  212. {"Easter Bay Airport", {-1490.30,-209.50,15.40,-1264.40,-148.30,25.40}},
  213. {"Easter Bay Chemicals", {-1132.80,-768.00,0.00,-956.40,-578.10,200.00}},
  214. {"Easter Bay Chemicals", {-1132.80,-787.30,0.00,-956.40,-768.00,200.00}},
  215. {"El Castillo del Diablo", {-464.50,2217.60,0.00,-208.50,2580.30,200.00}},
  216. {"El Castillo del Diablo", {-208.50,2123.00,-7.60,114.00,2337.10,200.00}},
  217. {"El Castillo del Diablo", {-208.50,2337.10,0.00,8.40,2487.10,200.00}},
  218. {"El Corona", {1812.60,-2179.20,-89.00,1970.60,-1852.80,110.90}},
  219. {"El Corona", {1692.60,-2179.20,-89.00,1812.60,-1842.20,110.90}},
  220. {"El Quebrados", {-1645.20,2498.50,0.00,-1372.10,2777.80,200.00}},
  221. {"Esplanade East", {-1620.30,1176.50,-4.50,-1580.00,1274.20,200.00}},
  222. {"Esplanade East", {-1580.00,1025.90,-6.10,-1499.80,1274.20,200.00}},
  223. {"Esplanade East", {-1499.80,578.30,-79.60,-1339.80,1274.20,20.30}},
  224. {"Esplanade North", {-2533.00,1358.90,-4.50,-1996.60,1501.20,200.00}},
  225. {"Esplanade North", {-1996.60,1358.90,-4.50,-1524.20,1592.50,200.00}},
  226. {"Esplanade North", {-1982.30,1274.20,-4.50,-1524.20,1358.90,200.00}},
  227. {"Fallen Tree", {-792.20,-698.50,-5.30,-452.40,-380.00,200.00}},
  228. {"Fallow Bridge", {434.30,366.50,0.00,603.00,555.60,200.00}},
  229. {"Fern Ridge", {508.10,-139.20,0.00,1306.60,119.50,200.00}},
  230. {"Financial", {-1871.70,744.10,-6.10,-1701.30,1176.40,300.00}},
  231. {"Fisher's Lagoon", {1916.90,-233.30,-100.00,2131.70,13.80,200.00}},
  232. {"Flint Intersection", {-187.70,-1596.70,-89.00,17.00,-1276.60,110.90}},
  233. {"Flint Range", {-594.10,-1648.50,0.00,-187.70,-1276.60,200.00}},
  234. {"Fort Carson", {-376.20,826.30,-3.00,123.70,1220.40,200.00}},
  235. {"Foster Valley", {-2270.00,-430.20,-0.00,-2178.60,-324.10,200.00}},
  236. {"Foster Valley", {-2178.60,-599.80,-0.00,-1794.90,-324.10,200.00}},
  237. {"Foster Valley", {-2178.60,-1115.50,0.00,-1794.90,-599.80,200.00}},
  238. {"Foster Valley", {-2178.60,-1250.90,0.00,-1794.90,-1115.50,200.00}},
  239. {"Frederick Bridge", {2759.20,296.50,0.00,2774.20,594.70,200.00}},
  240. {"Gant Bridge", {-2741.40,1659.60,-6.10,-2616.40,2175.10,200.00}},
  241. {"Gant Bridge", {-2741.00,1490.40,-6.10,-2616.40,1659.60,200.00}},
  242. {"Ganton", {2222.50,-1852.80,-89.00,2632.80,-1722.30,110.90}},
  243. {"Ganton", {2222.50,-1722.30,-89.00,2632.80,-1628.50,110.90}},
  244. {"Garcia", {-2411.20,-222.50,-0.00,-2173.00,265.20,200.00}},
  245. {"Garcia", {-2395.10,-222.50,-5.30,-2354.00,-204.70,200.00}},
  246. {"Garver Bridge", {-1339.80,828.10,-89.00,-1213.90,1057.00,110.90}},
  247. {"Garver Bridge", {-1213.90,950.00,-89.00,-1087.90,1178.90,110.90}},
  248. {"Garver Bridge", {-1499.80,696.40,-179.60,-1339.80,925.30,20.30}},
  249. {"Glen Park", {1812.60,-1449.60,-89.00,1996.90,-1350.70,110.90}},
  250. {"Glen Park", {1812.60,-1100.80,-89.00,1994.30,-973.30,110.90}},
  251. {"Glen Park", {1812.60,-1350.70,-89.00,2056.80,-1100.80,110.90}},
  252. {"Green Palms", {176.50,1305.40,-3.00,338.60,1520.70,200.00}},
  253. {"Greenglass College", {964.30,1044.60,-89.00,1197.30,1203.20,110.90}},
  254. {"Greenglass College", {964.30,930.80,-89.00,1166.50,1044.60,110.90}},
  255. {"Hampton Barns", {603.00,264.30,0.00,761.90,366.50,200.00}},
  256. {"Hankypanky Point", {2576.90,62.10,0.00,2759.20,385.50,200.00}},
  257. {"Harry Gold Parkway", {1777.30,863.20,-89.00,1817.30,2342.80,110.90}},
  258. {"Hashbury", {-2593.40,-222.50,-0.00,-2411.20,54.70,200.00}},
  259. {"Hilltop Farm", {967.30,-450.30,-3.00,1176.70,-217.90,200.00}},
  260. {"Hunter Quarry", {337.20,710.80,-115.20,860.50,1031.70,203.70}},
  261. {"Idlewood", {1812.60,-1852.80,-89.00,1971.60,-1742.30,110.90}},
  262. {"Idlewood", {1812.60,-1742.30,-89.00,1951.60,-1602.30,110.90}},
  263. {"Idlewood", {1951.60,-1742.30,-89.00,2124.60,-1602.30,110.90}},
  264. {"Idlewood", {1812.60,-1602.30,-89.00,2124.60,-1449.60,110.90}},
  265. {"Idlewood", {2124.60,-1742.30,-89.00,2222.50,-1494.00,110.90}},
  266. {"Idlewood", {1971.60,-1852.80,-89.00,2222.50,-1742.30,110.90}},
  267. {"Jefferson", {1996.90,-1449.60,-89.00,2056.80,-1350.70,110.90}},
  268. {"Jefferson", {2124.60,-1494.00,-89.00,2266.20,-1449.60,110.90}},
  269. {"Jefferson", {2056.80,-1372.00,-89.00,2281.40,-1210.70,110.90}},
  270. {"Jefferson", {2056.80,-1210.70,-89.00,2185.30,-1126.30,110.90}},
  271. {"Jefferson", {2185.30,-1210.70,-89.00,2281.40,-1154.50,110.90}},
  272. {"Jefferson", {2056.80,-1449.60,-89.00,2266.20,-1372.00,110.90}},
  273. {"Julius Thruway East", {2623.10,943.20,-89.00,2749.90,1055.90,110.90}},
  274. {"Julius Thruway East", {2685.10,1055.90,-89.00,2749.90,2626.50,110.90}},
  275. {"Julius Thruway East", {2536.40,2442.50,-89.00,2685.10,2542.50,110.90}},
  276. {"Julius Thruway East", {2625.10,2202.70,-89.00,2685.10,2442.50,110.90}},
  277. {"Julius Thruway North", {2498.20,2542.50,-89.00,2685.10,2626.50,110.90}},
  278. {"Julius Thruway North", {2237.40,2542.50,-89.00,2498.20,2663.10,110.90}},
  279. {"Julius Thruway North", {2121.40,2508.20,-89.00,2237.40,2663.10,110.90}},
  280. {"Julius Thruway North", {1938.80,2508.20,-89.00,2121.40,2624.20,110.90}},
  281. {"Julius Thruway North", {1534.50,2433.20,-89.00,1848.40,2583.20,110.90}},
  282. {"Julius Thruway North", {1848.40,2478.40,-89.00,1938.80,2553.40,110.90}},
  283. {"Julius Thruway North", {1704.50,2342.80,-89.00,1848.40,2433.20,110.90}},
  284. {"Julius Thruway North", {1377.30,2433.20,-89.00,1534.50,2507.20,110.90}},
  285. {"Julius Thruway South", {1457.30,823.20,-89.00,2377.30,863.20,110.90}},
  286. {"Julius Thruway South", {2377.30,788.80,-89.00,2537.30,897.90,110.90}},
  287. {"Julius Thruway West", {1197.30,1163.30,-89.00,1236.60,2243.20,110.90}},
  288. {"Julius Thruway West", {1236.60,2142.80,-89.00,1297.40,2243.20,110.90}},
  289. {"Juniper Hill", {-2533.00,578.30,-7.60,-2274.10,968.30,200.00}},
  290. {"Juniper Hollow", {-2533.00,968.30,-6.10,-2274.10,1358.90,200.00}},
  291. {"K.A.C.C. Military Fuels", {2498.20,2626.50,-89.00,2749.90,2861.50,110.90}},
  292. {"Kincaid Bridge", {-1339.80,599.20,-89.00,-1213.90,828.10,110.90}},
  293. {"Kincaid Bridge", {-1213.90,721.10,-89.00,-1087.90,950.00,110.90}},
  294. {"Kincaid Bridge", {-1087.90,855.30,-89.00,-961.90,986.20,110.90}},
  295. {"King's", {-2329.30,458.40,-7.60,-1993.20,578.30,200.00}},
  296. {"King's", {-2411.20,265.20,-9.10,-1993.20,373.50,200.00}},
  297. {"King's", {-2253.50,373.50,-9.10,-1993.20,458.40,200.00}},
  298. {"LVA Freight Depot", {1457.30,863.20,-89.00,1777.40,1143.20,110.90}},
  299. {"LVA Freight Depot", {1375.60,919.40,-89.00,1457.30,1203.20,110.90}},
  300. {"LVA Freight Depot", {1277.00,1087.60,-89.00,1375.60,1203.20,110.90}},
  301. {"LVA Freight Depot", {1315.30,1044.60,-89.00,1375.60,1087.60,110.90}},
  302. {"LVA Freight Depot", {1236.60,1163.40,-89.00,1277.00,1203.20,110.90}},
  303. {"Las Barrancas", {-926.10,1398.70,-3.00,-719.20,1634.60,200.00}},
  304. {"Las Brujas", {-365.10,2123.00,-3.00,-208.50,2217.60,200.00}},
  305. {"Las Colinas", {1994.30,-1100.80,-89.00,2056.80,-920.80,110.90}},
  306. {"Las Colinas", {2056.80,-1126.30,-89.00,2126.80,-920.80,110.90}},
  307. {"Las Colinas", {2185.30,-1154.50,-89.00,2281.40,-934.40,110.90}},
  308. {"Las Colinas", {2126.80,-1126.30,-89.00,2185.30,-934.40,110.90}},
  309. {"Las Colinas", {2747.70,-1120.00,-89.00,2959.30,-945.00,110.90}},
  310. {"Las Colinas", {2632.70,-1135.00,-89.00,2747.70,-945.00,110.90}},
  311. {"Las Colinas", {2281.40,-1135.00,-89.00,2632.70,-945.00,110.90}},
  312. {"Las Payasadas", {-354.30,2580.30,2.00,-133.60,2816.80,200.00}},
  313. {"Las Venturas Airport", {1236.60,1203.20,-89.00,1457.30,1883.10,110.90}},
  314. {"Las Venturas Airport", {1457.30,1203.20,-89.00,1777.30,1883.10,110.90}},
  315. {"Las Venturas Airport", {1457.30,1143.20,-89.00,1777.40,1203.20,110.90}},
  316. {"Las Venturas Airport", {1515.80,1586.40,-12.50,1729.90,1714.50,87.50}},
  317. {"Last Dime Motel", {1823.00,596.30,-89.00,1997.20,823.20,110.90}},
  318. {"Leafy Hollow", {-1166.90,-1856.00,0.00,-815.60,-1602.00,200.00}},
  319. {"Liberty City", {-1000.00,400.00,1300.00,-700.00,600.00,1400.00}},
  320. {"Lil' Probe Inn", {-90.20,1286.80,-3.00,153.80,1554.10,200.00}},
  321. {"Linden Side", {2749.90,943.20,-89.00,2923.30,1198.90,110.90}},
  322. {"Linden Station", {2749.90,1198.90,-89.00,2923.30,1548.90,110.90}},
  323. {"Linden Station", {2811.20,1229.50,-39.50,2861.20,1407.50,60.40}},
  324. {"Little Mexico", {1701.90,-1842.20,-89.00,1812.60,-1722.20,110.90}},
  325. {"Little Mexico", {1758.90,-1722.20,-89.00,1812.60,-1577.50,110.90}},
  326. {"Los Flores", {2581.70,-1454.30,-89.00,2632.80,-1393.40,110.90}},
  327. {"Los Flores", {2581.70,-1393.40,-89.00,2747.70,-1135.00,110.90}},
  328. {"Los Santos International", {1249.60,-2394.30,-89.00,1852.00,-2179.20,110.90}},
  329. {"Los Santos International", {1852.00,-2394.30,-89.00,2089.00,-2179.20,110.90}},
  330. {"Los Santos International", {1382.70,-2730.80,-89.00,2201.80,-2394.30,110.90}},
  331. {"Los Santos International", {1974.60,-2394.30,-39.00,2089.00,-2256.50,60.90}},
  332. {"Los Santos International", {1400.90,-2669.20,-39.00,2189.80,-2597.20,60.90}},
  333. {"Los Santos International", {2051.60,-2597.20,-39.00,2152.40,-2394.30,60.90}},
  334. {"Marina", {647.70,-1804.20,-89.00,851.40,-1577.50,110.90}},
  335. {"Marina", {647.70,-1577.50,-89.00,807.90,-1416.20,110.90}},
  336. {"Marina", {807.90,-1577.50,-89.00,926.90,-1416.20,110.90}},
  337. {"Market", {787.40,-1416.20,-89.00,1072.60,-1310.20,110.90}},
  338. {"Market", {952.60,-1310.20,-89.00,1072.60,-1130.80,110.90}},
  339. {"Market", {1072.60,-1416.20,-89.00,1370.80,-1130.80,110.90}},
  340. {"Market", {926.90,-1577.50,-89.00,1370.80,-1416.20,110.90}},
  341. {"Market Station", {787.40,-1410.90,-34.10,866.00,-1310.20,65.80}},
  342. {"Martin Bridge", {-222.10,293.30,0.00,-122.10,476.40,200.00}},
  343. {"Missionary Hill", {-2994.40,-811.20,0.00,-2178.60,-430.20,200.00}},
  344. {"Montgomery", {1119.50,119.50,-3.00,1451.40,493.30,200.00}},
  345. {"Montgomery", {1451.40,347.40,-6.10,1582.40,420.80,200.00}},
  346. {"Montgomery Intersection", {1546.60,208.10,0.00,1745.80,347.40,200.00}},
  347. {"Montgomery Intersection", {1582.40,347.40,0.00,1664.60,401.70,200.00}},
  348. {"Mulholland", {1414.00,-768.00,-89.00,1667.60,-452.40,110.90}},
  349. {"Mulholland", {1281.10,-452.40,-89.00,1641.10,-290.90,110.90}},
  350. {"Mulholland", {1269.10,-768.00,-89.00,1414.00,-452.40,110.90}},
  351. {"Mulholland", {1357.00,-926.90,-89.00,1463.90,-768.00,110.90}},
  352. {"Mulholland", {1318.10,-910.10,-89.00,1357.00,-768.00,110.90}},
  353. {"Mulholland", {1169.10,-910.10,-89.00,1318.10,-768.00,110.90}},
  354. {"Mulholland", {768.60,-954.60,-89.00,952.60,-860.60,110.90}},
  355. {"Mulholland", {687.80,-860.60,-89.00,911.80,-768.00,110.90}},
  356. {"Mulholland", {737.50,-768.00,-89.00,1142.20,-674.80,110.90}},
  357. {"Mulholland", {1096.40,-910.10,-89.00,1169.10,-768.00,110.90}},
  358. {"Mulholland", {952.60,-937.10,-89.00,1096.40,-860.60,110.90}},
  359. {"Mulholland", {911.80,-860.60,-89.00,1096.40,-768.00,110.90}},
  360. {"Mulholland", {861.00,-674.80,-89.00,1156.50,-600.80,110.90}},
  361. {"Mulholland Intersection", {1463.90,-1150.80,-89.00,1812.60,-768.00,110.90}},
  362. {"North Rock", {2285.30,-768.00,0.00,2770.50,-269.70,200.00}},
  363. {"Ocean Docks", {2373.70,-2697.00,-89.00,2809.20,-2330.40,110.90}},
  364. {"Ocean Docks", {2201.80,-2418.30,-89.00,2324.00,-2095.00,110.90}},
  365. {"Ocean Docks", {2324.00,-2302.30,-89.00,2703.50,-2145.10,110.90}},
  366. {"Ocean Docks", {2089.00,-2394.30,-89.00,2201.80,-2235.80,110.90}},
  367. {"Ocean Docks", {2201.80,-2730.80,-89.00,2324.00,-2418.30,110.90}},
  368. {"Ocean Docks", {2703.50,-2302.30,-89.00,2959.30,-2126.90,110.90}},
  369. {"Ocean Docks", {2324.00,-2145.10,-89.00,2703.50,-2059.20,110.90}},
  370. {"Ocean Flats", {-2994.40,277.40,-9.10,-2867.80,458.40,200.00}},
  371. {"Ocean Flats", {-2994.40,-222.50,-0.00,-2593.40,277.40,200.00}},
  372. {"Ocean Flats", {-2994.40,-430.20,-0.00,-2831.80,-222.50,200.00}},
  373. {"Octane Springs", {338.60,1228.50,0.00,664.30,1655.00,200.00}},
  374. {"Old Venturas Strip", {2162.30,2012.10,-89.00,2685.10,2202.70,110.90}},
  375. {"Palisades", {-2994.40,458.40,-6.10,-2741.00,1339.60,200.00}},
  376. {"Palomino Creek", {2160.20,-149.00,0.00,2576.90,228.30,200.00}},
  377. {"Paradiso", {-2741.00,793.40,-6.10,-2533.00,1268.40,200.00}},
  378. {"Pershing Square", {1440.90,-1722.20,-89.00,1583.50,-1577.50,110.90}},
  379. {"Pilgrim", {2437.30,1383.20,-89.00,2624.40,1783.20,110.90}},
  380. {"Pilgrim", {2624.40,1383.20,-89.00,2685.10,1783.20,110.90}},
  381. {"Pilson Intersection", {1098.30,2243.20,-89.00,1377.30,2507.20,110.90}},
  382. {"Pirates in Men's Pants", {1817.30,1469.20,-89.00,2027.40,1703.20,110.90}},
  383. {"Playa del Seville", {2703.50,-2126.90,-89.00,2959.30,-1852.80,110.90}},
  384. {"Prickle Pine", {1534.50,2583.20,-89.00,1848.40,2863.20,110.90}},
  385. {"Prickle Pine", {1117.40,2507.20,-89.00,1534.50,2723.20,110.90}},
  386. {"Prickle Pine", {1848.40,2553.40,-89.00,1938.80,2863.20,110.90}},
  387. {"Prickle Pine", {1938.80,2624.20,-89.00,2121.40,2861.50,110.90}},
  388. {"Queens", {-2533.00,458.40,0.00,-2329.30,578.30,200.00}},
  389. {"Queens", {-2593.40,54.70,0.00,-2411.20,458.40,200.00}},
  390. {"Queens", {-2411.20,373.50,0.00,-2253.50,458.40,200.00}},
  391. {"Randolph Industrial", {1558.00,596.30,-89.00,1823.00,823.20,110.90}},
  392. {"Redsands East", {1817.30,2011.80,-89.00,2106.70,2202.70,110.90}},
  393. {"Redsands East", {1817.30,2202.70,-89.00,2011.90,2342.80,110.90}},
  394. {"Redsands East", {1848.40,2342.80,-89.00,2011.90,2478.40,110.90}},
  395. {"Redsands West", {1236.60,1883.10,-89.00,1777.30,2142.80,110.90}},
  396. {"Redsands West", {1297.40,2142.80,-89.00,1777.30,2243.20,110.90}},
  397. {"Redsands West", {1377.30,2243.20,-89.00,1704.50,2433.20,110.90}},
  398. {"Redsands West", {1704.50,2243.20,-89.00,1777.30,2342.80,110.90}},
  399. {"Regular Tom", {-405.70,1712.80,-3.00,-276.70,1892.70,200.00}},
  400. {"Richman", {647.50,-1118.20,-89.00,787.40,-954.60,110.90}},
  401. {"Richman", {647.50,-954.60,-89.00,768.60,-860.60,110.90}},
  402. {"Richman", {225.10,-1369.60,-89.00,334.50,-1292.00,110.90}},
  403. {"Richman", {225.10,-1292.00,-89.00,466.20,-1235.00,110.90}},
  404. {"Richman", {72.60,-1404.90,-89.00,225.10,-1235.00,110.90}},
  405. {"Richman", {72.60,-1235.00,-89.00,321.30,-1008.10,110.90}},
  406. {"Richman", {321.30,-1235.00,-89.00,647.50,-1044.00,110.90}},
  407. {"Richman", {321.30,-1044.00,-89.00,647.50,-860.60,110.90}},
  408. {"Richman", {321.30,-860.60,-89.00,687.80,-768.00,110.90}},
  409. {"Richman", {321.30,-768.00,-89.00,700.70,-674.80,110.90}},
  410. {"Robada Intersection", {-1119.00,1178.90,-89.00,-862.00,1351.40,110.90}},
  411. {"Roca Escalante", {2237.40,2202.70,-89.00,2536.40,2542.50,110.90}},
  412. {"Roca Escalante", {2536.40,2202.70,-89.00,2625.10,2442.50,110.90}},
  413. {"Rockshore East", {2537.30,676.50,-89.00,2902.30,943.20,110.90}},
  414. {"Rockshore West", {1997.20,596.30,-89.00,2377.30,823.20,110.90}},
  415. {"Rockshore West", {2377.30,596.30,-89.00,2537.30,788.80,110.90}},
  416. {"Rodeo", {72.60,-1684.60,-89.00,225.10,-1544.10,110.90}},
  417. {"Rodeo", {72.60,-1544.10,-89.00,225.10,-1404.90,110.90}},
  418. {"Rodeo", {225.10,-1684.60,-89.00,312.80,-1501.90,110.90}},
  419. {"Rodeo", {225.10,-1501.90,-89.00,334.50,-1369.60,110.90}},
  420. {"Rodeo", {334.50,-1501.90,-89.00,422.60,-1406.00,110.90}},
  421. {"Rodeo", {312.80,-1684.60,-89.00,422.60,-1501.90,110.90}},
  422. {"Rodeo", {422.60,-1684.60,-89.00,558.00,-1570.20,110.90}},
  423. {"Rodeo", {558.00,-1684.60,-89.00,647.50,-1384.90,110.90}},
  424. {"Rodeo", {466.20,-1570.20,-89.00,558.00,-1385.00,110.90}},
  425. {"Rodeo", {422.60,-1570.20,-89.00,466.20,-1406.00,110.90}},
  426. {"Rodeo", {466.20,-1385.00,-89.00,647.50,-1235.00,110.90}},
  427. {"Rodeo", {334.50,-1406.00,-89.00,466.20,-1292.00,110.90}},
  428. {"Royal Casino", {2087.30,1383.20,-89.00,2437.30,1543.20,110.90}},
  429. {"San Andreas Sound", {2450.30,385.50,-100.00,2759.20,562.30,200.00}},
  430. {"Santa Flora", {-2741.00,458.40,-7.60,-2533.00,793.40,200.00}},
  431. {"Santa Maria Beach", {342.60,-2173.20,-89.00,647.70,-1684.60,110.90}},
  432. {"Santa Maria Beach", {72.60,-2173.20,-89.00,342.60,-1684.60,110.90}},
  433. {"Shady Cabin", {-1632.80,-2263.40,-3.00,-1601.30,-2231.70,200.00}},
  434. {"Shady Creeks", {-1820.60,-2643.60,-8.00,-1226.70,-1771.60,200.00}},
  435. {"Shady Creeks", {-2030.10,-2174.80,-6.10,-1820.60,-1771.60,200.00}},
  436. {"Sobell Rail Yards", {2749.90,1548.90,-89.00,2923.30,1937.20,110.90}},
  437. {"Spinybed", {2121.40,2663.10,-89.00,2498.20,2861.50,110.90}},
  438. {"Starfish Casino", {2437.30,1783.20,-89.00,2685.10,2012.10,110.90}},
  439. {"Starfish Casino", {2437.30,1858.10,-39.00,2495.00,1970.80,60.90}},
  440. {"Starfish Casino", {2162.30,1883.20,-89.00,2437.30,2012.10,110.90}},
  441. {"Temple", {1252.30,-1130.80,-89.00,1378.30,-1026.30,110.90}},
  442. {"Temple", {1252.30,-1026.30,-89.00,1391.00,-926.90,110.90}},
  443. {"Temple", {1252.30,-926.90,-89.00,1357.00,-910.10,110.90}},
  444. {"Temple", {952.60,-1130.80,-89.00,1096.40,-937.10,110.90}},
  445. {"Temple", {1096.40,-1130.80,-89.00,1252.30,-1026.30,110.90}},
  446. {"Temple", {1096.40,-1026.30,-89.00,1252.30,-910.10,110.90}},
  447. {"The Camel's Toe", {2087.30,1203.20,-89.00,2640.40,1383.20,110.90}},
  448. {"The Clown's Pocket", {2162.30,1783.20,-89.00,2437.30,1883.20,110.90}},
  449. {"The Emerald Isle", {2011.90,2202.70,-89.00,2237.40,2508.20,110.90}},
  450. {"The Farm", {-1209.60,-1317.10,114.90,-908.10,-787.30,251.90}},
  451. {"Four Dragons Casino", {1817.30,863.20,-89.00,2027.30,1083.20,110.90}},
  452. {"The High Roller", {1817.30,1283.20,-89.00,2027.30,1469.20,110.90}},
  453. {"The Mako Span", {1664.60,401.70,0.00,1785.10,567.20,200.00}},
  454. {"The Panopticon", {-947.90,-304.30,-1.10,-319.60,327.00,200.00}},
  455. {"The Pink Swan", {1817.30,1083.20,-89.00,2027.30,1283.20,110.90}},
  456. {"The Sherman Dam", {-968.70,1929.40,-3.00,-481.10,2155.20,200.00}},
  457. {"The Strip", {2027.40,863.20,-89.00,2087.30,1703.20,110.90}},
  458. {"The Strip", {2106.70,1863.20,-89.00,2162.30,2202.70,110.90}},
  459. {"The Strip", {2027.40,1783.20,-89.00,2162.30,1863.20,110.90}},
  460. {"The Strip", {2027.40,1703.20,-89.00,2137.40,1783.20,110.90}},
  461. {"The Visage", {1817.30,1863.20,-89.00,2106.70,2011.80,110.90}},
  462. {"The Visage", {1817.30,1703.20,-89.00,2027.40,1863.20,110.90}},
  463. {"Unity Station", {1692.60,-1971.80,-20.40,1812.60,-1932.80,79.50}},
  464. {"Valle Ocultado", {-936.60,2611.40,2.00,-715.90,2847.90,200.00}},
  465. {"Verdant Bluffs", {930.20,-2488.40,-89.00,1249.60,-2006.70,110.90}},
  466. {"Verdant Bluffs", {1073.20,-2006.70,-89.00,1249.60,-1842.20,110.90}},
  467. {"Verdant Bluffs", {1249.60,-2179.20,-89.00,1692.60,-1842.20,110.90}},
  468. {"Verdant Meadows", {37.00,2337.10,-3.00,435.90,2677.90,200.00}},
  469. {"Verona Beach", {647.70,-2173.20,-89.00,930.20,-1804.20,110.90}},
  470. {"Verona Beach", {930.20,-2006.70,-89.00,1073.20,-1804.20,110.90}},
  471. {"Verona Beach", {851.40,-1804.20,-89.00,1046.10,-1577.50,110.90}},
  472. {"Verona Beach", {1161.50,-1722.20,-89.00,1323.90,-1577.50,110.90}},
  473. {"Verona Beach", {1046.10,-1722.20,-89.00,1161.50,-1577.50,110.90}},
  474. {"Vinewood", {787.40,-1310.20,-89.00,952.60,-1130.80,110.90}},
  475. {"Vinewood", {787.40,-1130.80,-89.00,952.60,-954.60,110.90}},
  476. {"Vinewood", {647.50,-1227.20,-89.00,787.40,-1118.20,110.90}},
  477. {"Vinewood", {647.70,-1416.20,-89.00,787.40,-1227.20,110.90}},
  478. {"Whitewood Estates", {883.30,1726.20,-89.00,1098.30,2507.20,110.90}},
  479. {"Whitewood Estates", {1098.30,1726.20,-89.00,1197.30,2243.20,110.90}},
  480. {"Willowfield", {1970.60,-2179.20,-89.00,2089.00,-1852.80,110.90}},
  481. {"Willowfield", {2089.00,-2235.80,-89.00,2201.80,-1989.90,110.90}},
  482. {"Willowfield", {2089.00,-1989.90,-89.00,2324.00,-1852.80,110.90}},
  483. {"Willowfield", {2201.80,-2095.00,-89.00,2324.00,-1989.90,110.90}},
  484. {"Willowfield", {2541.70,-1941.40,-89.00,2703.50,-1852.80,110.90}},
  485. {"Willowfield", {2324.00,-2059.20,-89.00,2541.70,-1852.80,110.90}},
  486. {"Willowfield", {2541.70,-2059.20,-89.00,2703.50,-1941.40,110.90}},
  487. {"Yellow Bell Station", {1377.40,2600.40,-21.90,1492.40,2687.30,78.00}},
  488. // Citys Zones
  489. {"Los Santos", {44.60,-2892.90,-242.90,2997.00,-768.00,900.00}},
  490. {"Las Venturas", {869.40,596.30,-242.90,2997.00,2993.80,900.00}},
  491. {"Bone County", {-480.50,596.30,-242.90,869.40,2993.80,900.00}},
  492. {"Tierra Robada", {-2997.40,1659.60,-242.90,-480.50,2993.80,900.00}},
  493. {"Tierra Robada", {-1213.90,596.30,-242.90,-480.50,1659.60,900.00}},
  494. {"San Fierro", {-2997.40,-1115.50,-242.90,-1213.90,1659.60,900.00}},
  495. {"Red County", {-1213.90,-768.00,-242.90,2997.00,596.30,900.00}},
  496. {"Flint County", {-1213.90,-2892.90,-242.90,44.60,-768.00,900.00}},
  497. {"Whetstone", {-2997.40,-2892.90,-242.90,-1213.90,-1115.50,900.00}}
  498. };
  499.  
  500.  
  501. public OnFilterScriptInit()
  502. {
  503. print("\n--------------------------------------");
  504. print(" Gagi's House System by: Mr.Gagi(Gagi_Corleone)");
  505. print("--------------------------------------\n");
  506. DisableInteriorEnterExits();
  507. SetTimer("GlobalTimer",1000,true);
  508. for(new i = 0; i <= MAX_HOUSE; i++)
  509. {
  510. new gFile[35];
  511. format(gFile, 35, House_File ,i);
  512. if(fexist(gFile))
  513. {
  514. INI_ParseFile(gFile, "LoadHouse", .bExtra = true, .extra = i);
  515. ReadHouse(i);
  516. }
  517. }
  518. return 1;
  519. }
  520.  
  521. public OnFilterScriptExit()
  522. {
  523. return 1;
  524. }
  525.  
  526. main()
  527. {
  528. print("\n----------------------------------");
  529. print(" Blank Gamemode by your name here");
  530. print("----------------------------------\n");
  531. }
  532.  
  533.  
  534. public OnGameModeInit()
  535. {
  536. AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  537. return 1;
  538. }
  539.  
  540. public OnGameModeExit()
  541. {
  542. return 1;
  543. }
  544.  
  545. public OnPlayerRequestClass(playerid, classid)
  546. {
  547. SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
  548. SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
  549. SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
  550. return 1;
  551. }
  552.  
  553. public OnPlayerConnect(playerid)
  554. {
  555. Player[playerid][Houseid] = 999;
  556. Phone0[playerid] = TextDrawCreate(48.000000, 150.000000, "~n~");
  557. TextDrawBackgroundColor(Phone0[playerid], 255);
  558. TextDrawFont(Phone0[playerid], 1);
  559. TextDrawLetterSize(Phone0[playerid], 0.500000, 14.199999);
  560. TextDrawColor(Phone0[playerid], -1);
  561. TextDrawSetOutline(Phone0[playerid], 0);
  562. TextDrawSetProportional(Phone0[playerid], 1);
  563. TextDrawSetShadow(Phone0[playerid], 1);
  564. TextDrawUseBox(Phone0[playerid], 1);
  565. TextDrawBoxColor(Phone0[playerid], 100);
  566. TextDrawTextSize(Phone0[playerid], 130.000000, 0.000000);
  567.  
  568. Phone1[playerid] = TextDrawCreate(59.000000, 216.000000, "1 2 3~n~4 5 6~n~7 8 9~n~* 0 #");
  569. TextDrawBackgroundColor(Phone1[playerid], 255);
  570. TextDrawFont(Phone1[playerid], 1);
  571. TextDrawLetterSize(Phone1[playerid], 0.559997, 1.299998);
  572. TextDrawColor(Phone1[playerid], -1);
  573. TextDrawSetOutline(Phone1[playerid], 0);
  574. TextDrawSetProportional(Phone1[playerid], 1);
  575. TextDrawSetShadow(Phone1[playerid], 1);
  576.  
  577. Phone2[playerid] = TextDrawCreate(56.000000, 170.000000, "~n~");
  578. TextDrawBackgroundColor(Phone2[playerid], 255);
  579. TextDrawFont(Phone2[playerid], 1);
  580. TextDrawLetterSize(Phone2[playerid], 1.000000, 4.000000);
  581. TextDrawColor(Phone2[playerid], -1);
  582. TextDrawSetOutline(Phone2[playerid], 0);
  583. TextDrawSetProportional(Phone2[playerid], 1);
  584. TextDrawSetShadow(Phone2[playerid], 1);
  585. TextDrawUseBox(Phone2[playerid], 1);
  586. TextDrawBoxColor(Phone2[playerid], 310843903);
  587. TextDrawTextSize(Phone2[playerid], 119.000000, 0.000000);
  588.  
  589. Phone3[playerid] = TextDrawCreate(120.000000, 126.000000, "~n~");
  590. TextDrawBackgroundColor(Phone3[playerid], 255);
  591. TextDrawFont(Phone3[playerid], 1);
  592. TextDrawLetterSize(Phone3[playerid], 0.500000, 2.000000);
  593. TextDrawColor(Phone3[playerid], -1);
  594. TextDrawSetOutline(Phone3[playerid], 0);
  595. TextDrawSetProportional(Phone3[playerid], 1);
  596. TextDrawSetShadow(Phone3[playerid], 1);
  597. TextDrawUseBox(Phone3[playerid], 1);
  598. TextDrawBoxColor(Phone3[playerid], 100);
  599. TextDrawTextSize(Phone3[playerid], 120.000000, 0.000000);
  600.  
  601. Phone4[playerid] = TextDrawCreate(53.000000, 182.000000, "Call 1111");
  602. TextDrawBackgroundColor(Phone4[playerid], 255);
  603. TextDrawFont(Phone4[playerid], 2);
  604. TextDrawLetterSize(Phone4[playerid], 0.289999, 1.000000);
  605. TextDrawColor(Phone4[playerid], -1);
  606. TextDrawSetOutline(Phone4[playerid], 1);
  607. TextDrawSetProportional(Phone4[playerid], 1);
  608.  
  609. Phone5[playerid] = TextDrawCreate(69.000000, 150.000000, "ooo~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~ooo");
  610. TextDrawBackgroundColor(Phone5[playerid], 255);
  611. TextDrawFont(Phone5[playerid], 1);
  612. TextDrawLetterSize(Phone5[playerid], 0.500000, 1.000000);
  613. TextDrawColor(Phone5[playerid], -1);
  614. TextDrawSetOutline(Phone5[playerid], 1);
  615. TextDrawSetProportional(Phone5[playerid], 1);
  616.  
  617. hUp[playerid] = TextDrawCreate(260.000000, 363.000000, " House Upgrade~n~~n~~r~< ~w~Price: ~g~$90000 ~r~>");
  618. TextDrawBackgroundColor(hUp[playerid], 255);
  619. TextDrawFont(hUp[playerid], 2);
  620. TextDrawLetterSize(hUp[playerid], 0.349999, 1.200000);
  621. TextDrawColor(hUp[playerid], -1);
  622. TextDrawSetOutline(hUp[playerid], 1);
  623. TextDrawSetProportional(hUp[playerid], 1);
  624.  
  625. LockTD0[playerid] = TextDrawCreate(37.000000, 150.000000, "~n~");
  626. TextDrawBackgroundColor(LockTD0[playerid], 255);
  627. TextDrawFont(LockTD0[playerid], 1);
  628. TextDrawLetterSize(LockTD0[playerid], 0.500000, 6.899999);
  629. TextDrawColor(LockTD0[playerid], -1);
  630. TextDrawSetOutline(LockTD0[playerid], 0);
  631. TextDrawSetProportional(LockTD0[playerid], 1);
  632. TextDrawSetShadow(LockTD0[playerid], 1);
  633. TextDrawUseBox(LockTD0[playerid], 1);
  634. TextDrawBoxColor(LockTD0[playerid], -206);
  635. TextDrawTextSize(LockTD0[playerid], 150.000000, 0.000000);
  636.  
  637. LockTD1[playerid] = TextDrawCreate(47.000000, 162.000000, "~n~");
  638. TextDrawBackgroundColor(LockTD1[playerid], 255);
  639. TextDrawFont(LockTD1[playerid], 1);
  640. TextDrawLetterSize(LockTD1[playerid], 0.500000, 3.399998);
  641. TextDrawColor(LockTD1[playerid], -1);
  642. TextDrawSetOutline(LockTD1[playerid], 0);
  643. TextDrawSetProportional(LockTD1[playerid], 1);
  644. TextDrawSetShadow(LockTD1[playerid], 1);
  645. TextDrawUseBox(LockTD1[playerid], 1);
  646. TextDrawBoxColor(LockTD1[playerid], -1633968897);
  647. TextDrawTextSize(LockTD1[playerid], 79.000000, 10.000000);
  648.  
  649. LockTD2[playerid] = TextDrawCreate(45.000000, 171.000000, "1234");
  650. TextDrawBackgroundColor(LockTD2[playerid], 255);
  651. TextDrawFont(LockTD2[playerid], 3);
  652. TextDrawLetterSize(LockTD2[playerid], 0.380000, 0.899999);
  653. TextDrawColor(LockTD2[playerid], -1199695105);
  654. TextDrawSetOutline(LockTD2[playerid], 1);
  655. TextDrawSetProportional(LockTD2[playerid], 1);
  656.  
  657. LockTD3[playerid] = TextDrawCreate(95.000000, 157.000000, "~r~1 ~w~2 3~n~4 5 6~n~7 8 9~n~ 0");
  658. TextDrawBackgroundColor(LockTD3[playerid], 255);
  659. TextDrawFont(LockTD3[playerid], 1);
  660. TextDrawLetterSize(LockTD3[playerid], 0.450000, 1.000000);
  661. TextDrawColor(LockTD3[playerid], -1);
  662. TextDrawSetOutline(LockTD3[playerid], 1);
  663. TextDrawSetProportional(LockTD3[playerid], 1);
  664.  
  665. LockTD4[playerid] = TextDrawCreate(44.000000, 200.000000, "Enter Close");
  666. TextDrawBackgroundColor(LockTD4[playerid], 255);
  667. TextDrawFont(LockTD4[playerid], 1);
  668. TextDrawLetterSize(LockTD4[playerid], 0.460000, 1.000000);
  669. TextDrawColor(LockTD4[playerid], -1);
  670. TextDrawSetOutline(LockTD4[playerid], 1);
  671. TextDrawSetProportional(LockTD4[playerid], 1);
  672.  
  673. LockTD5[playerid] = TextDrawCreate(34.000000, 149.000000, "~n~");
  674. TextDrawBackgroundColor(LockTD5[playerid], 255);
  675. TextDrawFont(LockTD5[playerid], 1);
  676. TextDrawLetterSize(LockTD5[playerid], 0.500000, -0.400000);
  677. TextDrawColor(LockTD5[playerid], -1);
  678. TextDrawSetOutline(LockTD5[playerid], 0);
  679. TextDrawSetProportional(LockTD5[playerid], 1);
  680. TextDrawSetShadow(LockTD5[playerid], 1);
  681. TextDrawUseBox(LockTD5[playerid], 1);
  682. TextDrawBoxColor(LockTD5[playerid], -1166599937);
  683. TextDrawTextSize(LockTD5[playerid], 153.000000, 0.000000);
  684.  
  685. LockTD6[playerid] = TextDrawCreate(34.000000, 217.000000, "~n~");
  686. TextDrawBackgroundColor(LockTD6[playerid], 255);
  687. TextDrawFont(LockTD6[playerid], 1);
  688. TextDrawLetterSize(LockTD6[playerid], 0.500000, -0.400000);
  689. TextDrawColor(LockTD6[playerid], -1);
  690. TextDrawSetOutline(LockTD6[playerid], 0);
  691. TextDrawSetProportional(LockTD6[playerid], 1);
  692. TextDrawSetShadow(LockTD6[playerid], 1);
  693. TextDrawUseBox(LockTD6[playerid], 1);
  694. TextDrawBoxColor(LockTD6[playerid], -1166599937);
  695. TextDrawTextSize(LockTD6[playerid], 153.000000, 0.000000);
  696. new pFile[48];
  697. format(pFile, 48, FILE_FOR_PLAYER, GetName(playerid));
  698.  
  699. if(!fexist(pFile))
  700. {
  701. new
  702. INI:UserFile = INI_Open(pFile);
  703. INI_WriteFloat(UserFile, "pSpawnX", 0);
  704. INI_WriteFloat(UserFile, "pSpawnY", 0);
  705. INI_WriteFloat(UserFile, "pSpawnZ", 0);
  706. INI_WriteInt(UserFile, "pSpawn",0);
  707. INI_WriteInt(UserFile, "pSpawnInt", 0);
  708. INI_WriteInt(UserFile, "pVW", 0);
  709. INI_WriteInt(UserFile, "RobHouse", 0);
  710. INI_WriteInt(UserFile, "HouseID", 999);
  711. INI_WriteInt(UserFile, "Bill", 0);
  712. INI_Close(UserFile);
  713. }
  714. INI_ParseFile(pFile, "LoadPlayerData", .bExtra = true, .extra = playerid);
  715. return 1;
  716. }
  717.  
  718. public OnPlayerDisconnect(playerid, reason)
  719. {
  720. TextDrawDestroy(LockTD0[playerid]);
  721. TextDrawDestroy(LockTD1[playerid]);
  722. TextDrawDestroy(LockTD2[playerid]);
  723. TextDrawDestroy(LockTD3[playerid]);
  724. TextDrawDestroy(LockTD4[playerid]);
  725. TextDrawDestroy(LockTD5[playerid]);
  726. TextDrawDestroy(LockTD6[playerid]);
  727. TextDrawDestroy(hUp[playerid]);
  728. TextDrawDestroy(Phone0[playerid]);
  729. TextDrawDestroy(Phone1[playerid]);
  730. TextDrawDestroy(Phone2[playerid]);
  731. TextDrawDestroy(Phone3[playerid]);
  732. TextDrawDestroy(Phone4[playerid]);
  733. TextDrawDestroy(Phone5[playerid]);
  734. new
  735. pFile[35];
  736.  
  737. format(pFile, 35, FILE_FOR_PLAYER, GetName(playerid));
  738. new
  739. INI:UserFile = INI_Open(pFile);
  740. INI_WriteFloat(UserFile, "pSpawnX", Player[playerid][SpawnX]);
  741. INI_WriteFloat(UserFile, "pSpawnY", Player[playerid][SpawnY]);
  742. INI_WriteFloat(UserFile, "pSpawnZ", Player[playerid][SpawnZ]);
  743. INI_WriteInt(UserFile, "pSpawn", Player[playerid][Spawn]);
  744. INI_WriteInt(UserFile, "pSpawnInt", Player[playerid][SpawnInt]);
  745. INI_WriteInt(UserFile, "pVW", Player[playerid][SpawnVW]);
  746. INI_WriteInt(UserFile, "RobHouse", Player[playerid][RobHouse]);
  747. INI_WriteInt(UserFile, "HouseID", Player[playerid][Houseid]);
  748. INI_WriteInt(UserFile, "Bill", Player[playerid][Min]);
  749. INI_Close(UserFile);
  750. return 1;
  751. }
  752. forward LoadPlayerData(playerid, name[], value[]);
  753. public LoadPlayerData(playerid, name[], value[])
  754. {
  755. INI_Float("pSpawnX", Player[playerid][SpawnX]);
  756. INI_Float("pSpawnY", Player[playerid][SpawnY]);
  757. INI_Float("pSpawnZ", Player[playerid][SpawnZ]);
  758. INI_Int("pSpawn", Player[playerid][Spawn]);
  759. INI_Int("pSpawnInt", Player[playerid][SpawnInt]);
  760. INI_Int("pVW", Player[playerid][SpawnVW]);
  761. INI_Int("RobHouse", Player[playerid][RobHouse]);
  762. INI_Int("HouseID", Player[playerid][Houseid]);
  763. INI_Int("Bill", Player[playerid][Min]);
  764. return 1;
  765. }
  766. public OnPlayerSpawn(playerid)
  767. {
  768. if(Player[playerid][Spawn] == 1)
  769. {
  770. SetPlayerPos(playerid,Player[playerid][SpawnX],Player[playerid][SpawnY],Player[playerid][SpawnZ]);
  771. SetPlayerInterior(playerid,Player[playerid][SpawnInt]);
  772. SetPlayerVirtualWorld(playerid,Player[playerid][SpawnVW]);
  773. }
  774. return 1;
  775. }
  776.  
  777. public OnPlayerDeath(playerid, killerid, reason)
  778. {
  779. return 1;
  780. }
  781.  
  782. public OnVehicleSpawn(vehicleid)
  783. {
  784. return 1;
  785. }
  786.  
  787. public OnVehicleDeath(vehicleid, killerid)
  788. {
  789. return 1;
  790. }
  791.  
  792. public OnPlayerText(playerid, text[])
  793. {
  794. new string[128];
  795. if(TalkWith[playerid] != 999)
  796. {
  797. format(string,sizeof(string),"%s: %s",GetName(playerid),text);
  798. SendClientMessage(TalkWith[playerid],-1,string);
  799. }
  800. return 0;
  801. }
  802.  
  803.  
  804. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  805. {
  806. new string[64],Float:Pos[3]; GetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]);
  807. if(strcmp(HouseOwner[vehicleid],GetName(playerid),false) == 0)
  808. {
  809. }
  810. else
  811. {
  812. format(string,128,"{1BBCE0}Owner: "COL_WHITE"%s",HouseOwner[vehicleid]);
  813. SendClientMessage(playerid,-1,string);
  814. SendClientMessage(playerid,-1,"{1BBCE0}You don't have a Key.");
  815. SetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]);
  816. }
  817. return 1;
  818. }
  819.  
  820. public OnPlayerExitVehicle(playerid, vehicleid)
  821. {
  822. return 1;
  823. }
  824.  
  825. public OnPlayerStateChange(playerid, newstate, oldstate)
  826. {
  827. return 1;
  828. }
  829.  
  830. public OnPlayerEnterCheckpoint(playerid)
  831. {
  832. new i = Player[playerid][Houseid];
  833. if(PlayerCP[playerid] == 1)
  834. {
  835. if(IsPlayerInRangeOfPoint(playerid,2.0,House[i][EnterX],House[i][EnterY],House[i][EnterZ]))
  836. {
  837. DisablePlayerCheckpoint(playerid);
  838. PlayerCP[playerid] = 0;
  839. }
  840. }
  841. return 1;
  842. }
  843.  
  844. public OnPlayerLeaveCheckpoint(playerid)
  845. {
  846. return 1;
  847. }
  848.  
  849. public OnPlayerEnterRaceCheckpoint(playerid)
  850. {
  851. return 1;
  852. }
  853.  
  854. public OnPlayerLeaveRaceCheckpoint(playerid)
  855. {
  856. return 1;
  857. }
  858.  
  859. public OnRconCommand(cmd[])
  860. {
  861. return 1;
  862. }
  863.  
  864. public OnPlayerRequestSpawn(playerid)
  865. {
  866. return 1;
  867. }
  868.  
  869. public OnObjectMoved(objectid)
  870. {
  871. return 1;
  872. }
  873.  
  874. public OnPlayerObjectMoved(playerid, objectid)
  875. {
  876. return 1;
  877. }
  878.  
  879. public OnPlayerPickUpPickup(playerid, pickupid)
  880. {
  881. return 1;
  882. }
  883.  
  884. public OnVehicleMod(playerid, vehicleid, componentid)
  885. {
  886. return 1;
  887. }
  888.  
  889. public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  890. {
  891. return 1;
  892. }
  893.  
  894. public OnVehicleRespray(playerid, vehicleid, color1, color2)
  895. {
  896. return 1;
  897. }
  898.  
  899. public OnPlayerSelectedMenuRow(playerid, row)
  900. {
  901. return 1;
  902. }
  903.  
  904. public OnPlayerExitedMenu(playerid)
  905. {
  906. return 1;
  907. }
  908.  
  909. public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  910. {
  911. return 1;
  912. }
  913.  
  914. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  915. {
  916. if(newkeys == KEY_SECONDARY_ATTACK)
  917. {
  918. if(PhoneChoose[playerid] == 1)
  919. {
  920. if(strlen(TypeText[playerid]) >= 4) return SendClientMessage(playerid,COLOR_RED,"EROR: "COL_WHITE"Just 4 number please!");
  921. strcat(TypeText[playerid], "1");
  922. TextDrawSetString(Phone4[playerid],TypeText[playerid]);
  923. }
  924. else if(PhoneChoose[playerid] == 2)
  925. {
  926. if(strlen(TypeText[playerid]) >= 4) return SendClientMessage(playerid,COLOR_RED,"EROR: "COL_WHITE"Just 4 number please!");
  927. strcat(TypeText[playerid], "2");
  928. TextDrawSetString(Phone4[playerid],TypeText[playerid]);
  929. }
  930. else if(PhoneChoose[playerid] == 3)
  931. {
  932. if(strlen(TypeText[playerid]) >= 4) return SendClientMessage(playerid,COLOR_RED,"EROR: "COL_WHITE"Just 4 number please!");
  933. strcat(TypeText[playerid], "3");
  934. TextDrawSetString(Phone4[playerid],TypeText[playerid]);
  935. }
  936. else if(PhoneChoose[playerid] == 4)
  937. {
  938. if(strlen(TypeText[playerid]) >= 4) return SendClientMessage(playerid,COLOR_RED,"EROR: "COL_WHITE"Just 4 number please!");
  939. strcat(TypeText[playerid], "4");
  940. TextDrawSetString(Phone4[playerid],TypeText[playerid]);
  941. }
  942. else if(PhoneChoose[playerid] == 5)
  943. {
  944. if(strlen(TypeText[playerid]) >= 4) return SendClientMessage(playerid,COLOR_RED,"EROR: "COL_WHITE"Just 4 number please!");
  945. strcat(TypeText[playerid], "5");
  946. TextDrawSetString(Phone4[playerid],TypeText[playerid]);
  947. }
  948. else if(PhoneChoose[playerid] == 6)
  949. {
  950. if(strlen(TypeText[playerid]) >= 4) return SendClientMessage(playerid,COLOR_RED,"EROR: "COL_WHITE"Just 4 number please!");
  951. strcat(TypeText[playerid], "6");
  952. TextDrawSetString(Phone4[playerid],TypeText[playerid]);
  953. }
  954. else if(PhoneChoose[playerid] == 7)
  955. {
  956. if(strlen(TypeText[playerid]) >= 4) return SendClientMessage(playerid,COLOR_RED,"EROR: "COL_WHITE"Just 4 number please!");
  957. strcat(TypeText[playerid], "7");
  958. TextDrawSetString(Phone4[playerid],TypeText[playerid]);
  959. }
  960. else if(PhoneChoose[playerid] == 8)
  961. {
  962. if(strlen(TypeText[playerid]) >= 4) return SendClientMessage(playerid,COLOR_RED,"EROR: "COL_WHITE"Just 4 number please!");
  963. strcat(TypeText[playerid], "8");
  964. TextDrawSetString(Phone4[playerid],TypeText[playerid]);
  965. }
  966. else if(PhoneChoose[playerid] == 9)
  967. {
  968. if(strlen(TypeText[playerid]) >= 4) return SendClientMessage(playerid,COLOR_RED,"EROR: "COL_WHITE"Just 4 number please!");
  969. strcat(TypeText[playerid], "9");
  970. TextDrawSetString(Phone4[playerid],TypeText[playerid]);
  971. }
  972. else if(PhoneChoose[playerid] == 10)
  973. {
  974. new string[32];
  975. for(new id = 0; id <= MAX_HOUSE; id++)
  976. {
  977. format(string,32,House_File,id);
  978. if(!fexist(string)) continue;
  979. if(strcmp(House[id][PhoneNum],TypeText[playerid],false) == 0)
  980. {
  981. if(strcmp(House[id][Owner],"Apartment",false) == 0) continue;
  982. foreach(Player, i)
  983. {
  984. if(IsPlayerInRangeOfPoint(i,10.0,House[id][ExitX],House[id][ExitY],House[id][ExitZ]) && GetPlayerVirtualWorld(i) == House[id][VW])
  985. {
  986. PhoneChoose[playerid] = 0;
  987. TextDrawHideForPlayer(playerid,Phone0[playerid]);
  988. TextDrawHideForPlayer(playerid,Phone1[playerid]);
  989. TextDrawHideForPlayer(playerid,Phone2[playerid]);
  990. TextDrawHideForPlayer(playerid,Phone3[playerid]);
  991. TextDrawHideForPlayer(playerid,Phone4[playerid]);
  992. TextDrawHideForPlayer(playerid,Phone5[playerid]);
  993. TogglePlayerControllable(playerid,true);
  994. SendClientMessage(playerid,-1,"Calling...");
  995. SendClientMessage(playerid,-1,"Wait for answer.");
  996. Calling[playerid] = 10;
  997. CallFrom[i] = playerid;
  998. }
  999. }
  1000. }
  1001. }
  1002. }
  1003. else if(PhoneChoose[playerid] == 11)
  1004. {
  1005. if(strlen(TypeText[playerid]) >= 4) return SendClientMessage(playerid,COLOR_RED,"EROR: "COL_WHITE"Just 4 number please!");
  1006. strcat(TypeText[playerid], "0");
  1007. TextDrawSetString(Phone4[playerid],TypeText[playerid]);
  1008. }
  1009. else if(PhoneChoose[playerid] == 12)
  1010. {
  1011. PhoneChoose[playerid] = 0;
  1012. TextDrawHideForPlayer(playerid,Phone0[playerid]);
  1013. TextDrawHideForPlayer(playerid,Phone1[playerid]);
  1014. TextDrawHideForPlayer(playerid,Phone2[playerid]);
  1015. TextDrawHideForPlayer(playerid,Phone3[playerid]);
  1016. TextDrawHideForPlayer(playerid,Phone4[playerid]);
  1017. TextDrawHideForPlayer(playerid,Phone5[playerid]);
  1018. TogglePlayerControllable(playerid,true);
  1019. SendClientMessage(playerid,-1,"You are hangup phone");
  1020. }
  1021. if(ChooseInt[playerid] == 1)
  1022. {
  1023. new h = Player[playerid][Houseid];
  1024. if(GetPlayerMoney(playerid) < 15000) return SendClientMessage(playerid,COLOR_RED,"EROR: "COL_WHITE"You don't have enough money.");
  1025. House[h][ExitX] = 2496.049804;
  1026. House[h][ExitY] = -1695.238159;
  1027. House[h][ExitZ] = 1014.742187;
  1028. House[h][IntID] = 3;
  1029. SetPlayerVirtualWorld(playerid,House[h][VW]);
  1030. SetPlayerPos(playerid,House[h][ExitX],House[h][ExitY],House[h][ExitZ]);
  1031. SetPlayerInterior(playerid,House[h][IntID]);
  1032. TextDrawHideForPlayer(playerid,hUp[playerid]);
  1033. GivePlayerMoney(playerid,-15000);
  1034. ChooseInt[playerid] = 0;
  1035. CheckHouse(h);
  1036. }
  1037. else if(ChooseInt[playerid] == 2)
  1038. {
  1039. new h = Player[playerid][Houseid];
  1040. if(GetPlayerMoney(playerid) < 13000) return SendClientMessage(playerid,COLOR_RED,"EROR: "COL_WHITE"You don't have enough money.");
  1041. House[h][ExitX] = 2527.654052;
  1042. House[h][ExitY] = -1679.388305;
  1043. House[h][ExitZ] = 1015.498596;
  1044. House[h][IntID] = 1;
  1045. SetPlayerVirtualWorld(playerid,House[h][VW]);
  1046. SetPlayerPos(playerid,House[h][ExitX],House[h][ExitY],House[h][ExitZ]);
  1047. SetPlayerInterior(playerid,House[h][IntID]);
  1048. TextDrawHideForPlayer(playerid,hUp[playerid]);
  1049. GivePlayerMoney(playerid,-13000);
  1050. ChooseInt[playerid] = 0;
  1051. CheckHouse(h);
  1052. }
  1053. else if(ChooseInt[playerid] == 3)
  1054. {
  1055. new h = Player[playerid][Houseid];
  1056. if(GetPlayerMoney(playerid) < 17000) return SendClientMessage(playerid,COLOR_RED,"EROR: "COL_WHITE"You don't have enough money.");
  1057. House[h][ExitX] = 2807.619873;
  1058. House[h][ExitY] = -1171.899902;
  1059. House[h][ExitZ] = 1025.570312;
  1060. House[h][IntID] = 8;
  1061. SetPlayerVirtualWorld(playerid,House[h][VW]);
  1062. SetPlayerPos(playerid,House[h][ExitX],House[h][ExitY],House[h][ExitZ]);
  1063. SetPlayerInterior(playerid,House[h][IntID]);
  1064. TextDrawHideForPlayer(playerid,hUp[playerid]);
  1065. GivePlayerMoney(playerid,-17000);
  1066. ChooseInt[playerid] = 0;
  1067. CheckHouse(h);
  1068. }
  1069. if(Choose[playerid] == 1)
  1070. {
  1071. if(strlen(TypeText[playerid]) >= 4) return SendClientMessage(playerid,COLOR_RED,"EROR: "COL_WHITE"Just 4 number please!");
  1072. strcat(TypeText[playerid], "1");
  1073. TextDrawSetString(LockTD2[playerid],TypeText[playerid]);
  1074. }
  1075. else if(Choose[playerid] == 2)
  1076. {
  1077. if(strlen(TypeText[playerid]) >= 4) return SendClientMessage(playerid,COLOR_RED,"EROR: "COL_WHITE"Just 4 number please!");
  1078. strcat(TypeText[playerid], "2");
  1079. TextDrawSetString(LockTD2[playerid],TypeText[playerid]);
  1080. }
  1081. else if(Choose[playerid] == 3)
  1082. {
  1083. if(strlen(TypeText[playerid]) >= 4) return SendClientMessage(playerid,COLOR_RED,"EROR: "COL_WHITE"Just 4 number please!");
  1084. strcat(TypeText[playerid], "3");
  1085. TextDrawSetString(LockTD2[playerid],TypeText[playerid]);
  1086. }
  1087. else if(Choose[playerid] == 4)
  1088. {
  1089. if(strlen(TypeText[playerid]) >= 4) return SendClientMessage(playerid,COLOR_RED,"EROR: "COL_WHITE"Just 4 number please!");
  1090. strcat(TypeText[playerid], "4");
  1091. TextDrawSetString(LockTD2[playerid],TypeText[playerid]);
  1092. }
  1093. else if(Choose[playerid] == 5)
  1094. {
  1095. if(strlen(TypeText[playerid]) >= 4) return SendClientMessage(playerid,COLOR_RED,"EROR: "COL_WHITE"Just 4 number please!");
  1096. strcat(TypeText[playerid], "5");
  1097. TextDrawSetString(LockTD2[playerid],TypeText[playerid]);
  1098. }
  1099. else if(Choose[playerid] == 6)
  1100. {
  1101. if(strlen(TypeText[playerid]) >= 4) return SendClientMessage(playerid,COLOR_RED,"EROR: "COL_WHITE"Just 4 number please!");
  1102. strcat(TypeText[playerid], "6");
  1103. TextDrawSetString(LockTD2[playerid],TypeText[playerid]);
  1104. }
  1105. else if(Choose[playerid] == 7)
  1106. {
  1107. if(strlen(TypeText[playerid]) >= 4) return SendClientMessage(playerid,COLOR_RED,"EROR: "COL_WHITE"Just 4 number please!");
  1108. strcat(TypeText[playerid], "7");
  1109. TextDrawSetString(LockTD2[playerid],TypeText[playerid]);
  1110. }
  1111. else if(Choose[playerid] == 8)
  1112. {
  1113. if(strlen(TypeText[playerid]) >= 4) return SendClientMessage(playerid,COLOR_RED,"EROR: "COL_WHITE"Just 4 number please!");
  1114. strcat(TypeText[playerid], "8");
  1115. TextDrawSetString(LockTD2[playerid],TypeText[playerid]);
  1116. }
  1117. else if(Choose[playerid] == 9)
  1118. {
  1119. if(strlen(TypeText[playerid]) >= 4) return SendClientMessage(playerid,COLOR_RED,"EROR: "COL_WHITE"Just 4 number please!");
  1120. strcat(TypeText[playerid], "9");
  1121. TextDrawSetString(LockTD2[playerid],TypeText[playerid]);
  1122. }
  1123. else if(Choose[playerid] == 10)
  1124. {
  1125. if(strlen(TypeText[playerid]) >= 4) return SendClientMessage(playerid,COLOR_RED,"EROR: "COL_WHITE"Just 4 number please!");
  1126. strcat(TypeText[playerid], "0");
  1127. TextDrawSetString(LockTD2[playerid],TypeText[playerid]);
  1128. }
  1129. else if(Choose[playerid] == 10)
  1130. {
  1131. if(strlen(TypeText[playerid]) >= 4) return SendClientMessage(playerid,COLOR_RED,"EROR: "COL_WHITE"Just 4 number please!");
  1132. strcat(TypeText[playerid], "0");
  1133. TextDrawSetString(LockTD2[playerid],TypeText[playerid]);
  1134. }
  1135. else if(Choose[playerid] == 11)
  1136. {
  1137. new id = GetClosetHouseID(playerid);
  1138. if(strcmp(House[id][LockPass],TypeText[playerid],false) == 0)
  1139. {
  1140. House[id][Lock] = 1;
  1141. Choose[playerid] = 0;
  1142. TextDrawHideForPlayer(playerid,LockTD0[playerid]);
  1143. TextDrawHideForPlayer(playerid,LockTD1[playerid]);
  1144. TextDrawHideForPlayer(playerid,LockTD2[playerid]);
  1145. TextDrawHideForPlayer(playerid,LockTD3[playerid]);
  1146. TextDrawHideForPlayer(playerid,LockTD4[playerid]);
  1147. TextDrawHideForPlayer(playerid,LockTD5[playerid]);
  1148. TextDrawHideForPlayer(playerid,LockTD6[playerid]);
  1149. TogglePlayerControllable(playerid,true);
  1150. SendClientMessage(playerid,-1,"House is locked.");
  1151. CheckHouse(id);
  1152. }
  1153. else return SendClientMessage(playerid,COLOR_RED,"EROR: "COL_WHITE"Wrong password");
  1154. }
  1155. else if(Choose[playerid] == 12)
  1156. {
  1157. TextDrawHideForPlayer(playerid,LockTD0[playerid]);
  1158. TextDrawHideForPlayer(playerid,LockTD1[playerid]);
  1159. TextDrawHideForPlayer(playerid,LockTD2[playerid]);
  1160. TextDrawHideForPlayer(playerid,LockTD3[playerid]);
  1161. TextDrawHideForPlayer(playerid,LockTD4[playerid]);
  1162. TextDrawHideForPlayer(playerid,LockTD5[playerid]);
  1163. TextDrawHideForPlayer(playerid,LockTD6[playerid]);
  1164. TogglePlayerControllable(playerid,true);
  1165. }
  1166. }
  1167. return 1;
  1168. }
  1169.  
  1170. public OnRconLoginAttempt(ip[], password[], success)
  1171. {
  1172. return 1;
  1173. }
  1174. public OnPlayerUpdate(playerid)
  1175. {
  1176. new k, ud, lr;
  1177. GetPlayerKeys(playerid, k, ud, lr);
  1178. if(lr > 0)
  1179. {
  1180. if(ChooseInt[playerid] == 1)
  1181. {
  1182. ChooseInt[playerid] = 2;
  1183. SetPlayerPos(playerid,2527.654052,-1679.388305,1015.498596);
  1184. SetPlayerInterior(playerid,1);
  1185. TextDrawSetString(hUp[playerid]," House Upgrade~n~~n~~r~< ~w~Price: ~g~$13000 ~r~>");
  1186. TextDrawShowForPlayer(playerid,hUp[playerid]);
  1187. }
  1188. else if(ChooseInt[playerid] == 2)
  1189. {
  1190. ChooseInt[playerid] = 3;
  1191. SetPlayerPos(playerid,2807.619873,-1171.899902,1025.570312);
  1192. SetPlayerInterior(playerid,8);
  1193. TextDrawSetString(hUp[playerid]," House Upgrade~n~~n~~r~< ~w~Price: ~g~$17000 ~r~>");
  1194. TextDrawShowForPlayer(playerid,hUp[playerid]);
  1195. }
  1196. else if(ChooseInt[playerid] == 3)
  1197. {
  1198. ChooseInt[playerid] = 1;
  1199. SetPlayerPos(playerid,2496.049804,-1695.238159,1014.742187);
  1200. SetPlayerInterior(playerid,3);
  1201. TextDrawSetString(hUp[playerid]," House Upgrade~n~~n~~r~< ~w~Price: ~g~$20000 ~r~>");
  1202. TextDrawShowForPlayer(playerid,hUp[playerid]);
  1203. }
  1204.  
  1205. }
  1206. if(ud > 0)
  1207. {
  1208. if(PhoneChoose[playerid] == 1)
  1209. {
  1210. TextDrawSetString(Phone1[playerid],"~w~1 ~y~2 ~w~3~n~4 5 6~n~7 8 9~n~~g~~g~C ~w~0 ~r~H");
  1211. PhoneChoose[playerid] = 2;
  1212. }
  1213. else if(PhoneChoose[playerid] == 2)
  1214. {
  1215. TextDrawSetString(Phone1[playerid],"~w~1 2 ~y~3~n~~w~4 5 6~n~7 8 9~n~~g~~g~C ~w~0 ~r~H");
  1216. PhoneChoose[playerid] = 3;
  1217. }
  1218. else if(PhoneChoose[playerid] == 3)
  1219. {
  1220. TextDrawSetString(Phone1[playerid],"~w~1 2 3~n~~y~4 ~w~5 6~n~7 8 9~n~~g~~g~C ~w~0 ~r~H");
  1221. PhoneChoose[playerid] = 4;
  1222. }
  1223. else if(PhoneChoose[playerid] == 4)
  1224. {
  1225. TextDrawSetString(Phone1[playerid],"~w~1 2 3~n~4 ~y~5 ~w~6~n~7 8 9~n~~g~~g~C ~w~0 ~r~H");
  1226. PhoneChoose[playerid] = 5;
  1227. }
  1228. else if(PhoneChoose[playerid] == 5)
  1229. {
  1230. TextDrawSetString(Phone1[playerid],"~w~1 2 3~n~4 5 ~y~6~n~~w~7 8 9~n~~g~~g~C ~w~0 ~r~H");
  1231. PhoneChoose[playerid] = 6;
  1232. }
  1233. else if(PhoneChoose[playerid] == 6)
  1234. {
  1235. TextDrawSetString(Phone1[playerid],"~w~1 2 3~n~4 5 6~n~~y~7 ~w~8 9~n~~g~~g~C ~w~0 ~r~H");
  1236. PhoneChoose[playerid] = 7;
  1237. }
  1238. else if(PhoneChoose[playerid] == 7)
  1239. {
  1240. TextDrawSetString(Phone1[playerid],"~w~1 2 3~n~4 5 6~n~7 ~y~8 ~w~9~n~~g~~g~C ~w~0 ~r~H");
  1241. PhoneChoose[playerid] = 8;
  1242. }
  1243. else if(PhoneChoose[playerid] == 8)
  1244. {
  1245. TextDrawSetString(Phone1[playerid],"~w~1 2 3~n~4 5 6~n~7 8 ~y~9~n~~g~~g~C ~w~0 ~r~H");
  1246. PhoneChoose[playerid] = 9;
  1247. }
  1248. else if(PhoneChoose[playerid] == 9)
  1249. {
  1250. TextDrawSetString(Phone1[playerid],"~w~1 2 3~n~4 5 6~n~7 8 9~n~~y~C ~w~0 ~r~H");
  1251. PhoneChoose[playerid] = 10;
  1252. }
  1253. else if(PhoneChoose[playerid] == 10)
  1254. {
  1255. TextDrawSetString(Phone1[playerid],"~w~1 2 3~n~4 5 6~n~7 8 9~n~~g~~g~C ~y~0 ~r~H");
  1256. PhoneChoose[playerid] = 11;
  1257. }
  1258. else if(PhoneChoose[playerid] == 11)
  1259. {
  1260. TextDrawSetString(Phone1[playerid],"~w~1 2 3~n~4 5 6~n~7 8 9~n~~g~~g~C ~w~0 ~y~H");
  1261. PhoneChoose[playerid] = 12;
  1262. }
  1263. else if(PhoneChoose[playerid] == 12)
  1264. {
  1265. TextDrawSetString(Phone1[playerid],"~y~1 ~w~2 3~n~4 5 6~n~7 8 9~n~~g~~g~C ~w~0 ~r~H");
  1266. PhoneChoose[playerid] = 1;
  1267. }
  1268. //Alarm
  1269. if(Choose[playerid] == 1)
  1270. {
  1271. TextDrawSetString(LockTD3[playerid],"~w~1 ~r~2 ~w~3~n~4 5 6~n~7 8 9~n~ 0");
  1272. Choose[playerid] = 2;
  1273. }
  1274. else if(Choose[playerid] == 2)
  1275. {
  1276. TextDrawSetString(LockTD3[playerid],"~w~1 2 ~r~3~n~~w~4 5 6~n~7 8 9~n~ 0");
  1277. Choose[playerid] = 3;
  1278. }
  1279. else if(Choose[playerid] == 3)
  1280. {
  1281. TextDrawSetString(LockTD3[playerid],"~w~1 2 3~n~~r~4 ~w~5 6~n~7 8 9~n~ 0");
  1282. Choose[playerid] = 4;
  1283. }
  1284. else if(Choose[playerid] == 4)
  1285. {
  1286. TextDrawSetString(LockTD3[playerid],"~w~1 2 3~n~4 ~r~5 ~w~6~n~7 8 9~n~ 0");
  1287. Choose[playerid] = 5;
  1288. }
  1289. else if(Choose[playerid] == 5)
  1290. {
  1291. TextDrawSetString(LockTD3[playerid],"~w~1 2 3~n~4 5 ~r~6~n~~w~7 8 9~n~ 0");
  1292. Choose[playerid] = 6;
  1293. }
  1294. else if(Choose[playerid] == 6)
  1295. {
  1296. TextDrawSetString(LockTD3[playerid],"~w~1 2 3~n~4 5 6~n~~r~7 ~w~8 9~n~ 0");
  1297. Choose[playerid] = 7;
  1298. }
  1299. else if(Choose[playerid] == 7)
  1300. {
  1301. TextDrawSetString(LockTD3[playerid],"~w~1 2 3~n~4 5 6~n~7 ~r~8 ~w~9~n~ 0");
  1302. Choose[playerid] = 8;
  1303. }
  1304. else if(Choose[playerid] == 8)
  1305. {
  1306. TextDrawSetString(LockTD3[playerid],"~w~1 2 3~n~4 5 6~n~7 8 ~r~9~n~ ~w~0");
  1307. Choose[playerid] = 9;
  1308. }
  1309. else if(Choose[playerid] == 9)
  1310. {
  1311. TextDrawSetString(LockTD3[playerid],"~w~1 2 3~n~4 5 6~n~7 8 9~n~ ~r~0");
  1312. Choose[playerid] = 10;
  1313. }
  1314. else if(Choose[playerid] == 10)
  1315. {
  1316. TextDrawSetString(LockTD3[playerid],"~w~1 2 3~n~4 5 6~n~7 8 9~n~ 0");
  1317. TextDrawSetString(LockTD4[playerid],"~r~Enter ~w~Close");
  1318. Choose[playerid] = 11;
  1319. }
  1320. else if(Choose[playerid] == 11)
  1321. {
  1322. TextDrawSetString(LockTD4[playerid],"~w~Enter ~r~Close");
  1323. Choose[playerid] = 12;
  1324. }
  1325. else if(Choose[playerid] == 12)
  1326. {
  1327. TextDrawSetString(LockTD4[playerid],"~w~Enter ~w~Close");
  1328. TextDrawSetString(LockTD3[playerid],"~r~1 ~w~2 3~n~4 5 6~n~7 8 9~n~ 0");
  1329. Choose[playerid] = 1;
  1330. }
  1331. }
  1332. else if(ud < 0)
  1333. {
  1334. if(Choose[playerid] == 1)
  1335. {
  1336. TextDrawSetString(LockTD3[playerid],"~w~1 2 ~w~3~n~4 5 6~n~7 8 9~n~ ~w~0");
  1337. TextDrawSetString(LockTD4[playerid],"~w~Enter ~r~Close");
  1338. Choose[playerid] = 12;
  1339. }
  1340. else if(Choose[playerid] == 12)
  1341. {
  1342. TextDrawSetString(LockTD4[playerid],"~r~Enter ~w~Close");
  1343. Choose[playerid] = 11;
  1344. }
  1345. else if(Choose[playerid] == 11)
  1346. {
  1347. TextDrawSetString(LockTD4[playerid],"~w~Enter ~w~Close");
  1348. TextDrawSetString(LockTD3[playerid],"~w~1 2 3~n~4 5 6~n~7 8 9~n~ ~r~0");
  1349. Choose[playerid] = 10;
  1350. }
  1351. else if(Choose[playerid] == 10)
  1352. {
  1353. TextDrawSetString(LockTD3[playerid],"~w~1 2 3~n~4 5 6~n~7 8 ~r~9~n~ ~w~0");
  1354. Choose[playerid] = 9;
  1355. }
  1356. else if(Choose[playerid] == 9)
  1357. {
  1358. TextDrawSetString(LockTD3[playerid],"~w~1 2 3~n~4 5 6~n~7 ~r~8 ~w~9~n~ 0");
  1359. Choose[playerid] = 8;
  1360. }
  1361. else if(Choose[playerid] == 8)
  1362. {
  1363. TextDrawSetString(LockTD3[playerid],"~w~1 2 3~n~4 5 6~n~~r~7 ~w~8 9~n~ 0");
  1364. Choose[playerid] = 7;
  1365. }
  1366. else if(Choose[playerid] == 7)
  1367. {
  1368. TextDrawSetString(LockTD3[playerid],"~w~1 2 3~n~4 5 ~r~6~n~~w~7 8 9~n~ 0");
  1369. Choose[playerid] = 6;
  1370. }
  1371. else if(Choose[playerid] == 6)
  1372. {
  1373. TextDrawSetString(LockTD3[playerid],"~w~1 2 3~n~4 ~r~5 ~w~6~n~7 8 9~n~ 0");
  1374. Choose[playerid] = 5;
  1375. }
  1376. else if(Choose[playerid] == 5)
  1377. {
  1378. TextDrawSetString(LockTD3[playerid],"~w~1 2 3~n~~r~4 ~w~5 6~n~7 8 9~n~ 0");
  1379. Choose[playerid] = 4;
  1380. }
  1381. else if(Choose[playerid] == 4)
  1382. {
  1383. TextDrawSetString(LockTD3[playerid],"~w~1 2 ~r~3~n~~w~4 5 6~n~7 8 9~n~ 0");
  1384. Choose[playerid] = 3;
  1385. }
  1386. else if(Choose[playerid] == 3)
  1387. {
  1388. TextDrawSetString(LockTD3[playerid],"~w~1 ~r~2 ~w~3~n~4 5 6~n~7 8 9~n~ 0");
  1389. Choose[playerid] = 2;
  1390. }
  1391. else if(Choose[playerid] == 2)
  1392. {
  1393. TextDrawSetString(LockTD3[playerid],"~r~1 ~w~2 3~n~4 5 6~n~7 8 9~n~ 0");
  1394. Choose[playerid] = 1;
  1395. }
  1396. }
  1397. return 1;
  1398. }
  1399.  
  1400. public OnPlayerStreamIn(playerid, forplayerid)
  1401. {
  1402. return 1;
  1403. }
  1404.  
  1405. public OnPlayerStreamOut(playerid, forplayerid)
  1406. {
  1407. return 1;
  1408. }
  1409.  
  1410. public OnVehicleStreamIn(vehicleid, forplayerid)
  1411. {
  1412. return 1;
  1413. }
  1414.  
  1415. public OnVehicleStreamOut(vehicleid, forplayerid)
  1416. {
  1417. return 1;
  1418. }
  1419.  
  1420. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  1421. {
  1422. switch(dialogid)
  1423. {
  1424. case DIALOG_HOUSE:
  1425. {
  1426. if(!response) return 1;
  1427. new
  1428. string[200];
  1429. switch(listitem)
  1430. {
  1431. case 0: {
  1432. new id = Player[playerid][Houseid];
  1433. if(id == 999) return SendClientMessage(playerid,COLOR_RED,"EROR: "COL_WHITE"You don't have a house");
  1434. if(!IsPlayerInRangeOfPoint(playerid,3.0,House[id][EnterX],House[id][EnterY],House[id][EnterZ])) return SendClientMessage(playerid,COLOR_RED,"EROR: "COL_WHITE"You are not near your house");
  1435. format(House[id][Owner], 32, "Apartment");
  1436. if(House[id][hCar] > 0) format(HouseOwner[House[id][hCar]],64,"Apartment");
  1437. House[id][On_Sell] = 1;
  1438. Player[playerid][Houseid] = 999;
  1439. GivePlayerMoney(playerid,House[id][Price]/2);
  1440. DestroyDynamicPickup(House[id][PickupU]);
  1441. House[id][PickupU] = CreateDynamicPickup(1273, 23, House[id][EnterX],House[id][EnterY],House[id][EnterZ],-1,-1,-1,100.0);
  1442. DestroyDynamicMapIcon(House[id][Icon]);
  1443. House[id][Icon] = CreateDynamicMapIcon(House[id][EnterX],House[id][EnterY],House[id][EnterZ], 31, 0, -1, -1, -1, 100.0);
  1444. CheckHouse(id);
  1445. UpdatePlayerInformation(playerid);
  1446. format(string,sizeof(string),"{29CC3F}Owner: "COL_WHITE"Apartment\n{29CC3F}House Name: "COL_WHITE"%s\n{29CC3F}Price: "COL_WHITE"%d\n{29CC3F}Level: "COL_WHITE"%d\n{29CC3F}Address: "COL_WHITE"%s\n (/buyhouse)",House[id][HouseName],House[id][Price],House[id][Level],House[id][Address]);
  1447. UpdateDynamic3DTextLabelText(House[id][DLabel],-1,string);
  1448. }
  1449. case 1: {
  1450. ShowPlayerDialog(playerid,DIALOG_HOUSE+1,DIALOG_STYLE_INPUT,""COL_YELLOW"Rent house",""COL_BLUE"Type rent price","Put","Close"); }
  1451. case 2:
  1452. {
  1453. new id = Player[playerid][Houseid];
  1454. foreach (Player, i)
  1455. {
  1456. if(i != playerid)
  1457. {
  1458. if(strcmp(House[id][Player_Rent],GetName(playerid), false ) == 0) {SendClientMessage(i,COLOR_RED,"You have been evicted from house");}
  1459. format(House[id][Player_Rent],48,"Nobody");
  1460. }
  1461. }
  1462. }
  1463. case 3: {
  1464. ShowPlayerDialog(playerid,DIALOG_HOUSE+2,DIALOG_STYLE_INPUT,""COL_YELLOW"House name",""COL_WHITE"Type new name of house","Name","Close");
  1465. }
  1466. case 4: {
  1467. ShowPlayerDialog(playerid,DIALOG_HOUSE+3,DIALOG_STYLE_INPUT,""COL_YELLOW"Lock Password (numbers only)",""COL_WHITE"Type new password","Insert","Close");
  1468. }
  1469. }
  1470. }
  1471. case DIALOG_HOUSE+1:
  1472. {
  1473. if(!response) return 1;
  1474. new string[210];
  1475. new id = Player[playerid][Houseid];
  1476. if(strval(inputtext) <= 0) return SendClientMessage(playerid,COLOR_RED,"EROR: "COL_WHITE"Price can't be less 1");
  1477. House[id][RentPrice] = strval(inputtext);
  1478. format(string,sizeof(string),"New rent price is $%d",strval(inputtext)); SendClientMessage(playerid,-1,string);
  1479. format(string,sizeof(string),"{E0BC1B}Owner: "COL_WHITE"%s\n{E0BC1B}House name: "COL_WHITE"%s\n{E0BC1B}Price: "COL_WHITE"%d\n{E0BC1B}Level: "COL_WHITE"%d\n{E0BC1B}Rent price: "COL_WHITE"%d\n{E0BC1B}Address: "COL_WHITE"%s\n (/renthouse)",House[id][Owner],House[id][HouseName],House[id][Price],House[id][Level],House[id][RentPrice],House[id][Address]);
  1480. UpdateDynamic3DTextLabelText(House[id][DLabel],-1,string);
  1481. CheckHouse(id);
  1482. }
  1483. case DIALOG_HOUSE+2:
  1484. {
  1485. if(!response) return 1;
  1486. new string[210];
  1487. new id = Player[playerid][Houseid];
  1488. format(House[id][HouseName], 32, "%s", inputtext);
  1489. format(string,sizeof(string),"{E0BC1B}Owner: "COL_WHITE"%s\n{E0BC1B}House name: "COL_WHITE"%s\n{E0BC1B}Price: "COL_WHITE"%d\n{E0BC1B}Level: "COL_WHITE"%d\n{E0BC1B}Rent price: "COL_WHITE"%d\n{E0BC1B}Address: "COL_WHITE"%s\n (/renthouse)",House[id][Owner],House[id][HouseName],House[id][Price],House[id][Level],House[id][RentPrice],House[id][Address]);
  1490. UpdateDynamic3DTextLabelText(House[id][DLabel],-1,string);
  1491. CheckHouse(id);
  1492. }
  1493. case DIALOG_HOUSE+3:
  1494. {
  1495. if(!response) return 1;
  1496. new string[128];
  1497. new id = Player[playerid][Houseid];
  1498. if(strlen(inputtext) >= 5 || strlen(inputtext) < 4) return ShowPlayerDialog(playerid,DIALOG_HOUSE+3,DIALOG_STYLE_INPUT,""COL_WHITE"Lock Password",""COL_BLUE"Type new password","Insert","Close"),SendClientMessage(playerid,COLOR_RED,"EROR: "COL_WHITE"Just four numbers");
  1499. format(House[id][LockPass],5,"%d",strval(inputtext));
  1500. format(string,sizeof(string),"New password is %d",strval(inputtext)); SendClientMessage(playerid,-1,string);
  1501. CheckHouse(id);
  1502. }
  1503. }
  1504. return 1;
  1505. }
  1506.  
  1507. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  1508. {
  1509. return 1;
  1510. }
  1511. forward LoadHouse(id, name[], value[]);
  1512. public LoadHouse(id, name[], value[])
  1513. {
  1514. INI_Float("EnterX", House[id][EnterX]);
  1515. INI_Float("EnterY", House[id][EnterY]);
  1516. INI_Float("EnterZ", House[id][EnterZ]);
  1517. INI_Float("ExitX", House[id][ExitX]);
  1518. INI_Float("ExitY", House[id][ExitY]);
  1519. INI_Float("ExitZ", House[id][ExitZ]);
  1520. INI_String("HouseName", House[id][HouseName] , 32 );
  1521. INI_String("Owner", House[id][Owner] , 32 );
  1522. INI_Int("Price", House[id][Price]);
  1523. INI_Int("Level", House[id][Level]);
  1524. INI_Int("Interior", House[id][IntID]);
  1525. INI_Int("VW", House[id][VW]);
  1526. INI_Int("On_Sell", House[id][On_Sell]);
  1527. INI_Int("Lock", House[id][Lock]);
  1528. INI_Int("RentPrice", House[id][RentPrice]);
  1529. INI_String("PlayerRent", House[id][Player_Rent] , 32 );
  1530. INI_Int("Money", House[id][Money]);
  1531. INI_Int("Gun1", House[id][Gun1]);
  1532. INI_Int("Gun2", House[id][Gun2]);
  1533. INI_Int("Ammo1", House[id][Ammo1]);
  1534. INI_Int("Ammo2", House[id][Ammo2]);
  1535. INI_String("LockPass", House[id][LockPass] , 5 );
  1536. INI_Float("hCarX", House[id][hCarX]);
  1537. INI_Float("hCarY", House[id][hCarY]);
  1538. INI_Float("hCarZ", House[id][hCarZ]);
  1539. INI_Float("hCarA", House[id][hCarA]);
  1540. INI_Int("hCarC1", House[id][hCarC1]);
  1541. INI_Int("hCarC2", House[id][hCarC2]);
  1542. INI_Int("hCarID", House[id][hCarID]);
  1543. INI_Int("hCarMoney", House[id][hCarMoney]);
  1544. INI_Int("hCarGun1", House[id][hCarGun1]);
  1545. INI_Int("hCarGun2", House[id][hCarGun2]);
  1546. INI_Int("hCarAmmo1", House[id][hCarAmmo1]);
  1547. INI_Int("hCarAmmo2", House[id][hCarAmmo2]);
  1548. INI_String("PhoneNum", House[id][PhoneNum] , 5 );
  1549. INI_String("Address", House[id][Address] , 48);
  1550. INI_Int("DayEnter", House[id][DayEnter]);
  1551. INI_Int("MonthEnter", House[id][MonthEnter]);
  1552.  
  1553. return 1;
  1554. }
  1555. //==================House System=====================
  1556. YCMD:chouse(playerid, params[], help)
  1557. {
  1558. #pragma unused help
  1559. if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED, "You must be RCON admin");
  1560. new
  1561. Float:Pos[3],string[64],id,name[48],price,level;
  1562. if(sscanf(params, "is[48]ii",id,name,price,level)) return SendClientMessage(playerid, COLOR_RED, "Usage:"COL_WHITE" /chouse [ID] [Name] [Price] [Level]");
  1563. if(id >= MAX_HOUSE) return SendClientMessage(playerid, COLOR_RED, "EROR: "COL_WHITE"Try again. You have typed the wrong house id.");
  1564. format(string, sizeof(string), House_File, id);
  1565. if(fexist(string)) return SendClientMessage(playerid, COLOR_RED, "House on that id already exists.!");
  1566. GetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]);
  1567. CreateSaveHouse(name,id,price,level,id+1,Pos[0],Pos[1],Pos[2]);
  1568. SendClientMessage(playerid, -1, ""COL_YELLOW"You have Created a house..");
  1569. return 1;
  1570. }
  1571. YCMD:removehouse(playerid, params[], help)
  1572. {
  1573. #pragma unused help
  1574. #pragma unused params
  1575. if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED, "You must be RCON admin");
  1576. new h = GetClosetHouseID(playerid),file[32];
  1577. if(h == -1) return SendClientMessage(playerid,COLOR_RED,"EROR: "COL_WHITE"There is no house.");
  1578. format(file,32,House_File,h);
  1579. if(fexist(file))
  1580. {
  1581. fremove(file);
  1582. DestroyDynamicPickup(House[h][PickupU]);
  1583. DestroyDynamic3DTextLabel(House[h][DLabel]);
  1584. DestroyDynamicMapIcon(House[h][Icon]);
  1585. }
  1586. return 1;
  1587. }
  1588. YCMD:gotohouse(playerid, params[], help)
  1589. {
  1590. #pragma unused help
  1591. new id,file[32];
  1592. if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED, "You must be RCON admin");
  1593. if(sscanf(params,"i",id)) return SendClientMessage(playerid,COLOR_RED,"EROR: "COL_WHITE"Usage: /gotohouse [ID]");
  1594. format(file,32,House_File,id);
  1595. if(!fexist(file)) return SendClientMessage(playerid,-1,"There is no house on that id.");
  1596. SetPlayerPos(playerid,House[id][EnterX],House[id][EnterY],House[id][EnterZ]);
  1597. return 1;
  1598. }
  1599. YCMD:buyhouse(playerid, params[], help)
  1600. {
  1601. #pragma unused help
  1602. #pragma unused params
  1603. new string[210];
  1604. new i = GetClosetHouseID(playerid);
  1605. if(Player[playerid][Houseid] != 999) return SendClientMessage(playerid,COLOR_RED,"EROR: "COL_WHITE"You already have house");
  1606. if(!IsPlayerInRangeOfPoint(playerid,5.0,House[i][EnterX],House[i][EnterY],House[i][EnterZ])) return SendClientMessage(playerid,COLOR_RED,"You are not close to your house.");
  1607. if(GetPlayerMoney(playerid) < House[i][Price]) return SendClientMessage(playerid, COLOR_RED, "You don't have that kind of money.");
  1608. format(House[i][Owner], 32, "%s", GetName(playerid));
  1609. if(House[i][hCar] > 0) format(HouseOwner[House[i][hCar]],64,"%s",GetName(playerid));
  1610. House[i][On_Sell] = 0;
  1611. Player[playerid][Houseid] = i;
  1612. DestroyDynamicPickup(House[i][PickupU]);
  1613. House[i][PickupU] = CreateDynamicPickup(1272, 23, House[i][EnterX],House[i][EnterY],House[i][EnterZ],-1,-1,-1,100.0);
  1614. GivePlayerMoney(playerid, -House[i][Price]);
  1615. DestroyDynamicMapIcon(House[i][Icon]);
  1616. House[i][Icon] = CreateDynamicMapIcon(House[i][EnterX],House[i][EnterY],House[i][EnterZ], 32, 0, -1, -1, -1, 100.0);
  1617. CheckHouse(i);
  1618. format(string,sizeof(string),"{E0BC1B}Owner: "COL_WHITE"%s\n{E0BC1B}House name: "COL_WHITE"%s\n{E0BC1B}Price: "COL_WHITE"%d\n{E0BC1B}Level: "COL_WHITE"%d\n{E0BC1B}Rent price: "COL_WHITE"%d\n{E0BC1B}Address: "COL_WHITE"%s\n (/renthouse)",House[i][Owner],House[i][HouseName],House[i][Price],House[i][Level],House[i][RentPrice],House[i][Address]);
  1619. UpdateDynamic3DTextLabelText(House[i][DLabel],-1,string);
  1620. UpdatePlayerInformation(playerid);
  1621. return 1;
  1622. }
  1623. YCMD:house(playerid, params[], help)
  1624. {
  1625. #pragma unused help
  1626. #pragma unused params
  1627. new id = Player[playerid][Houseid];
  1628. if(id == 999) return SendClientMessage(playerid,COLOR_RED,"EROR: "COL_WHITE"You don't have a house.");
  1629. if(!IsPlayerInRangeOfPoint(playerid,5.0,House[id][EnterX],House[id][EnterY],House[id][EnterZ])) return SendClientMessage(playerid,COLOR_RED,"This Is not Your House.!");
  1630. ShowPlayerDialog(playerid,DIALOG_HOUSE,DIALOG_STYLE_LIST,"House control panel","Sell\nChange rent\nEvict\nHouse name\nLock Password","Choose","Close");
  1631. return 1;
  1632. }
  1633. YCMD:renthouse(playerid, params[], help)
  1634. {
  1635. #pragma unused help
  1636. #pragma unused params
  1637. new id = GetClosetHouseID(playerid);
  1638. if(id == -1) return SendClientMessage(playerid,COLOR_RED,"EROR: "COL_WHITE"There is no house.");
  1639. if(strcmp(House[id][Owner],"Apartment", false ) == 0)
  1640. {
  1641. SendClientMessage(playerid,COLOR_RED,"This house does not have an owner.");
  1642. return 1;
  1643. }
  1644. if(strcmp(House[id][Player_Rent],"Nobody", false ) == 0)
  1645. {
  1646. new string[128];
  1647. if(!IsPlayerInRangeOfPoint(playerid,5.0,House[id][EnterX],House[id][EnterY],House[id][EnterZ])) return SendClientMessage(playerid,COLOR_RED,"Niste blizu nijedne kuce!");
  1648. House[id][Money] += House[id][RentPrice];
  1649. GivePlayerMoney(playerid, -House[id][RentPrice]);
  1650. format(House[id][Player_Rent],48,"%s",GetName(playerid));
  1651. format(string,sizeof(string),"{E0BC1B}You owe rent for House $%d",House[id][RentPrice]);
  1652. SendClientMessage(playerid,-1,string);
  1653. CheckHouse(id);
  1654. }
  1655. else return SendClientMessage(playerid,COLOR_RED,"Somebody already rented this house.");
  1656. return 1;
  1657. }
  1658. YCMD:unrenthouse(playerid, params[], help)
  1659. {
  1660. #pragma unused help
  1661. #pragma unused params
  1662. new id = GetClosetHouseID(playerid);
  1663. if(id == -1) return SendClientMessage(playerid,COLOR_RED,"EROR: "COL_WHITE"There is no house.");
  1664. if(strcmp(House[id][Owner],"Apartment", false ) == 0)
  1665. {
  1666. SendClientMessage(playerid,COLOR_RED,"This house does not have an owner.");
  1667. return 1;
  1668. }
  1669. if(strcmp(House[id][Player_Rent],GetName(playerid), false ) == 0)
  1670. {
  1671. if(!IsPlayerInRangeOfPoint(playerid,5.0,House[id][EnterX],House[id][EnterY],House[id][EnterZ])) return SendClientMessage(playerid,COLOR_RED,"Niste blizu nijedne kuce!");
  1672. format(House[id][Player_Rent],48,"Nobody");
  1673. SendClientMessage(playerid,-1,"You are unrent house");
  1674. CheckHouse(id);
  1675. }
  1676. else return SendClientMessage(playerid,COLOR_RED,"EROR:"COL_WHITE" You don't rent this house.");
  1677. return 1;
  1678. }
  1679. YCMD:hdeposit(playerid, params[], help)
  1680. {
  1681. #pragma unused help
  1682. #pragma unused params
  1683. new id = Player[playerid][Houseid];
  1684. if(id == 999) return SendClientMessage(playerid,COLOR_RED,"EROR: "COL_WHITE"You don't have a house.");
  1685. new string[128],money;
  1686. if(!IsPlayerInRangeOfPoint(playerid,5.0,House[id][ExitX],House[id][ExitY],House[id][ExitZ])) return SendClientMessage(playerid,COLOR_RED,"You are not at right position!");
  1687. if(sscanf(params, "i",money)) return SendClientMessage(playerid, COLOR_RED, "Usage: /hdeposit [Money]");
  1688. if(money > GetPlayerMoney(playerid)) return SendClientMessage(playerid, COLOR_RED, "You don't have that kind of money.");
  1689. if(money < 1) return SendClientMessage(playerid, COLOR_RED, "Money can't be less then 1");
  1690. House[id][Money] += money;
  1691. GivePlayerMoney(playerid, -money);
  1692. format(string,sizeof(string),"{E0BC1B}You have put in the safe $%d.Now you have $%d",money,House[id][Money]);
  1693. SendClientMessage(playerid,-1,string);
  1694. CheckHouse(id);
  1695. return 1;
  1696. }
  1697. YCMD:hwithdraw(playerid, params[], help)
  1698. {
  1699. #pragma unused help
  1700. #pragma unused params
  1701. new id = Player[playerid][Houseid];
  1702. if(id == 999) return SendClientMessage(playerid,COLOR_RED,"EROR: "COL_WHITE"You don't have a house.");
  1703. new string[128],money;
  1704. if(!IsPlayerInRangeOfPoint(playerid,5.0,House[id][ExitX],House[id][ExitY],House[id][ExitZ])) return SendClientMessage(playerid,COLOR_RED,"You are not in your house!");
  1705. if(sscanf(params, "i",money)) return SendClientMessage(playerid, COLOR_RED, "Usage: /hwithdraw [Money]");
  1706. if(money > House[id][Money]) return SendClientMessage(playerid, COLOR_RED, "You Don't have this sum of money.");
  1707. if(money < 1) return SendClientMessage(playerid, COLOR_RED, "Money can't be less then 1");
  1708. House[id][Money] -= money;
  1709. GivePlayerMoney(playerid, money);
  1710. format(string,sizeof(string),""COL_YELLOW"You are take from safe"COL_GREEN"$%d"COL_YELLOW".Now there is "COL_GREEN"$%d",money,House[id][Money]);
  1711. SendClientMessage(playerid,-1,string);
  1712. CheckHouse(id);
  1713. return 1;
  1714. }
  1715. YCMD:hputgun(playerid, params[], help)
  1716. {
  1717. #pragma unused help
  1718. #pragma unused params
  1719. new id = Player[playerid][Houseid];
  1720. if(id == 999) return SendClientMessage(playerid,COLOR_RED,"EROR: "COL_WHITE"You don't have a house.");
  1721. new string[128],slot,ammo;
  1722. if(!IsPlayerInRangeOfPoint(playerid,30.0,House[id][ExitX],House[id][ExitY],House[id][ExitZ])) return SendClientMessage(playerid,COLOR_RED,"You are not at right position!");
  1723. if(sscanf(params, "ii",slot,ammo)) return SendClientMessage(playerid, COLOR_RED, "Usage: /hputgun [Slot 1/2] [Ammo]");
  1724. if(ammo > GetPlayerAmmo(playerid)) return SendClientMessage(playerid, COLOR_RED, "You don't have that much ammo.");
  1725. if(ammo < 1) return SendClientMessage(playerid, COLOR_RED, "Ammo can't be less then 1");
  1726. if(slot == 1)
  1727. {
  1728. if(House[id][Gun1] != 0) return SendClientMessage(playerid,COLOR_RED,"EROR: "COL_WHITE"There is already gun on this slot.");
  1729. House[id][Gun1] = GetPlayerWeapon(playerid);
  1730. House[id][Ammo1] = ammo;
  1731. SetPlayerAmmo(playerid,GetPlayerWeapon(playerid),GetPlayerAmmo(playerid)-ammo);
  1732. format(string,sizeof(string),"{E0BC1B}You have put gun on slot 1.With %d ammo",ammo);
  1733. SendClientMessage(playerid,-1,string);
  1734. CheckHouse(id);
  1735. }
  1736. if(slot == 2)
  1737. {
  1738. if(House[id][Gun2] != 0) return SendClientMessage(playerid,COLOR_RED,"EROR: "COL_WHITE"There is already gun on this slot.");
  1739. House[id][Gun2] = GetPlayerWeapon(playerid);
  1740. House[id][Ammo2] = ammo;
  1741. SetPlayerAmmo(playerid,GetPlayerWeapon(playerid),GetPlayerAmmo(playerid)-ammo);
  1742. format(string,sizeof(string),"{E0BC1B}You have put gun on slot 2.With %d ammo",ammo);
  1743. SendClientMessage(playerid,-1,string);
  1744. CheckHouse(id);
  1745. }
  1746. return 1;
  1747. }
  1748. YCMD:htakegun(playerid, params[], help)
  1749. {
  1750. #pragma unused help
  1751. #pragma unused params
  1752. new id = Player[playerid][Houseid];
  1753. if(id == 999) return SendClientMessage(playerid,COLOR_RED,"EROR: "COL_WHITE"You don't have a house.");
  1754. if(!IsPlayerInRangeOfPoint(playerid,5.0,House[id][ExitX],House[id][ExitY],House[id][ExitZ])) return SendClientMessage(playerid,COLOR_RED,"You are not in your house!");
  1755. new string[128],slot,ammo;
  1756. if(!IsPlayerInRangeOfPoint(playerid,5.0,House[id][ExitX],House[id][ExitY],House[id][ExitZ])) return SendClientMessage(playerid,COLOR_RED,"You are not at right position!");
  1757. if(sscanf(params, "ii",slot,ammo)) return SendClientMessage(playerid, COLOR_RED, "Usage: /htakegun [Slot 1/2] [Ammo]");
  1758. if(ammo < 1) return SendClientMessage(playerid, COLOR_RED, "Ammo can't be less then 1");
  1759. if(slot == 1)
  1760. {
  1761. if(House[id][Gun1] == 0) return SendClientMessage(playerid,COLOR_RED,"EROR: "COL_WHITE"There is no gun on this slot.");
  1762. if(ammo > House[id][Ammo1]) return SendClientMessage(playerid, COLOR_RED, "EROR:"COL_WHITE" In the safe does not have that much ammo.");
  1763. GivePlayerWeapon(playerid,House[id][Gun1],ammo);
  1764. House[id][Ammo1] -= ammo;
  1765. if(House[id][Ammo1] == 0) {House[id][Gun1] = 0;}
  1766. format(string,sizeof(string),"{E0BC1B}You are take gun from slot 1.With %d ammo",ammo);
  1767. SendClientMessage(playerid,-1,string);
  1768. CheckHouse(id);
  1769. }
  1770. if(slot == 2)
  1771. {
  1772. if(House[id][Gun2] == 0) return SendClientMessage(playerid,COLOR_RED,"EROR: "COL_WHITE"There is no gun on this slot.");
  1773. if(ammo > House[id][Ammo2]) return SendClientMessage(playerid, COLOR_RED, "EROR:"COL_WHITE" In the safe does not have that much ammo.");
  1774. GivePlayerWeapon(playerid,House[id][Gun2],ammo);
  1775. House[id][Ammo2] -= ammo;
  1776. if(House[id][Ammo2] == 0) {House[id][Gun2] = 0;}
  1777. format(string,sizeof(string),"{E0BC2B}You have taken gun from slot 2.With %d ammo",ammo);
  1778. SendClientMessage(playerid,-1,string);
  1779. CheckHouse(id);
  1780. }
  1781. return 1;
  1782. }
  1783. YCMD:checksafe(playerid, params[], help)
  1784. {
  1785. #pragma unused help
  1786. #pragma unused params
  1787. new h = Player[playerid][Houseid];
  1788. if(h == 999) return SendClientMessage(playerid,COLOR_RED,"EROR: "COL_WHITE"You don't have a house.");
  1789. new string[128];
  1790. format(string,sizeof(string),""COL_YELLOW"Money"COL_GREEN" $%d",House[h][Money]);
  1791. format(string,sizeof(string),""COL_YELLOW"Slot 1 | Gun:"COL_GREEN" %d "COL_YELLOW"| Ammo:"COL_GREEN" %d",House[h][Gun1],House[h][Ammo1]);
  1792. format(string,sizeof(string),""COL_YELLOW"Slot 2 | Gun:"COL_GREEN" %d "COL_YELLOW"| Ammo:"COL_GREEN" %d",House[h][Gun2],House[h][Ammo2]);
  1793. SendClientMessage(playerid,-1,string);
  1794. return 1;
  1795. }
  1796. YCMD:knock(playerid, params[], help)
  1797. {
  1798. #pragma unused params
  1799. #pragma unused help
  1800. new i = GetClosetHouseID(playerid), string[128];
  1801. if(i == -1) return SendClientMessage(playerid,COLOR_RED,"EROR: "COL_WHITE"There is no house.");
  1802. if (IsPlayerInRangeOfPoint(playerid,5.0,House[i][EnterX], House[i][EnterY], House[i][EnterZ]))
  1803. {
  1804. format(string, sizeof(string), "* %s knocks on the door.", GetName(playerid));
  1805. ProxDetector(playerid, string, COLOR_PURPLE,30);
  1806. foreach (Player, p)
  1807. {
  1808. if (IsPlayerInRangeOfPoint(p,5.0,House[i][ExitX], House[i][ExitY], House[i][ExitZ]))
  1809. {
  1810. SendClientMessage(p, COLOR_PURPLE, "* Somebody has knocked on the door.");
  1811. }
  1812. }
  1813. }
  1814. return 1;
  1815. }
  1816. YCMD:lockdoor(playerid, params[], help)
  1817. {
  1818. #pragma unused params
  1819. #pragma unused help
  1820. new h = Player[playerid][Houseid];
  1821. if(h == 999) return SendClientMessage(playerid,COLOR_RED,"EROR: "COL_WHITE"You don't have a house.");
  1822. if(House[h][Lock] == 1) return SendClientMessage(playerid,COLOR_RED,"EROR: "COL_WHITE"House is already locked.");
  1823. if(!IsPlayerInRangeOfPoint(playerid,3.0,House[h][EnterX],House[h][EnterY],House[h][EnterZ])) return SendClientMessage(playerid,COLOR_RED,"EROR: "COL_WHITE"You are not near your house");
  1824. Choose[playerid] = 1;
  1825. TextDrawSetString(LockTD3[playerid],"~r~1 ~w~2 3~n~4 5 6~n~7 8 9~n~ 0");
  1826. TextDrawShowForPlayer(playerid,LockTD0[playerid]);
  1827. TextDrawShowForPlayer(playerid,LockTD1[playerid]);
  1828. TextDrawShowForPlayer(playerid,LockTD2[playerid]);
  1829. TextDrawShowForPlayer(playerid,LockTD3[playerid]);
  1830. TextDrawShowForPlayer(playerid,LockTD4[playerid]);
  1831. TextDrawShowForPlayer(playerid,LockTD5[playerid]);
  1832. TextDrawShowForPlayer(playerid,LockTD6[playerid]);
  1833. TogglePlayerControllable(playerid,false);
  1834. format(TypeText[playerid],5,"");
  1835. TextDrawSetString(LockTD2[playerid],TypeText[playerid]);
  1836. TextDrawSetString(LockTD4[playerid],"~w~Enter Close");
  1837. return 1;
  1838. }
  1839. YCMD:unlockdoor(playerid, params[], help)
  1840. {
  1841. #pragma unused params
  1842. #pragma unused help
  1843. new h = Player[playerid][Houseid];
  1844. if(h == 999) return SendClientMessage(playerid,COLOR_RED,"EROR: "COL_WHITE"You don't have a house.");
  1845. if(!IsPlayerInRangeOfPoint(playerid,3.0,House[h][EnterX],House[h][EnterY],House[h][EnterZ])) return SendClientMessage(playerid,COLOR_RED,"EROR: "COL_WHITE"You are not near your house");
  1846. House[h][Lock] = 0;
  1847. SendClientMessage(playerid,-1,"Now your door is unlocked.");
  1848. return 1;
  1849. }
  1850. YCMD:enter(playerid, params[], help)
  1851. {
  1852. #pragma unused params
  1853. #pragma unused help
  1854. new h = GetClosetHouseID(playerid);
  1855. if(h == -1) return SendClientMessage(playerid,COLOR_RED,"EROR: "COL_WHITE"There is no house.");
  1856. if(House[h][On_Sell] == 0 && House[h][Lock] == 0)
  1857. {
  1858. SetPlayerPos(playerid,House[h][ExitX],House[h][ExitY],House[h][ExitZ]);
  1859. SetPlayerInterior(playerid,House[h][IntID]);
  1860. SetPlayerVirtualWorld(playerid,House[h][VW]);
  1861. }
  1862. else return SendClientMessage(playerid,COLOR_RED,"EROR: "COL_WHITE"House is locked/Is not on sale.");
  1863. if(strcmp(House[h][Owner],GetName(playerid),false) == 0)
  1864. {
  1865. new Year, Month, Day;
  1866. getdate(Year, Month, Day);
  1867. House[h][DayEnter] = Day;
  1868. House[h][MonthEnter] = Month;
  1869. CheckHouse(h);
  1870. }
  1871. return 1;
  1872. }
  1873. YCMD:exit(playerid, params[], help)
  1874. {
  1875. #pragma unused params
  1876. #pragma unused help
  1877. new h = GetClosetHouseIntID(playerid);
  1878. if(h == -1) return SendClientMessage(playerid,COLOR_RED,"EROR: "COL_WHITE"There is no house.");
  1879. SetPlayerPos(playerid,House[h][EnterX],House[h][EnterY],House[h][EnterZ]);
  1880. SetPlayerInterior(playerid,0);
  1881. SetPlayerVirtualWorld(playerid,0);
  1882. return 1;
  1883. }
  1884. YCMD:payrent(playerid, params[], help)
  1885. {
  1886. #pragma unused params
  1887. #pragma unused help
  1888. new h = GetClosetHouseID(playerid),string[128];
  1889. if(h == -1) return SendClientMessage(playerid,COLOR_RED,"EROR: "COL_WHITE"There is no house.");
  1890. if(strcmp(House[h][Player_Rent],GetName(playerid), false ) == 0)
  1891. {
  1892. if(House[h][RentPrice] > GetPlayerMoney(playerid)) return SendClientMessage(playerid,COLOR_RED,"EROR: "COL_WHITE"You don't have that kind of money..");
  1893. House[h][Money] += House[h][RentPrice];
  1894. GivePlayerMoney(playerid,-House[h][RentPrice]);
  1895. format(string,128,"You have pay "COL_GREEN"$%d "COL_WHITE"for rent",House[h][RentPrice]);
  1896. SendClientMessage(playerid,-1,string);
  1897. }
  1898. else return SendClientMessage(playerid,COLOR_RED,"EROR: "COL_WHITE"You aren't owner of this house");
  1899. return 1;
  1900. }
  1901. YCMD:hcar(playerid, params[], help)
  1902. {
  1903. #pragma unused help
  1904. if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED, "You must be RCON admin");
  1905. new
  1906. Float:Pos[4],id,vehicle,color[2],string[32];
  1907. if(sscanf(params, "iiii",id,vehicle,color[0],color[1])) return SendClientMessage(playerid, COLOR_RED, "Usage:"COL_WHITE" /hcar [House ID] [Vehicle ID] [Color1] [Color2]");
  1908. if(id >= MAX_HOUSE) return SendClientMessage(playerid, COLOR_RED, "EROR: "COL_WHITE"Try again. You have typed the wrong house id.");
  1909. format(string, sizeof(string), House_File, id);
  1910. if(fexist(string))
  1911. {
  1912. GetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]);
  1913. GetPlayerFacingAngle(playerid,Pos[3]);
  1914. House[id][hCar] = AddStaticVehicleEx(vehicle,Pos[0],Pos[1]+1,Pos[2],Pos[3],color[0],color[1],3600);
  1915. House[id][hCarX] = Pos[0];
  1916. House[id][hCarY] = Pos[1];
  1917. House[id][hCarZ] = Pos[2];
  1918. House[id][hCarA] = Pos[3];
  1919. House[id][hCarC1] = color[0];
  1920. House[id][hCarC2] = color[1];
  1921. House[id][hCarID] = vehicle;
  1922. CheckHouse(id);
  1923. }
  1924. return 1;
  1925. }
  1926. YCMD:findmycar(playerid, params[], help)
  1927. {
  1928. #pragma unused help
  1929. #pragma unused params
  1930. new
  1931. Float:Pos[4];
  1932. new id = Player[playerid][Houseid];
  1933. if(id == 999) return SendClientMessage(playerid,COLOR_RED,"EROR: "COL_WHITE"You don't have a house.");
  1934. GetVehiclePos(House[id][hCar],Pos[0],Pos[1],Pos[2]);
  1935. SetPlayerCheckpoint(playerid,Pos[0],Pos[1],Pos[2],5.0);
  1936. SendClientMessage(playerid,-1,"Your car is marked on map.");
  1937. return 1;
  1938. }
  1939. YCMD:hupgrade(playerid, params[], help)
  1940. {
  1941. #pragma unused help
  1942. #pragma unused params
  1943. new h = Player[playerid][Houseid];
  1944. if(h == 999) return SendClientMessage(playerid,COLOR_RED,"EROR: "COL_WHITE"You don't have a house.");
  1945. if(!IsPlayerInRangeOfPoint(playerid,3.0,House[h][ExitX],House[h][ExitY],House[h][ExitZ])) return SendClientMessage(playerid,COLOR_RED,"EROR: "COL_WHITE"You are not near your house");
  1946. if(ChooseInt[playerid] == 0)
  1947. {
  1948. HouseID1[playerid] = h;
  1949. ChooseInt[playerid] = 1;
  1950. SetPlayerPos(playerid,2496.049804,-1695.238159,1014.742187);
  1951. SetPlayerInterior(playerid,3);
  1952. SetPlayerVirtualWorld(playerid,0);
  1953. TextDrawSetString(hUp[playerid]," House Upgrade~n~~n~~r~< ~w~Price: ~g~$20000 ~r~>");
  1954. TextDrawShowForPlayer(playerid,hUp[playerid]);
  1955. }
  1956. else
  1957. {
  1958. ChooseInt[playerid] = 0;
  1959. SetPlayerPos(playerid,House[HouseID1[playerid]][ExitX],House[HouseID1[playerid]][ExitY],House[HouseID1[playerid]][ExitZ]);
  1960. SetPlayerInterior(playerid,House[HouseID1[playerid]][IntID]);
  1961. TextDrawHideForPlayer(playerid,hUp[playerid]);
  1962. }
  1963. return 1;
  1964. }
  1965. //=====House car storage
  1966. YCMD:hcarwithdraw(playerid, params[], help)
  1967. {
  1968. #pragma unused help
  1969. #pragma unused params
  1970. new houseid = 0,string[128];
  1971. new i = Player[playerid][Houseid];
  1972. if(i == 999) return SendClientMessage(playerid,COLOR_RED,"EROR: "COL_WHITE"You don't have a house.");
  1973. if(House[i][hCarID] > 0)
  1974. {
  1975. new Float:Pos[3]; GetVehiclePos(House[i][hCar],Pos[0],Pos[1],Pos[2]);
  1976. if(!IsPlayerInRangeOfPoint(playerid,10.0,Pos[0],Pos[1],Pos[2])) return SendClientMessage(playerid,COLOR_RED,"EROR: "COL_WHITE"You are not near your house car.");
  1977. houseid = i;
  1978. new money;
  1979. if(sscanf(params, "i",money)) return SendClientMessage(playerid, COLOR_RED, "Usage: /hcarwithdraw [Money]");
  1980. if(money > GetPlayerMoney(playerid)) return SendClientMessage(playerid, COLOR_RED, "You don't have that kind of money.");
  1981. if(money < 1) return SendClientMessage(playerid, COLOR_RED, "Money can't be less then 1");
  1982. House[houseid][hCarMoney] += money;
  1983. GivePlayerMoney(playerid, -money);
  1984. format(string,sizeof(string),"{E0BC1B}You have put in car $%d.Now you have $%d",money,House[houseid][hCarMoney]);
  1985. SendClientMessage(playerid,-1,string);
  1986. CheckHouse(houseid);
  1987. }
  1988. return 1;
  1989. }
  1990. YCMD:hcardeposit(playerid, params[], help)
  1991. {
  1992. #pragma unused help
  1993. #pragma unused params
  1994. new houseid = 0,string[128];
  1995. new i = Player[playerid][Houseid];
  1996. if(i == 999) return SendClientMessage(playerid,COLOR_RED,"EROR: "COL_WHITE"You don't have a house.");
  1997. if(House[i][hCarID] > 0)
  1998. {
  1999. new Float:Pos[3]; GetVehiclePos(House[i][hCar],Pos[0],Pos[1],Pos[2]);
  2000. if(!IsPlayerInRangeOfPoint(playerid,10.0,Pos[0],Pos[1],Pos[2])) return SendClientMessage(playerid,COLOR_RED,"EROR: "COL_WHITE"You are not near your house car.");
  2001. new money;
  2002. if(sscanf(params, "i",money)) return SendClientMessage(playerid, COLOR_RED, "Usage: /hcardeposit [Money]");
  2003. if(money > GetPlayerMoney(playerid)) return SendClientMessage(playerid, COLOR_RED, "You don't have that kind of money.");
  2004. if(money < 1) return SendClientMessage(playerid, COLOR_RED, "Money can't be less then 1");
  2005. House[houseid][hCarMoney] -= money;
  2006. GivePlayerMoney(playerid, money);
  2007. format(string,sizeof(string),"{E0BC1B}You have taken car storage $%d.Now you have $%d",money,House[houseid][hCarMoney]);
  2008. SendClientMessage(playerid,-1,string);
  2009. CheckHouse(houseid);
  2010. }
  2011. return 1;
  2012. }
  2013. YCMD:hcarputgun(playerid, params[], help)
  2014. {
  2015. #pragma unused help
  2016. #pragma unused params
  2017. new houseid = 0,string[128];
  2018. new id = Player[playerid][Houseid];
  2019. if(id == 999) return SendClientMessage(playerid,COLOR_RED,"EROR: "COL_WHITE"You don't have a house.");
  2020. if(House[id][hCarID] > 0)
  2021. {
  2022. new Float:Pos[3]; GetVehiclePos(House[id][hCar],Pos[0],Pos[1],Pos[2]);
  2023. if(!IsPlayerInRangeOfPoint(playerid,10.0,Pos[0],Pos[1],Pos[2])) return SendClientMessage(playerid,COLOR_RED,"EROR: "COL_WHITE"You are not near your house car.");
  2024. new slot,ammo;
  2025. if(sscanf(params, "ii",slot,ammo)) return SendClientMessage(playerid, COLOR_RED, "Usage: /hcarputgun [Slot 1/2] [Ammo]");
  2026. if(ammo > GetPlayerAmmo(playerid)) return SendClientMessage(playerid, COLOR_RED, "You don't have that much ammo.");
  2027. if(ammo < 1) return SendClientMessage(playerid, COLOR_RED, "Ammo can't be less then 1");
  2028. if(slot == 1)
  2029. {
  2030. if(House[houseid][hCarGun1] != 0) return SendClientMessage(playerid,COLOR_RED,"EROR: "COL_WHITE"There is already gun on this slot.");
  2031. House[houseid][hCarGun1] = GetPlayerWeapon(playerid);
  2032. House[houseid][hCarAmmo1] = ammo;
  2033. SetPlayerAmmo(playerid,GetPlayerWeapon(playerid),GetPlayerAmmo(playerid)-ammo);
  2034. format(string,sizeof(string),"{E0BC1B}You have put gun on slot 1.With %d ammo",ammo);
  2035. SendClientMessage(playerid,-1,string);
  2036. CheckHouse(id);
  2037. }
  2038. if(slot == 2)
  2039. {
  2040. if(House[houseid][hCarGun1] != 0) return SendClientMessage(playerid,COLOR_RED,"EROR: "COL_WHITE"There is already gun on this slot.");
  2041. House[houseid][hCarGun2] = GetPlayerWeapon(playerid);
  2042. House[houseid][hCarAmmo2] = ammo;
  2043. SetPlayerAmmo(playerid,GetPlayerWeapon(playerid),GetPlayerAmmo(playerid)-ammo);
  2044. format(string,sizeof(string),"{E0BC1B}You have put gun on slot 2.With %d ammo",ammo);
  2045. SendClientMessage(playerid,-1,string);
  2046. CheckHouse(id);
  2047. }
  2048. }
  2049. return 1;
  2050. }
  2051. YCMD:hcartakegun(playerid, params[], help)
  2052. {
  2053. #pragma unused help
  2054. #pragma unused params
  2055. new houseid = 0,string[128];
  2056. new id = Player[playerid][Houseid];
  2057. if(id == 999) return SendClientMessage(playerid,COLOR_RED,"EROR: "COL_WHITE"You don't have a house.");
  2058. if(House[id][hCarID] > 0)
  2059. {
  2060. new Float:Pos[3]; GetVehiclePos(House[id][hCar],Pos[0],Pos[1],Pos[2]);
  2061. if(!IsPlayerInRangeOfPoint(playerid,10.0,Pos[0],Pos[1],Pos[2])) return SendClientMessage(playerid,COLOR_RED,"EROR: "COL_WHITE"You are not near your house car.");
  2062. new slot,ammo;
  2063. if(sscanf(params, "ii",slot,ammo)) return SendClientMessage(playerid, COLOR_RED, "Usage: /htakegun [Slot 1/2] [Ammo]");
  2064. if(ammo < 1) return SendClientMessage(playerid, COLOR_RED, "Ammo can't be less then 1");
  2065. if(slot == 1)
  2066. {
  2067. if(House[houseid][hCarGun1] == 0) return SendClientMessage(playerid,COLOR_RED,"EROR: "COL_WHITE"There is no gun on this slot.");
  2068. if(ammo > House[houseid][hCarAmmo1]) return SendClientMessage(playerid, COLOR_RED, "EROR:"COL_WHITE" In the safe does not have that much ammo.");
  2069. GivePlayerWeapon(playerid,House[houseid][hCarGun1],ammo);
  2070. House[houseid][hCarAmmo1] -= ammo;
  2071. if(House[houseid][hCarAmmo1] == 0) {House[houseid][hCarGun1] = 0;}
  2072. format(string,sizeof(string),"{E0BC1B}You are take gun from slot 1.With %d ammo",ammo);
  2073. SendClientMessage(playerid,-1,string);
  2074. CheckHouse(id);
  2075. }
  2076. if(slot == 2)
  2077. {
  2078. if(House[houseid][hCarGun2] == 0) return SendClientMessage(playerid,COLOR_RED,"EROR: "COL_WHITE"There is no gun on this slot.");
  2079. if(ammo > House[houseid][hCarAmmo2]) return SendClientMessage(playerid, COLOR_RED, "EROR:"COL_WHITE" In the safe does not have that much ammo.");
  2080. GivePlayerWeapon(playerid,House[houseid][hCarGun2],ammo);
  2081. House[houseid][hCarAmmo2] -= ammo;
  2082. if(House[houseid][hCarAmmo2] == 0) {House[houseid][hCarGun2] = 0;}
  2083. format(string,sizeof(string),"{E0BC2B}You have taken gun from slot 2.With %d ammo",ammo);
  2084. SendClientMessage(playerid,-1,string);
  2085. CheckHouse(id);
  2086. }
  2087. }
  2088. return 1;
  2089. }
  2090. YCMD:hcarpark(playerid, params[], help)
  2091. {
  2092. #pragma unused help
  2093. #pragma unused params
  2094. if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,COLOR_RED,"EROR: "COL_WHITE"You must be in a vehicle");
  2095. new hid,Float:Pos[4];
  2096. GetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]);
  2097. GetPlayerFacingAngle(playerid,Pos[3]);
  2098. new id = Player[playerid][Houseid];
  2099. if(id == 999) return SendClientMessage(playerid,COLOR_RED,"EROR: "COL_WHITE"You don't have a house.");
  2100. if(House[id][hCar] > 0)
  2101. {
  2102. if(House[id][hCar] != GetPlayerVehicleID(playerid)) return SendClientMessage(playerid,COLOR_RED,"EROR: "COL_WHITE"This is not your car.");
  2103. House[hid][hCarX] = Pos[0];
  2104. House[hid][hCarY] = Pos[1];
  2105. House[hid][hCarZ] = Pos[2];
  2106. House[hid][hCarA] = Pos[3];
  2107. GameTextForPlayer(playerid,"Car ~r~parked",3000,0);
  2108. CheckHouse(hid);
  2109. }
  2110. return 1;
  2111. }
  2112. YCMD:hcarcolor(playerid, params[], help)
  2113. {
  2114. #pragma unused help
  2115. #pragma unused params
  2116. if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,COLOR_RED,"EROR: "COL_WHITE"You must be in a vehicle");
  2117. new id = GetPlayerVehicleID(playerid),hid,C[2];
  2118. new i = Player[playerid][Houseid];
  2119. if(i == 999) return SendClientMessage(playerid,COLOR_RED,"EROR: "COL_WHITE"You don't have a house.");
  2120. if(House[i][hCarID] > 0)
  2121. {
  2122. if(House[i][hCar] != GetPlayerVehicleID(playerid)) return SendClientMessage(playerid,COLOR_RED,"EROR: "COL_WHITE"This is not your car.");
  2123. hid = i;
  2124. if(sscanf(params,"ii",C[0],C[1])) return SendClientMessage(playerid,COLOR_RED,"Usage: "COL_WHITE"/hcarcolor [Color 1] [Color 2]");
  2125. House[hid][hCarC1] = C[0];
  2126. House[hid][hCarC2] = C[1];
  2127. ChangeVehicleColor(id,House[hid][hCarC1],House[hid][hCarC2]);
  2128. GameTextForPlayer(playerid,"Car color changed",3000,0);
  2129. CheckHouse(hid);
  2130. }
  2131. return 1;
  2132. }
  2133. YCMD:hphone(playerid, params[], help)
  2134. {
  2135. #pragma unused help
  2136. #pragma unused params
  2137. new id = Player[playerid][Houseid];
  2138. if(id == 999) return SendClientMessage(playerid,COLOR_RED,"EROR: "COL_WHITE"You don't have a house");
  2139. if(!IsPlayerInRangeOfPoint(playerid,3.0,House[id][ExitX],House[id][ExitY],House[id][ExitZ])) return SendClientMessage(playerid,COLOR_RED,"EROR: "COL_WHITE"You are not near your house");
  2140. TogglePlayerControllable(playerid,false);
  2141. PhoneChoose[playerid] = 1;
  2142. TextDrawSetString(Phone1[playerid],"~y~1 2 3~n~4 5 6~n~7 8 9~n~~g~~g~C ~w~0 ~r~H");
  2143. TextDrawSetString(Phone4[playerid],"");
  2144. TextDrawShowForPlayer(playerid,Phone0[playerid]);
  2145. TextDrawShowForPlayer(playerid,Phone1[playerid]);
  2146. TextDrawShowForPlayer(playerid,Phone2[playerid]);
  2147. TextDrawShowForPlayer(playerid,Phone3[playerid]);
  2148. TextDrawShowForPlayer(playerid,Phone4[playerid]);
  2149. TextDrawShowForPlayer(playerid,Phone5[playerid]);
  2150. return 1;
  2151. }
  2152. YCMD:answeronphone(playerid, params[], help)
  2153. {
  2154. #pragma unused help
  2155. #pragma unused params
  2156. if(CallFrom[playerid] != 999 && Calling[CallFrom[playerid]] > 0)
  2157. {
  2158. TalkWith[playerid] = CallFrom[playerid];
  2159. TalkWith[CallFrom[playerid]] = playerid;
  2160. SendClientMessage(playerid,-1,"Somebody has answer the phone");
  2161. Calling[CallFrom[playerid]] = 0;
  2162. CallFrom[playerid] = 999;
  2163. }
  2164. return 1;
  2165. }
  2166. YCMD:changespawn(playerid, params[], help)
  2167. {
  2168. #pragma unused help
  2169. #pragma unused params
  2170. new id = Player[playerid][Houseid];
  2171. if(id == 999) return SendClientMessage(playerid,COLOR_RED,"EROR: "COL_WHITE"You don't have a house");
  2172. if(!IsPlayerInRangeOfPoint(playerid,3.0,House[id][ExitX],House[id][ExitY],House[id][ExitZ])) return SendClientMessage(playerid,COLOR_RED,"EROR: "COL_WHITE"You must be in your house.");
  2173. Player[playerid][Spawn] = 1;
  2174. Player[playerid][SpawnX] = House[id][ExitX];
  2175. Player[playerid][SpawnY] = House[id][ExitY];
  2176. Player[playerid][SpawnZ] = House[id][ExitZ];
  2177. Player[playerid][SpawnInt] = House[id][IntID];
  2178. Player[playerid][SpawnVW] = House[id][VW];
  2179. SendClientMessage(playerid,-1,"Spawn has been changed to a specific location.");
  2180. return 1;
  2181. }
  2182. YCMD:robhouse(playerid, params[], help)
  2183. {
  2184. #pragma unused help
  2185. #pragma unused params
  2186. new id = GetClosetHouseID(playerid),password[5],string[128];
  2187. if(id == -1) return SendClientMessage(playerid,-1,"There is no house");
  2188. if(Player[playerid][RobHouse] > 0) return SendClientMessage(playerid,-1,"You are already robhouse");
  2189. if(sscanf(params,"s[5]",password)) return SendClientMessage(playerid,-1,"Usage: /robhouse [Password]");
  2190. if(strcmp(House[id][LockPass],password,false) == 0)
  2191. {
  2192. if(House[id][Money] == 0)return SendClientMessage(playerid,-1,"There is no money in the house or safe.");
  2193. Player[playerid][RobHouse] = 3600;
  2194. GivePlayerMoney(playerid,House[id][Money]/2);
  2195. House[id][Money] -= House[id][Money]/2;
  2196. format(string,128,"You have robbed a house and taken $%d",House[id][Money]/2);
  2197. SendClientMessage(playerid,-1,string);
  2198. }
  2199. else return SendClientMessage(playerid,-1,"Wrong password");
  2200. return 1;
  2201. }
  2202. //Update 1.2
  2203. YCMD:givekey(playerid, params[], help)
  2204. {
  2205. #pragma unused help
  2206. new string[170],id;
  2207. new i = Player[playerid][Houseid];
  2208. if(Player[playerid][Houseid] == 999) return SendClientMessage(playerid,COLOR_RED,"EROR: "COL_WHITE"You don't have a house");
  2209. if(sscanf(params,"u",id))return SendClientMessage(playerid,COLOR_RED,"Usage: "COL_WHITE"/givekey [Player ID/Part of name]");
  2210. if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "EROR: "COL_WHITE"Invalid player id.");
  2211. if(Player[id][Houseid] != 999) return SendClientMessage(playerid, COLOR_RED, "EROR: "COL_WHITE"That player already has a house.");
  2212. format(House[i][Owner], 32, "%s", GetName(id));
  2213. Player[id][Houseid] = Player[playerid][Houseid];
  2214. Player[playerid][Houseid] = 999;
  2215. Player[id][Houseid] = Player[playerid][Houseid];
  2216. CheckHouse(i);
  2217. format(string,sizeof(string),"{E0BC1B}Owner: "COL_WHITE"%s\n{E0BC1B}House name: "COL_WHITE"%s\n{E0BC1B}Price: "COL_WHITE"%d\n{E0BC1B}Level: "COL_WHITE"%d\n{E0BC1B}Rent price: "COL_WHITE"%d\n{E0BC1B}Address: "COL_WHITE"%s\n (/renthouse)",House[i][Owner],House[i][HouseName],House[i][Price],House[i][Level],House[i][RentPrice],House[i][Address]);
  2218. UpdateDynamic3DTextLabelText(House[i][DLabel],-1,string);
  2219. UpdatePlayerInformation(playerid);
  2220. return 1;
  2221. }
  2222. YCMD:myhouse(playerid, params[], help)
  2223. {
  2224. #pragma unused help
  2225. #pragma unused params
  2226. new i = Player[playerid][Houseid];
  2227. if(Player[playerid][Houseid] == 999) return SendClientMessage(playerid,COLOR_RED,"EROR: "COL_WHITE"You don't have a house");
  2228. SetPlayerCheckpoint(playerid,House[i][EnterX],House[i][EnterY],House[i][EnterZ],2.0);
  2229. PlayerCP[playerid] = 1;
  2230. SendFormatMSG(playerid,-1,"Your house address is %s.House is marked on map",House[i][Address]);
  2231. return 1;
  2232. }
  2233. //==========Stock
  2234. stock CreateSaveHouse(name[],id,price,level,vw,Float:PosX,Float:PosY,Float:PosZ)
  2235. {
  2236. new dFile[32],string[200],number = randomEx(1000,9999);
  2237. new zone[48];
  2238. new Year, Month, Day;
  2239. getdate(Year, Month, Day);
  2240. GetHouse2DZone(id, zone, 48);
  2241. format(dFile, 35, House_File, id);
  2242.  
  2243. new
  2244. INI:File = INI_Open(dFile);
  2245.  
  2246. INI_WriteFloat(File, "EnterX", PosX);
  2247. INI_WriteFloat(File, "EnterY", PosY);
  2248. INI_WriteFloat(File, "EnterZ", PosZ);
  2249. INI_WriteFloat(File, "ExitX", 223.42928466797);
  2250. INI_WriteFloat(File, "ExitY", 1287.3064941406);
  2251. INI_WriteFloat(File, "ExitZ", 1082.14);
  2252. INI_WriteString(File, "HouseName", name);
  2253. INI_WriteString(File, "Owner", "Apartment");
  2254. INI_WriteInt(File, "Price", price);
  2255. INI_WriteInt(File, "Level", level);
  2256. INI_WriteInt(File, "Interior", 1);
  2257. INI_WriteInt(File, "VW", vw);
  2258. INI_WriteInt(File, "On_Sell", 1);
  2259. INI_WriteInt(File, "Lock", 0);
  2260. INI_WriteInt(File, "RentPrice", 100);
  2261. INI_WriteString(File, "PlayerRent", "Nobody");
  2262. INI_WriteInt(File, "Money", 0);
  2263. INI_WriteInt(File, "Gun1", 0);
  2264. INI_WriteInt(File, "Gun2", 0);
  2265. INI_WriteInt(File, "Ammo1", 0);
  2266. INI_WriteInt(File, "Ammo2", 0);
  2267. INI_WriteString(File, "LockPass", "1111");
  2268. INI_WriteFloat(File, "hCarX", 0);
  2269. INI_WriteFloat(File, "hCarY", 0);
  2270. INI_WriteFloat(File, "hCarZ", 0);
  2271. INI_WriteFloat(File, "hCarA", 0);
  2272. INI_WriteInt(File, "hCarC1", 0);
  2273. INI_WriteInt(File, "hCarC2", 0);
  2274. INI_WriteInt(File, "hCarID", 0);
  2275. INI_WriteInt(File, "hCarMoney",0);
  2276. INI_WriteInt(File, "hCarGun1",0);
  2277. INI_WriteInt(File, "hCarGun2",0);
  2278. INI_WriteInt(File, "hCarAmmo1", 0);
  2279. INI_WriteInt(File, "hCarAmmo2", 0);
  2280. format(string,sizeof(string),"%d",number);
  2281. INI_WriteString(File, "PhoneNum", string);
  2282. format(string,sizeof(string),"%s %d",zone,id);
  2283. INI_WriteString(File, "Address", string);
  2284. INI_WriteInt(File, "DayEnter", Day);
  2285. INI_WriteInt(File, "MonthEnter", Month);
  2286.  
  2287. INI_Close(File);
  2288.  
  2289. House[id][EnterX] = PosX;
  2290. House[id][EnterY] = PosY;
  2291. House[id][EnterZ] = PosZ;
  2292. House[id][ExitX] = 223.42928466797;
  2293. House[id][ExitY] = 1287.3064941406;
  2294. House[id][ExitZ] = 1082.14;
  2295. format(House[id][HouseName],48,"%s",name);
  2296. format(House[id][Owner],48,"Apartment");
  2297. House[id][Price] = price;
  2298. House[id][Level] = level;
  2299. House[id][IntID] = 1;
  2300. House[id][VW] = vw;
  2301. House[id][On_Sell] = 1;
  2302. House[id][Lock] = 0;
  2303. House[id][RentPrice] = 100;
  2304. format(House[id][Player_Rent],48,"Nobody");
  2305. House[id][Money] = 0;
  2306. House[id][Gun1] = 0;
  2307. House[id][Gun2] = 0;
  2308. House[id][Ammo1] = 0;
  2309. House[id][Ammo2] = 0;
  2310. format(House[id][LockPass],48,"1111");
  2311. House[id][hCarX] = 0;
  2312. House[id][hCarY] = 0;
  2313. House[id][hCarZ] = 0;
  2314. House[id][hCarA] = 0;
  2315. House[id][hCarC1] = 0;
  2316. House[id][hCarC2] = 0;
  2317. House[id][hCarID] = 0;
  2318. House[id][hCarMoney] = 0;
  2319. House[id][hCarGun1] = 0;
  2320. House[id][hCarGun2] = 0;
  2321. House[id][hCarAmmo1] = 0;
  2322. House[id][hCarAmmo2] = 0;
  2323. format(House[id][PhoneNum],5,"%d",number);
  2324. format(House[id][Address],32,"%s %d",zone,id);
  2325. House[id][DayEnter] = Day;
  2326. House[id][MonthEnter] = Month;
  2327.  
  2328. House[id][PickupU] = CreateDynamicPickup(1273, 23, PosX,PosY,PosZ,-1,-1,-1,100.0);
  2329. format(string,sizeof(string),"{29CC3F}Owner: "COL_WHITE"Apartment\n{29CC3F}House name: "COL_WHITE"%s\n{29CC3F}Price: "COL_WHITE"%d\n{29CC3F}Level: "COL_WHITE"%d\n{29CC3F}Address: "COL_WHITE"%s %d\n (/buyhouse)",name,price,level,zone,id);
  2330. House[id][DLabel] = CreateDynamic3DTextLabel(string, 0xFFFFFF, PosX,PosY,PosZ, 100, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 100);
  2331. House[id][Icon] = CreateDynamicMapIcon(PosX,PosY,PosZ, 31, 0, -1, -1, -1, 100.0);
  2332. }
  2333. stock CheckHouse(id)
  2334. {
  2335. new dFile[32];
  2336. format(dFile, 35, House_File, id);
  2337.  
  2338. new
  2339. INI:File = INI_Open(dFile);
  2340.  
  2341. INI_WriteFloat(File, "EnterX", House[id][EnterX]);
  2342. INI_WriteFloat(File, "EnterY", House[id][EnterY]);
  2343. INI_WriteFloat(File, "EnterZ", House[id][EnterZ]);
  2344. INI_WriteFloat(File, "ExitX", House[id][ExitX]);
  2345. INI_WriteFloat(File, "ExitY", House[id][ExitY]);
  2346. INI_WriteFloat(File, "ExitZ", House[id][ExitZ]);
  2347. INI_WriteString(File, "HouseName", House[id][HouseName]);
  2348. INI_WriteString(File, "Owner", House[id][Owner]);
  2349. INI_WriteInt(File, "Price", House[id][Price]);
  2350. INI_WriteInt(File, "Level", House[id][Level]);
  2351. INI_WriteInt(File, "Interior", House[id][IntID]);
  2352. INI_WriteInt(File, "VW", House[id][VW]);
  2353. INI_WriteInt(File, "On_Sell", House[id][On_Sell]);
  2354. INI_WriteInt(File, "Lock", House[id][Lock]);
  2355. INI_WriteInt(File, "RentPrice", House[id][RentPrice]);
  2356. INI_WriteString(File, "PlayerRent", House[id][Player_Rent]);
  2357. INI_WriteInt(File, "Money", House[id][Money]);
  2358. INI_WriteInt(File, "Gun1", House[id][Gun1]);
  2359. INI_WriteInt(File, "Gun2", House[id][Gun2]);
  2360. INI_WriteInt(File, "Ammo1", House[id][Ammo1]);
  2361. INI_WriteInt(File, "Ammo2", House[id][Ammo2]);
  2362. INI_WriteString(File, "LockPass", House[id][LockPass]);
  2363. INI_WriteFloat(File, "hCarX", House[id][hCarX]);
  2364. INI_WriteFloat(File, "hCarY", House[id][hCarY]);
  2365. INI_WriteFloat(File, "hCarZ", House[id][hCarZ]);
  2366. INI_WriteFloat(File, "hCarA", House[id][hCarA]);
  2367. INI_WriteInt(File, "hCarC1", House[id][hCarC1]);
  2368. INI_WriteInt(File, "hCarC2", House[id][hCarC2]);
  2369. INI_WriteInt(File, "hCarID", House[id][hCarID]);
  2370. INI_WriteInt(File, "hCarMoney", House[id][hCarMoney]);
  2371. INI_WriteInt(File, "hCarGun1", House[id][hCarGun1]);
  2372. INI_WriteInt(File, "hCarGun2", House[id][hCarGun2]);
  2373. INI_WriteInt(File, "hCarAmmo1", House[id][hCarAmmo1]);
  2374. INI_WriteInt(File, "hCarAmmo2", House[id][hCarAmmo2]);
  2375. INI_WriteString(File, "PhoneNum", House[id][PhoneNum]);
  2376. INI_WriteString(File, "Address", House[id][Address]);
  2377. INI_WriteInt(File, "DayEnter", House[id][DayEnter]);
  2378. INI_WriteInt(File, "MonthEnter", House[id][MonthEnter]);
  2379. INI_Close(File);
  2380. }
  2381. stock ReadHouse(i)
  2382. {
  2383. new string[200];
  2384. if(House[i][On_Sell] == 1)
  2385. {
  2386. format(string,sizeof(string),"{29CC3F}Owner: "COL_WHITE"Apartment\n{29CC3F}House name: "COL_WHITE"%s\n{29CC3F}Price: "COL_WHITE"%d\n{29CC3F}Level: "COL_WHITE"%d\n{29CC3F}Address: "COL_WHITE"%s\n (/buyhouse)",House[i][HouseName],House[i][Price],House[i][Level],House[i][Address]);
  2387. House[i][DLabel] = CreateDynamic3DTextLabel(string, 0xFFFFFF, House[i][EnterX],House[i][EnterY],House[i][EnterZ], 100, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 100);
  2388. House[i][PickupU] = CreateDynamicPickup(1273, 23, House[i][EnterX],House[i][EnterY],House[i][EnterZ],-1,-1,-1,100.0);
  2389. House[i][Icon] = CreateDynamicMapIcon(House[i][EnterX],House[i][EnterY],House[i][EnterZ], 31, 0, -1, -1, -1, 100.0);
  2390. if(House[i][hCarID] != 0)
  2391. {
  2392. House[i][hCar] = AddStaticVehicleEx(House[i][hCarID],House[i][hCarX],House[i][hCarY],House[i][hCarZ],House[i][hCarA],House[i][hCarC1],House[i][hCarC2],3600);
  2393. format(HouseOwner[House[i][hCar]],32,"%s",House[i][Owner]);
  2394. }
  2395. else if(House[i][hCarID] == 0)
  2396. {
  2397. House[i][hCar] = 0;
  2398. }
  2399. }
  2400. else if(House[i][On_Sell] == 0)
  2401. {
  2402. format(string,sizeof(string),"{E0BC1B}Owner: "COL_WHITE"%s\n{E0BC1B}House name: "COL_WHITE"%s\n{E0BC1B}Price: "COL_WHITE"%d\n{E0BC1B}Level: "COL_WHITE"%d\n{E0BC1B}Rent price: "COL_WHITE"%d\n{E0BC1B}Address: "COL_WHITE"%s\n (/renthouse)",House[i][Owner],House[i][HouseName],House[i][Price],House[i][Level],House[i][RentPrice],House[i][Address]);
  2403. House[i][DLabel] = CreateDynamic3DTextLabel(string, 0xFFFFFF, House[i][EnterX],House[i][EnterY],House[i][EnterZ], 100, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 100);
  2404. House[i][PickupU] = CreateDynamicPickup(1272, 23, House[i][EnterX],House[i][EnterY],House[i][EnterZ],-1,-1,-1,100.0);
  2405. House[i][Icon] = CreateDynamicMapIcon(House[i][EnterX],House[i][EnterY],House[i][EnterZ], 32, 0, -1, -1, -1, 100.0);
  2406. if(House[i][hCarID] != 0)
  2407. {
  2408. House[i][hCar] = AddStaticVehicleEx(House[i][hCarID],House[i][hCarX],House[i][hCarY],House[i][hCarZ],House[i][hCarA],House[i][hCarC1],House[i][hCarC2],3600);
  2409. format(HouseOwner[House[i][hCar]],32,"%s",House[i][Owner]);
  2410. }
  2411. else if(House[i][hCarID] == 0)
  2412. {
  2413. House[i][hCar] = 0;
  2414. }
  2415. }
  2416. }
  2417. //==========Public
  2418. forward GetClosetHouseID(playerid);
  2419. public GetClosetHouseID(playerid)
  2420. {
  2421. new Float:Distance;
  2422. for(new h; h<MAX_HOUSE; h++)
  2423. {
  2424. Distance = GetDistanceToHouse(playerid, h);
  2425. if(Distance < 2.0)
  2426. {
  2427. return h;
  2428. }
  2429. }
  2430. return -1;
  2431. }
  2432. forward Float:GetDistanceToHouse(playerid, h);
  2433. public Float:GetDistanceToHouse(playerid, h)
  2434. {
  2435. new Float:x1,Float:y1,Float:z1,Float:x2,Float:y2,Float:z2;
  2436. GetPlayerPos(playerid,x1,y1,z1);
  2437. x2 = House[h][EnterX];
  2438. y2 = House[h][EnterY];
  2439. z2 = House[h][EnterZ];
  2440. return floatsqroot(floatpower(floatabs(floatsub(x2,x1)),2)+floatpower(floatabs(floatsub(y2,y1)),2)+floatpower(floatabs(floatsub(z2,z1)),2));
  2441. }
  2442. forward GetClosetHouseIntID(playerid);
  2443. public GetClosetHouseIntID(playerid)
  2444. {
  2445. new Float:Distance;
  2446. for(new h; h<MAX_HOUSE; h++)
  2447. {
  2448. Distance = GetDistanceToHouseInt(playerid, h);
  2449. if(Distance < 10.0 && House[h][VW] == GetPlayerVirtualWorld(playerid))
  2450. {
  2451. return h;
  2452. }
  2453. }
  2454. return -1;
  2455. }
  2456. forward Float:GetDistanceToHouseInt(playerid, h);
  2457. public Float:GetDistanceToHouseInt(playerid, h)
  2458. {
  2459. new Float:x1,Float:y1,Float:z1,Float:x2,Float:y2,Float:z2;
  2460. GetPlayerPos(playerid,x1,y1,z1);
  2461. x2 = House[h][ExitX];
  2462. y2 = House[h][ExitY];
  2463. z2 = House[h][ExitZ];
  2464. return floatsqroot(floatpower(floatabs(floatsub(x2,x1)),2)+floatpower(floatabs(floatsub(y2,y1)),2)+floatpower(floatabs(floatsub(z2,z1)),2));
  2465. }
  2466. stock GetName(playerid)
  2467. {
  2468. new
  2469. pName[MAX_PLAYER_NAME];
  2470.  
  2471. GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
  2472. return pName;
  2473. }
  2474. stock ProxDetector(playerid, const msg [], color, maxdistance = 50)
  2475. {
  2476. new
  2477. Float: x1,
  2478. Float: y1,
  2479. Float: z1,
  2480. distance,
  2481. string [128];
  2482.  
  2483. if (GetPlayerName (playerid, string, sizeof string))
  2484. {
  2485. format (string, sizeof string, "%s", msg);
  2486. GetPlayerPos (playerid, x1, y1, z1);
  2487. for (new i = 0; i < MAX_PLAYERS; ++i)
  2488. {
  2489. if (IsPlayerConnected (i) && !IsPlayerNPC (i))
  2490. {
  2491. if (i == playerid)
  2492. SendClientMessage (i, color, string);
  2493. else
  2494. {
  2495. distance = floatround (GetPlayerDistanceFromPoint (i, x1, y1, z1));
  2496. if (distance <= maxdistance)
  2497. SendClientMessage (i, ColorFade (color, distance, maxdistance), string);
  2498. }
  2499. }
  2500. }
  2501. return 1;
  2502. }
  2503. return 0;
  2504. }
  2505. stock ColorFade (color, value, maxvalue)
  2506. {
  2507. if (0 <= value <= maxvalue)
  2508. {
  2509. new
  2510. Float: ratio = float (value) / float (maxvalue);
  2511. new
  2512. r = max (0, min (255, floatround (float ((color >> 24) & 0xFF) * ratio))),
  2513. g = max (0, min (255, floatround (float ((color >> 16) & 0xFF) * ratio))),
  2514. b = max (0, min (255, floatround (float ((color >> 8) & 0xFF) * ratio)));
  2515. return (r << 24) | (g << 16) | (b << 8) | (value & 0xFF);
  2516. }
  2517. return 0;
  2518. }
  2519. stock GetClosestVehicleID(playerid)
  2520. {
  2521. new
  2522. Float:Pos[3],
  2523. Float:dist,
  2524. Float:closedist=10.0,
  2525. closeveh;
  2526. for(new i=0; i < MAX_VEHICLES; i++)
  2527. {
  2528. if(GetVehiclePos(i, Pos[0], Pos[1], Pos[2]))
  2529. {
  2530. dist = GetPlayerDistanceFromPoint(playerid, Pos[0], Pos[1], Pos[2]);
  2531. if(dist < closedist)
  2532. {
  2533. closedist = dist;
  2534. closeveh = i;
  2535. }
  2536. }
  2537. }
  2538. return closeveh;
  2539. }
  2540. forward GlobalTimer();
  2541. public GlobalTimer()
  2542. {
  2543. new Year, Month, Day,string[64];
  2544. getdate(Year, Month, Day);
  2545. for(new id = 0; id <= MAX_HOUSE;id++)
  2546. {
  2547. format(string,64,House_File,id);
  2548. if(House[id][DayEnter]+MAX_DAYS <= Day && House[id][On_Sell] == 0)
  2549. {
  2550. if(fexist(string))
  2551. {
  2552. //If month have 31 days
  2553. if(House[id][MonthEnter] == 1 || House[id][MonthEnter] == 3 || House[id][MonthEnter] == 5 || House[id][MonthEnter] == 7 || House[id][MonthEnter] == 8 || House[id][MonthEnter] == 10 || House[id][MonthEnter] == 12)
  2554. {
  2555. if(House[id][DayEnter]+MAX_DAYS > 31)
  2556. {
  2557. new newday = (31-House[id][DayEnter]);
  2558. new newday1 = MAX_DAYS-newday;
  2559. if(newday1 != Day) return 1;
  2560. }
  2561. }
  2562. //If month have 30 days
  2563. if(House[id][MonthEnter] == 4 || House[id][MonthEnter] == 6 || House[id][MonthEnter] == 9 || House[id][MonthEnter] == 11)
  2564. {
  2565. if(House[id][DayEnter]+MAX_DAYS > 30)
  2566. {
  2567. new newday = (30-House[id][DayEnter]);
  2568. new newday1 = MAX_DAYS-newday;
  2569. if(newday1 != Day) return 1;
  2570. }
  2571. }
  2572. //If month have 29 days
  2573. if(House[id][MonthEnter] == 2)
  2574. {
  2575. if(House[id][DayEnter]+MAX_DAYS > 29)
  2576. {
  2577. new newday = (29-House[id][DayEnter]);
  2578. new newday1 = MAX_DAYS-newday;
  2579. if(newday1 != Day) return 1;
  2580. }
  2581. }
  2582. ResetPlayerHouseID(House[id][Owner]);
  2583. House[id][On_Sell] = 1;
  2584. format(House[id][Owner],48,"Apartment");
  2585. CheckHouse(id);
  2586. DestroyDynamicPickup(House[id][PickupU]);
  2587. House[id][PickupU] = CreateDynamicPickup(1273, 23, House[id][EnterX],House[id][EnterY],House[id][EnterZ],-1,-1,-1,100.0);
  2588. DestroyDynamicMapIcon(House[id][Icon]);
  2589. House[id][Icon] = CreateDynamicMapIcon(House[id][EnterX],House[id][EnterY],House[id][EnterZ], 31, 0, -1, -1, -1, 100.0);
  2590. format(string,sizeof(string),"{29CC3F}Owner: "COL_WHITE"Apartment\n{29CC3F}House Name: "COL_WHITE"%s\n{29CC3F}Price: "COL_WHITE"%d\n{29CC3F}Level: "COL_WHITE"%d\n{29CC3F}Address: "COL_WHITE"%s\n (/buyhouse)",House[id][HouseName],House[id][Price],House[id][Level],House[id][Address]);
  2591. UpdateDynamic3DTextLabelText(House[id][DLabel],-1,string);
  2592. printf("House ID %d has been unowned",id);
  2593. }
  2594. }
  2595. }
  2596. foreach(Player, i)
  2597. {
  2598. //===Bills===
  2599. if(Player[i][Houseid] != 999)
  2600. {
  2601. Player[i][Sec]++;
  2602. if(Player[i][Sec] >= 60) {Player[i][Sec] = 0; Player[i][Min]++;}
  2603. if(Player[i][Min] == 60)
  2604. {
  2605. Player[i][Min] = 0;
  2606. new money = randomEx(50,150);
  2607. SendFormatMSG(i,-1,"You pay for house bills {13AD32}$%d",money);
  2608. GivePlayerMoney(i,-money);
  2609. }
  2610. }
  2611. //Phone
  2612. if(Calling[i] > 0)
  2613. {
  2614. Calling[i]--;
  2615. if(Calling[i] == 0) {SendClientMessage(i,-1,"There is no answer.");}
  2616. }
  2617. if(Player[i][RobHouse] > 0) Player[i][RobHouse]--;
  2618. }
  2619. return 1;
  2620. }
  2621. stock UpdatePlayerInformation(playerid)
  2622. {
  2623. new dFile[32];
  2624. format(dFile, 35, FILE_FOR_PLAYER, GetName(playerid));
  2625.  
  2626. new
  2627. INI:UserFile = INI_Open(dFile);
  2628.  
  2629. INI_WriteFloat(UserFile, "pSpawnX", Player[playerid][SpawnX]);
  2630. INI_WriteFloat(UserFile, "pSpawnY", Player[playerid][SpawnY]);
  2631. INI_WriteFloat(UserFile, "pSpawnZ", Player[playerid][SpawnZ]);
  2632. INI_WriteInt(UserFile, "pSpawn", Player[playerid][Spawn]);
  2633. INI_WriteInt(UserFile, "pSpawnInt", Player[playerid][SpawnInt]);
  2634. INI_WriteInt(UserFile, "pVW", Player[playerid][SpawnVW]);
  2635. INI_WriteInt(UserFile, "RobHouse", Player[playerid][RobHouse]);
  2636. INI_WriteInt(UserFile, "HouseID", Player[playerid][Houseid]);
  2637. INI_WriteInt(UserFile, "Bill", Player[playerid][Min]);
  2638.  
  2639. INI_Close(UserFile);
  2640. }
  2641. stock ResetPlayerHouseID(name[])
  2642. {
  2643. new dFile[32];
  2644. format(dFile, 35, FILE_FOR_PLAYER, name);
  2645.  
  2646. new
  2647. INI:UserFile = INI_Open(dFile);
  2648.  
  2649. INI_WriteInt(UserFile, "HouseID", 999);
  2650. INI_Close(UserFile);
  2651. }
  2652.  
  2653.  
  2654. stock GetHouse2DZone(id, zone[], len)
  2655. {
  2656. new Float:x = House[id][EnterX], Float:y = House[id][EnterY];
  2657. for(new i = 0; i != sizeof(SanAndreasZones); i++ )
  2658. {
  2659. if(x >= SanAndreasZones[i][Zone_Area][0] && x <= SanAndreasZones[i][Zone_Area][3] && y >= SanAndreasZones[i][Zone_Area][1] && y <= SanAndreasZones[i][Zone_Area][4])
  2660. return format(zone, len, SanAndreasZones[i][Zone_Name], 0);
  2661. }
  2662. return 0;
  2663. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement