Advertisement
Guest User

Gagi's Dynamic House System

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