Advertisement
Guest User

Untitled

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