Advertisement
Guest User

Untitled

a guest
Apr 11th, 2015
291
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 89.31 KB | None | 0 0
  1. #include <a_samp>
  2. #include <zcmd>
  3. #include <sscanf2>
  4. #include <streamer>
  5.  
  6. new bool:SpawnAtHouse = false;
  7. new ExitHouseTimer = 1000;
  8. new bool:ShowBoughtHouses = true; //false
  9. new bool:LoadCarsDuringFSInit = false;
  10. new bool:AutomaticInsurance = true;
  11.  
  12. #undef MAX_PLAYERS
  13. #define MAX_PLAYERS 30
  14.  
  15. #define MAX_HOUSES 1000
  16. #define MAX_HOUSESPERPLAYER 2
  17. #define HouseUpgradePercent 100
  18. #define ParkRange 150.0
  19.  
  20. #define HouseFile "PPC_Housing/House%i.ini"
  21.  
  22. #define DialogHouseMenu 7880
  23. #define DialogUpgradeHouse 7881
  24. #define DialogGoHome 7882
  25. #define DialogHouseNameChange 7883
  26. #define DialogSellHouse 7884
  27. #define DialogBuyCarClass 7885
  28. #define DialogBuyCar 7886
  29. #define DialogSellCar 7887
  30. #define DialogBuyInsurance 7888
  31. #define DialogGetCarSelectHouse 7889
  32. #define DialogGetCarSelectCar 7890
  33.  
  34. #define VClassBike 1
  35. #define VClassBoat 2
  36. #define VClassConvertible 3
  37. #define VClassHelicopter 4
  38. #define VClassIndustrial 5
  39. #define VClassLowRider 6
  40. #define VClassOffRoad 7
  41. #define VClassPlane 8
  42. #define VClassPublic 9
  43. #define VClassRCVehicle 10
  44. #define VClassSaloons 11
  45. #define VClassSportCar 12
  46. #define VClassStationCar 13
  47. #define VClassTrailer 14
  48. #define VClassUnique 15
  49.  
  50. enum THouseData
  51. {
  52. PickupID,
  53. Text3D:DoorText,
  54. MapIconID,
  55. bool:Owned,
  56. Owner[24],
  57. HouseName[100],
  58. Float:HouseX,
  59. Float:HouseY,
  60. Float:HouseZ,
  61. HouseLevel,
  62. HouseMaxLevel,
  63. HousePrice,
  64. bool:HouseOpened,
  65. bool:Insurance,
  66. VehicleIDs[10],
  67. bool:StaticHouse,
  68. CarSlots
  69. }
  70.  
  71. new AHouseData[MAX_HOUSES][THouseData];
  72.  
  73. enum TVehicleData
  74. {
  75. BelongsToHouse,
  76. bool:Owned,
  77. Owner[24],
  78. Model,
  79. PaintJob,
  80. Components[14],
  81. Color1,
  82. Color2,
  83. Float:SpawnX,
  84. Float:SpawnY,
  85. Float:SpawnZ,
  86. Float:SpawnRot
  87. }
  88.  
  89. new AVehicleData[2000][TVehicleData];
  90.  
  91. enum TPlayerData
  92. {
  93. Houses[2],
  94. CurrentHouse,
  95. DialogBuyVClass,
  96. DialogGetCarHouseID
  97. }
  98.  
  99. new APlayerData[MAX_PLAYERS][TPlayerData];
  100.  
  101. enum THouseInterior
  102. {
  103. InteriorName[50],
  104. InteriorID,
  105. Float:IntX,
  106. Float:IntY,
  107. Float:IntZ
  108. }
  109.  
  110. new AHouseInteriors[][THouseInterior] =
  111. {
  112. {"Dummy", 0, 0.0, 0.0, 0.0},
  113. {"Small motel room", 10, 2262.83, -1137.71, 1050.63},
  114. {"Small house", 2, 2467.36, -1698.38, 1013.51},
  115. {"Small house 2", 1, 223.00, 1289.26, 1082.20},
  116. {"Medium house", 10, 2260.76, -1210.45, 1049.02},
  117. {"Medium house 2", 8, 2365.42, -1131.85, 1050.88},
  118. {"Duplex house", 12, 2324.33, -1144.79, 1050.71},
  119. {"Big house", 15, 295.14, 1474.47, 1080.52},
  120. {"Big duplex house", 3, 235.50, 1189.17, 1080.34},
  121. {"Huge house", 7, 225.63, 1022.48, 1084.07},
  122. {"Mansion", 5, 1299.14, -794.77, 1084.00}
  123. };
  124.  
  125. enum TBuyableVehicle
  126. {
  127. CarName[50],
  128. VehicleClass,
  129. CarModel,
  130. Price
  131. }
  132. new ABuyableVehicles[][TBuyableVehicle] =
  133. {
  134. {"Admiral", VClassSaloons, 445, 50000},
  135. {"Alpha", VClassSportCar, 602, 50000},
  136. {"Ambulance", VClassPublic, 416, 50000},
  137. {"Andromada", VClassPlane, 592, 50000},
  138. {"Article Trailer", VClassTrailer, 591, 50000},
  139. // {"AT400", VClassPlane, 577, 50000},
  140. {"Baggage", VClassUnique, 485, 50000},
  141. {"Baggage Trailer A", VClassTrailer, 606, 50000},
  142. {"Baggage Trailer B", VClassTrailer, 607, 50000},
  143. {"Bandito", VClassOffRoad, 568, 50000},
  144. {"Banshee", VClassSportCar, 429, 50000},
  145. {"Barracks", VClassPublic, 433, 50000},
  146. {"Beagle", VClassPlane, 511, 50000},
  147. {"Benson", VClassIndustrial, 499, 50000},
  148. {"Berkley's RC Van", VClassIndustrial, 459, 50000},
  149. {"BF Injection", VClassOffRoad, 424, 50000},
  150. {"BF-400", VClassBike, 581, 50000},
  151. {"Bike", VClassBike, 509, 50000},
  152. {"Blade", VClassLowRider, 536, 50000},
  153. {"Blista Compact", VClassSportCar, 496, 50000},
  154. {"Bloodring Banger", VClassSaloons, 504, 50000},
  155. {"BMX", VClassBike, 481, 50000},
  156. {"Bobcat", VClassIndustrial, 422, 50000},
  157. {"Boxville 1", VClassIndustrial, 498, 50000},
  158. {"Boxville 2", VClassIndustrial, 609, 50000},
  159. {"Bravura", VClassSaloons, 401, 50000},
  160. {"Broadway", VClassLowRider, 575, 50000},
  161. // {"Brownstreak (train)", VClassUnique, 538, 50000},
  162. {"Buccaneer", VClassSaloons, 518, 50000},
  163. {"Buffalo", VClassSportCar, 402, 50000},
  164. {"Bullet", VClassSportCar, 541, 50000},
  165. {"Burrito", VClassIndustrial, 482, 50000},
  166. {"Bus", VClassPublic, 431, 50000},
  167. {"Cabbie", VClassPublic, 438, 50000},
  168. {"Caddy", VClassUnique, 457, 50000},
  169. {"Cadrona", VClassSaloons, 527, 50000},
  170. {"Camper", VClassUnique, 483, 50000},
  171. {"Cargo Trailer", VClassTrailer, 435, 50000},
  172. {"Cargobob", VClassHelicopter, 548, 50000},
  173. {"Cement Truck", VClassIndustrial, 524, 50000},
  174. {"Cheetah", VClassSportCar, 415, 50000},
  175. {"Clover", VClassSaloons, 542, 50000},
  176. {"Club", VClassSportCar, 589, 50000},
  177. {"Coach", VClassPublic, 437, 50000},
  178. {"Coastguard", VClassBoat, 472, 50000},
  179. {"Combine Harvester", VClassUnique, 532, 50000},
  180. {"Comet", VClassConvertible, 480, 50000},
  181. {"Cropduster", VClassPlane, 512, 50000},
  182. {"DFT-30", VClassIndustrial, 578, 50000},
  183. {"Dinghy", VClassBoat, 473, 50000},
  184. {"Dodo", VClassPlane, 593, 50000},
  185. {"Dozer", VClassUnique, 486, 50000},
  186. {"Dumper", VClassUnique, 406, 50000},
  187. {"Dune", VClassOffRoad, 573, 50000},
  188. {"Elegant", VClassSaloons, 507, 50000},
  189. {"Elegy", VClassSaloons, 562, 50000},
  190. {"Emperor", VClassSaloons, 585, 50000},
  191. {"Enforcer", VClassPublic, 427, 50000},
  192. {"Esperanto", VClassSaloons, 419, 50000},
  193. {"Euros", VClassSportCar, 587, 50000},
  194. {"Faggio", VClassBike, 462, 50000},
  195. {"Farm Trailer", VClassTrailer, 610, 50000},
  196. {"FBI Rancher", VClassPublic, 490, 50000},
  197. {"FBI Truck", VClassPublic, 528, 50000},
  198. {"FCR-900", VClassBike, 521, 50000},
  199. {"Feltzer", VClassConvertible, 533, 50000},
  200. {"Firetruck", VClassPublic, 407, 50000},
  201. {"Firetruck LA", VClassPublic, 544, 50000},
  202. {"Flash", VClassSportCar, 565, 50000},
  203. {"Flatbed", VClassIndustrial, 455, 50000},
  204. {"Fluids Trailer", VClassTrailer, 584, 50000},
  205. {"Forklift", VClassUnique, 530, 50000},
  206. {"Fortune", VClassSaloons, 526, 50000},
  207. {"Freeway", VClassBike, 463, 50000},
  208. // {"Freight (train)", VClassUnique, 537, 50000},
  209. // {"Freight Box Trailer (train)", VClassTrailer, 590, 50000},
  210. // {"Freight Flat Trailer (train)", VClassTrailer, 569, 50000},
  211. {"Glendale", VClassSaloons, 466, 50000},
  212. {"Glendale Shit", VClassSaloons, 604, 50000},
  213. {"Greenwood", VClassSaloons, 492, 50000},
  214. {"Hermes", VClassSaloons, 474, 50000},
  215. {"Hotdog", VClassUnique, 588, 50000},
  216. {"Hotknife", VClassUnique, 434, 50000},
  217. {"Hotring Racer 1", VClassSportCar, 494, 50000},
  218. {"Hotring Racer 2", VClassSportCar, 502, 50000},
  219. {"Hotring Racer 3", VClassSportCar, 503, 50000},
  220. {"HPV1000", VClassPublic, 523, 50000},
  221. {"Hunter", VClassHelicopter, 425, 50000},
  222. {"Huntley", VClassOffRoad, 579, 50000},
  223. {"Hustler", VClassUnique, 545, 50000},
  224. {"Hydra", VClassPlane, 520, 50000},
  225. {"Infernus", VClassSportCar, 411, 50000},
  226. {"Intruder", VClassSaloons, 546, 50000},
  227. {"Jester", VClassSportCar, 559, 50000},
  228. {"Jetmax", VClassBoat, 493, 50000},
  229. {"Journey", VClassUnique, 508, 50000},
  230. {"Kart", VClassUnique, 571, 50000},
  231. {"Landstalker", VClassOffRoad, 400, 50000},
  232. {"Launch", VClassBoat, 595, 50000},
  233. {"Leviathan", VClassHelicopter, 417, 50000},
  234. {"Linerunner", VClassIndustrial, 403, 50000},
  235. {"Majestic", VClassSaloons, 517, 50000},
  236. {"Manana", VClassSaloons, 410, 50000},
  237. {"Marquis", VClassBoat, 484, 50000},
  238. {"Maverick", VClassHelicopter, 487, 50000},
  239. {"Merit", VClassSaloons, 551, 50000},
  240. {"Mesa", VClassOffRoad, 500, 50000},
  241. {"Monster", VClassOffRoad, 444, 50000},
  242. {"Monster A", VClassOffRoad, 556, 50000},
  243. {"Monster B", VClassOffRoad, 557, 50000},
  244. {"Moonbeam", VClassStationCar, 418, 50000},
  245. {"Mountain Bike", VClassBike, 510, 50000},
  246. {"Mower", VClassUnique, 572, 50000},
  247. {"Mr Whoopee", VClassUnique, 423, 50000},
  248. {"Mule", VClassIndustrial, 414, 50000},
  249. {"Nebula", VClassSaloons, 516, 50000},
  250. {"Nevada", VClassPlane, 553, 50000},
  251. {"Newsvan", VClassIndustrial, 582, 50000},
  252. {"NRG-500", VClassBike, 522, 50000},
  253. {"Oceanic", VClassSaloons, 467, 50000},
  254. {"Ore Trailer", VClassTrailer, 450, 50000},
  255. {"Packer", VClassIndustrial, 443, 50000},
  256. {"Patriot", VClassOffRoad, 470, 50000},
  257. {"PCJ-600", VClassBike, 461, 50000},
  258. {"Perenniel", VClassStationCar, 404, 50000},
  259. {"Phoenix", VClassSportCar, 603, 50000},
  260. {"Picador", VClassIndustrial, 600, 50000},
  261. {"Pizzaboy", VClassBike, 448, 50000},
  262. {"Police Car (LSPD)", VClassPublic, 596, 50000},
  263. {"Police Car (LVPD)", VClassPublic, 598, 50000},
  264. {"Police Car (SFPD)", VClassPublic, 597, 50000},
  265. {"Police Maverick", VClassHelicopter, 497, 50000},
  266. {"Police Ranger", VClassPublic, 599, 50000},
  267. {"Pony", VClassIndustrial, 413, 50000},
  268. {"Predator", VClassBoat, 430, 50000},
  269. {"Premier", VClassSaloons, 426, 50000},
  270. {"Previon", VClassSaloons, 436, 50000},
  271. {"Primo", VClassSaloons, 547, 50000},
  272. {"Quad", VClassBike, 471, 50000},
  273. {"Raindance", VClassHelicopter, 563, 50000},
  274. {"Rancher 1", VClassOffRoad, 489, 50000},
  275. {"Rancher 2", VClassOffRoad, 505, 50000},
  276. // {"RC Bandit", VClassRCVehicle, 441, 50000},
  277. // {"RC Baron", VClassRCVehicle, 464, 50000},
  278. // {"RC Cam", VClassRCVehicle, 594, 50000},
  279. // {"RC Goblin", VClassRCVehicle, 501, 50000},
  280. // {"RC Raider", VClassRCVehicle, 465, 50000},
  281. // {"RC Tiger", VClassRCVehicle, 564, 50000},
  282. {"Reefer", VClassBoat, 453, 50000},
  283. {"Regina", VClassStationCar, 479, 50000},
  284. {"Remington", VClassLowRider, 534, 50000},
  285. {"Rhino", VClassPublic, 432, 50000},
  286. {"Roadtrain", VClassIndustrial, 515, 50000},
  287. {"Romero", VClassUnique, 442, 50000},
  288. {"Rumpo", VClassIndustrial, 440, 50000},
  289. {"Rustler", VClassPlane, 476, 50000},
  290. {"Sabre", VClassSportCar, 475, 50000},
  291. {"Sadler", VClassIndustrial, 543, 50000},
  292. {"Sadler Shit", VClassIndustrial, 605, 50000},
  293. {"SAN News Maverick", VClassHelicopter, 488, 50000},
  294. {"Sanchez", VClassBike, 468, 50000},
  295. {"Sandking", VClassOffRoad, 495, 50000},
  296. {"Savanna", VClassLowRider, 567, 50000},
  297. {"Seasparrow", VClassHelicopter, 447, 50000},
  298. {"Securicar", VClassUnique, 428, 50000},
  299. {"Sentinel", VClassSaloons, 405, 50000},
  300. {"Shamal", VClassPlane, 519, 50000},
  301. {"Skimmer", VClassPlane, 460, 50000},
  302. {"Slamvan", VClassLowRider, 535, 50000},
  303. {"Solair", VClassStationCar, 458, 50000},
  304. {"Sparrow", VClassHelicopter, 469, 50000},
  305. {"Speeder", VClassBoat, 452, 50000},
  306. {"Squallo", VClassBoat, 446, 50000},
  307. {"Stafford", VClassSaloons, 580, 50000},
  308. {"Stallion", VClassConvertible, 439, 50000},
  309. {"Stratum", VClassStationCar, 561, 50000},
  310. // {"Streak Trailer (train)", VClassTrailer, 570, 50000},
  311. {"Stretch", VClassUnique, 409, 50000},
  312. {"Stuntplane", VClassPlane, 513, 50000},
  313. {"Sultan", VClassSaloons, 560, 50000},
  314. {"Sunrise", VClassSaloons, 550, 50000},
  315. {"Super GT", VClassSportCar, 506, 50000},
  316. {"S.W.A.T.", VClassPublic, 601, 50000},
  317. {"Sweeper", VClassUnique, 574, 50000},
  318. {"Tahoma", VClassLowRider, 566, 50000},
  319. {"Tampa", VClassSaloons, 549, 50000},
  320. {"Tanker", VClassIndustrial, 514, 50000},
  321. {"Taxi", VClassPublic, 420, 50000},
  322. {"Tornado", VClassLowRider, 576, 50000},
  323. {"Towtruck", VClassUnique, 525, 50000},
  324. {"Tractor", VClassIndustrial, 531, 50000},
  325. // {"Tram", VClassUnique, 449, 50000},
  326. {"Trashmaster", VClassIndustrial, 408, 50000},
  327. {"Tropic", VClassBoat, 454, 50000},
  328. {"Tug", VClassUnique, 583, 50000},
  329. {"Tug Stairs Trailer", VClassTrailer, 608, 50000},
  330. {"Turismo", VClassSportCar, 451, 50000},
  331. {"Uranus", VClassSportCar, 558, 50000},
  332. {"Utility Trailer", VClassTrailer, 611, 50000},
  333. {"Utility Van", VClassIndustrial, 552, 50000},
  334. {"Vincent", VClassSaloons, 540, 50000},
  335. {"Virgo", VClassSaloons, 491, 50000},
  336. {"Voodoo", VClassLowRider, 412, 50000},
  337. {"Vortex", VClassUnique, 539, 50000},
  338. {"Walton", VClassIndustrial, 478, 50000},
  339. {"Washington", VClassSaloons, 421, 50000},
  340. {"Wayfarer", VClassBike, 586, 50000},
  341. {"Willard", VClassSaloons, 529, 50000},
  342. {"Windsor", VClassConvertible, 555, 50000},
  343. {"Yankee", VClassIndustrial, 456, 50000},
  344. {"Yosemite", VClassIndustrial, 554, 50000},
  345. {"ZR-350", VClassSportCar, 477, 50000}
  346. };
  347.  
  348. new AVehicleModPrices[] =
  349. {
  350. 400, // ID 1000, Spoiler Pro Certain Transfender cars
  351. 550, // ID 1001, Spoiler Win Certain Transfender cars
  352. 200, // ID 1002, Spoiler Drag Certain Transfender cars
  353. 250, // ID 1003, Spoiler Alpha Certain Transfender cars
  354. 100, // ID 1004, Hood Champ Scoop Certain Transfender cars
  355. 150, // ID 1005, Hood Fury Scoop Certain Transfender cars
  356. 80, // ID 1006, Roof Roof Scoop Certain Transfender cars
  357. 500, // ID 1007, Sideskirt Right Sideskirt Certain Transfender cars
  358. 500, // ID 1008, Nitro 5 times Most cars, Most planes and Most Helicopters
  359. 200, // ID 1009, Nitro 2 times Most cars, Most planes and Most Helicopters
  360. 1000, // ID 1010, Nitro 10 times Most cars, Most planes and Most Helicopters
  361. 220, // ID 1011, Hood Race Scoop Certain Transfender cars
  362. 250, // ID 1012, Hood Worx Scoop Certain Transfender cars
  363. 100, // ID 1013, Lamps Round Fog Certain Transfender cars
  364. 400, // ID 1014, Spoiler Champ Certain Transfender cars
  365. 500, // ID 1015, Spoiler Race Certain Transfender cars
  366. 200, // ID 1016, Spoiler Worx Certain Transfender cars
  367. 500, // ID 1017, Sideskirt Left Sideskirt Certain Transfender cars
  368. 350, // ID 1018, Exhaust Upswept Most cars
  369. 300, // ID 1019, Exhaust Twin Most cars
  370. 250, // ID 1020, Exhaust Large Most cars
  371. 200, // ID 1021, Exhaust Medium Most cars
  372. 150, // ID 1022, Exhaust Small Most cars
  373. 350, // ID 1023, Spoiler Fury Certain Transfender cars
  374. 50, // ID 1024, Lamps Square Fog Certain Transfender cars
  375. 1000, // ID 1025, Wheels Offroad Certain Transfender cars
  376. 480, // ID 1026, Sideskirt Right Alien Sideskirt Sultan
  377. 480, // ID 1027, Sideskirt Left Alien Sideskirt Sultan
  378. 770, // ID 1028, Exhaust Alien Sultan
  379. 680, // ID 1029, Exhaust X-Flow Sultan
  380. 370, // ID 1030, Sideskirt Left X-Flow Sideskirt Sultan
  381. 370, // ID 1031, Sideskirt Right X-Flow Sideskirt Sultan
  382. 170, // ID 1032, Roof Alien Roof Vent Sultan
  383. 120, // ID 1033, Roof X-Flow Roof Vent Sultan
  384. 790, // ID 1034, Exhaust Alien Elegy
  385. 150, // ID 1035, Roof X-Flow Roof Vent Elegy
  386. 500, // ID 1036, SideSkirt Right Alien Sideskirt Elegy
  387. 690, // ID 1037, Exhaust X-Flow Elegy
  388. 190, // ID 1038, Roof Alien Roof Vent Elegy
  389. 390, // ID 1039, SideSkirt Right X-Flow Sideskirt Elegy
  390. 500, // ID 1040, SideSkirt Left Alien Sideskirt Elegy
  391. 390, // ID 1041, SideSkirt Right X-Flow Sideskirt Elegy
  392. 1000, // ID 1042, SideSkirt Right Chrome Sideskirt Broadway
  393. 500, // ID 1043, Exhaust Slamin Broadway
  394. 500, // ID 1044, Exhaust Chrome Broadway
  395. 510, // ID 1045, Exhaust X-Flow Flash
  396. 710, // ID 1046, Exhaust Alien Flash
  397. 670, // ID 1047, SideSkirt Right Alien Sideskirt Flash
  398. 530, // ID 1048, SideSkirt Right X-Flow Sideskirt Flash
  399. 810, // ID 1049, Spoiler Alien Flash
  400. 620, // ID 1050, Spoiler X-Flow Flash
  401. 670, // ID 1051, SideSkirt Left Alien Sideskirt Flash
  402. 530, // ID 1052, SideSkirt Left X-Flow Sideskirt Flash
  403. 130, // ID 1053, Roof X-Flow Flash
  404. 210, // ID 1054, Roof Alien Flash
  405. 230, // ID 1055, Roof Alien Stratum
  406. 520, // ID 1056, Sideskirt Right Alien Sideskirt Stratum
  407. 430, // ID 1057, Sideskirt Right X-Flow Sideskirt Stratum
  408. 620, // ID 1058, Spoiler Alien Stratum
  409. 720, // ID 1059, Exhaust X-Flow Stratum
  410. 530, // ID 1060, Spoiler X-Flow Stratum
  411. 180, // ID 1061, Roof X-Flow Stratum
  412. 520, // ID 1062, Sideskirt Left Alien Sideskirt Stratum
  413. 430, // ID 1063, Sideskirt Left X-Flow Sideskirt Stratum
  414. 830, // ID 1064, Exhaust Alien Stratum
  415. 850, // ID 1065, Exhaust Alien Jester
  416. 750, // ID 1066, Exhaust X-Flow Jester
  417. 250, // ID 1067, Roof Alien Jester
  418. 200, // ID 1068, Roof X-Flow Jester
  419. 550, // ID 1069, Sideskirt Right Alien Sideskirt Jester
  420. 450, // ID 1070, Sideskirt Right X-Flow Sideskirt Jester
  421. 550, // ID 1071, Sideskirt Left Alien Sideskirt Jester
  422. 450, // ID 1072, Sideskirt Left X-Flow Sideskirt Jester
  423. 1100, // ID 1073, Wheels Shadow Most cars
  424. 1030, // ID 1074, Wheels Mega Most cars
  425. 980, // ID 1075, Wheels Rimshine Most cars
  426. 1560, // ID 1076, Wheels Wires Most cars
  427. 1620, // ID 1077, Wheels Classic Most cars
  428. 1200, // ID 1078, Wheels Twist Most cars
  429. 1030, // ID 1079, Wheels Cutter Most cars
  430. 900, // ID 1080, Wheels Switch Most cars
  431. 1230, // ID 1081, Wheels Grove Most cars
  432. 820, // ID 1082, Wheels Import Most cars
  433. 1560, // ID 1083, Wheels Dollar Most cars
  434. 1350, // ID 1084, Wheels Trance Most cars
  435. 770, // ID 1085, Wheels Atomic Most cars
  436. 100, // ID 1086, Stereo Stereo Most cars
  437. 1500, // ID 1087, Hydraulics Hydraulics Most cars
  438. 150, // ID 1088, Roof Alien Uranus
  439. 650, // ID 1089, Exhaust X-Flow Uranus
  440. 450, // ID 1090, Sideskirt Right Alien Sideskirt Uranus
  441. 100, // ID 1091, Roof X-Flow Uranus
  442. 750, // ID 1092, Exhaust Alien Uranus
  443. 350, // ID 1093, Sideskirt Right X-Flow Sideskirt Uranus
  444. 450, // ID 1094, Sideskirt Left Alien Sideskirt Uranus
  445. 350, // ID 1095, Sideskirt Right X-Flow Sideskirt Uranus
  446. 1000, // ID 1096, Wheels Ahab Most cars
  447. 620, // ID 1097, Wheels Virtual Most cars
  448. 1140, // ID 1098, Wheels Access Most cars
  449. 1000, // ID 1099, Sideskirt Left Chrome Sideskirt Broadway
  450. 940, // ID 1100, Bullbar Chrome Grill Remington
  451. 780, // ID 1101, Sideskirt Left `Chrome Flames` Sideskirt Remington
  452. 830, // ID 1102, Sideskirt Left `Chrome Strip` Sideskirt Savanna
  453. 3250, // ID 1103, Roof Convertible Blade
  454. 1610, // ID 1104, Exhaust Chrome Blade
  455. 1540, // ID 1105, Exhaust Slamin Blade
  456. 780, // ID 1106, Sideskirt Right `Chrome Arches` Remington
  457. 780, // ID 1107, Sideskirt Left `Chrome Strip` Sideskirt Blade
  458. 780, // ID 1108, Sideskirt Right `Chrome Strip` Sideskirt Blade
  459. 1610, // ID 1109, Rear Bullbars Chrome Slamvan
  460. 1540, // ID 1110, Rear Bullbars Slamin Slamvan
  461. 55, // ID 1111, Front Sign? Little Sign? Slamvan ???
  462. 55, // ID 1112, Front Sign? Little Sign? Slamvan ???
  463. 3340, // ID 1113, Exhaust Chrome Slamvan
  464. 3250, // ID 1114, Exhaust Slamin Slamvan
  465. 2130, // ID 1115, Front Bullbars Chrome Slamvan
  466. 2050, // ID 1116, Front Bullbars Slamin Slamvan
  467. 2040, // ID 1117, Front Bumper Chrome Slamvan
  468. 780, // ID 1118, Sideskirt Right `Chrome Trim` Sideskirt Slamvan
  469. 940, // ID 1119, Sideskirt Right `Wheelcovers` Sideskirt Slamvan
  470. 780, // ID 1120, Sideskirt Left `Chrome Trim` Sideskirt Slamvan
  471. 940, // ID 1121, Sideskirt Left `Wheelcovers` Sideskirt Slamvan
  472. 780, // ID 1122, Sideskirt Right `Chrome Flames` Sideskirt Remington
  473. 860, // ID 1123, Bullbars Bullbar Chrome Bars Remington
  474. 780, // ID 1124, Sideskirt Left `Chrome Arches` Sideskirt Remington
  475. 1120, // ID 1125, Bullbars Bullbar Chrome Lights Remington
  476. 3340, // ID 1126, Exhaust Chrome Exhaust Remington
  477. 3250, // ID 1127, Exhaust Slamin Exhaust Remington
  478. 3340, // ID 1128, Roof Vinyl Hardtop Blade
  479. 1650, // ID 1129, Exhaust Chrome Savanna
  480. 3380, // ID 1130, Roof Hardtop Savanna
  481. 3290, // ID 1131, Roof Softtop Savanna
  482. 1590, // ID 1132, Exhaust Slamin Savanna
  483. 830, // ID 1133, Sideskirt Right `Chrome Strip` Sideskirt Savanna
  484. 800, // ID 1134, SideSkirt Right `Chrome Strip` Sideskirt Tornado
  485. 1500, // ID 1135, Exhaust Slamin Tornado
  486. 1000, // ID 1136, Exhaust Chrome Tornado
  487. 800, // ID 1137, Sideskirt Left `Chrome Strip` Sideskirt Tornado
  488. 580, // ID 1138, Spoiler Alien Sultan
  489. 470, // ID 1139, Spoiler X-Flow Sultan
  490. 870, // ID 1140, Rear Bumper X-Flow Sultan
  491. 980, // ID 1141, Rear Bumper Alien Sultan
  492. 150, // ID 1142, Vents Left Oval Vents Certain Transfender Cars
  493. 150, // ID 1143, Vents Right Oval Vents Certain Transfender Cars
  494. 100, // ID 1144, Vents Left Square Vents Certain Transfender Cars
  495. 100, // ID 1145, Vents Right Square Vents Certain Transfender Cars
  496. 490, // ID 1146, Spoiler X-Flow Elegy
  497. 600, // ID 1147, Spoiler Alien Elegy
  498. 890, // ID 1148, Rear Bumper X-Flow Elegy
  499. 1000, // ID 1149, Rear Bumper Alien Elegy
  500. 1090, // ID 1150, Rear Bumper Alien Flash
  501. 840, // ID 1151, Rear Bumper X-Flow Flash
  502. 910, // ID 1152, Front Bumper X-Flow Flash
  503. 1200, // ID 1153, Front Bumper Alien Flash
  504. 1030, // ID 1154, Rear Bumper Alien Stratum
  505. 1030, // ID 1155, Front Bumper Alien Stratum
  506. 920, // ID 1156, Rear Bumper X-Flow Stratum
  507. 930, // ID 1157, Front Bumper X-Flow Stratum
  508. 550, // ID 1158, Spoiler X-Flow Jester
  509. 1050, // ID 1159, Rear Bumper Alien Jester
  510. 1050, // ID 1160, Front Bumper Alien Jester
  511. 950, // ID 1161, Rear Bumper X-Flow Jester
  512. 650, // ID 1162, Spoiler Alien Jester
  513. 450, // ID 1163, Spoiler X-Flow Uranus
  514. 550, // ID 1164, Spoiler Alien Uranus
  515. 850, // ID 1165, Front Bumper X-Flow Uranus
  516. 950, // ID 1166, Front Bumper Alien Uranus
  517. 850, // ID 1167, Rear Bumper X-Flow Uranus
  518. 950, // ID 1168, Rear Bumper Alien Uranus
  519. 970, // ID 1169, Front Bumper Alien Sultan
  520. 880, // ID 1170, Front Bumper X-Flow Sultan
  521. 990, // ID 1171, Front Bumper Alien Elegy
  522. 900, // ID 1172, Front Bumper X-Flow Elegy
  523. 950, // ID 1173, Front Bumper X-Flow Jester
  524. 1000, // ID 1174, Front Bumper Chrome Broadway
  525. 900, // ID 1175, Front Bumper Slamin Broadway
  526. 1000, // ID 1176, Rear Bumper Chrome Broadway
  527. 900, // ID 1177, Rear Bumper Slamin Broadway
  528. 2050, // ID 1178, Rear Bumper Slamin Remington
  529. 2150, // ID 1179, Front Bumper Chrome Remington
  530. 2130, // ID 1180, Rear Bumper Chrome Remington
  531. 2050, // ID 1181, Front Bumper Slamin Blade
  532. 2130, // ID 1182, Front Bumper Chrome Blade
  533. 2040, // ID 1183, Rear Bumper Slamin Blade
  534. 2150, // ID 1184, Rear Bumper Chrome Blade
  535. 2040, // ID 1185, Front Bumper Slamin Remington
  536. 2095, // ID 1186, Rear Bumper Slamin Savanna
  537. 2175, // ID 1187, Rear Bumper Chrome Savanna
  538. 2080, // ID 1188, Front Bumper Slamin Savanna
  539. 2200, // ID 1189, Front Bumper Chrome Savanna
  540. 1200, // ID 1190, Front Bumper Slamin Tornado
  541. 1040, // ID 1191, Front Bumper Chrome Tornado
  542. 940, // ID 1192, Rear Bumper Chrome Tornado
  543. 1100, // ID 1193 Rear Bumper Slamin Tornado
  544. };
  545.  
  546. new TotalHouses;
  547.  
  548. main()
  549. {
  550. }
  551.  
  552. public OnFilterScriptInit()
  553. {
  554. for (new HouseID = 1; HouseID < MAX_HOUSES; HouseID++)
  555. {
  556. HouseFile_Load(HouseID);
  557. if (LoadCarsDuringFSInit == true)
  558. HouseFile_LoadCars(HouseID);
  559. }
  560.  
  561. CreateDynamicMapIcon(1039, -1032, 32, 27, 0, 0, 0, -1, 150.0); // Transfender, Los Santos
  562. CreateDynamicMapIcon(-1936, 235, 34, 27, 0, 0, 0, -1, 150.0); // Transfender, San Fierro
  563. CreateDynamicMapIcon(2385, 1034, 11, 27, 0, 0, 0, -1, 150.0); // Transfender, Las Venturas
  564. CreateDynamicMapIcon(2646, -2025, 14, 27, 0, 0, 0, -1, 150.0); // Loco Low Co, Los Santos
  565. CreateDynamicMapIcon(-2712, 218, 4, 27, 0, 0, 0, -1, 150.0); // Wheel Arch Angels, San Fierro
  566.  
  567. printf("----------------------------------------");
  568. printf("PPC Housing filterscript betoltve");
  569. printf("Houses loaded: %i", TotalHouses);
  570. printf("----------------------------------------");
  571.  
  572. return 1;
  573. }
  574.  
  575. public OnPlayerConnect(playerid)
  576. {
  577. new HouseID, HouseSlot, Name[24];
  578. GetPlayerName(playerid, Name, sizeof(Name));
  579. for (HouseID = 1; HouseID < MAX_HOUSES; HouseID++)
  580. {
  581. if (IsValidDynamicPickup(AHouseData[HouseID][PickupID]))
  582. {
  583. if (AHouseData[HouseID][Owned] == true)
  584. {
  585. if (strcmp(AHouseData[HouseID][Owner], Name, false) == 0)
  586. {
  587. APlayerData[playerid][Houses][HouseSlot] = HouseID;
  588.  
  589. if (LoadCarsDuringFSInit == false)
  590. HouseFile_LoadCars(HouseID);
  591. HouseSlot++;
  592. }
  593. }
  594. }
  595. }
  596.  
  597. return 1;
  598. }
  599.  
  600. public OnPlayerDisconnect(playerid, reason)
  601. {
  602. new HouseSlot;
  603. for (HouseSlot = 0; HouseSlot < MAX_HOUSESPERPLAYER; HouseSlot++)
  604. {
  605. if (APlayerData[playerid][Houses][HouseSlot] != 0)
  606. {
  607. HouseFile_Save(APlayerData[playerid][Houses][HouseSlot]);
  608. if (LoadCarsDuringFSInit == false)
  609. {
  610. House_RemoveVehicles(APlayerData[playerid][Houses][HouseSlot]);
  611. }
  612. APlayerData[playerid][Houses][HouseSlot] = 0;
  613. }
  614. }
  615. APlayerData[playerid][CurrentHouse] = 0;
  616. APlayerData[playerid][DialogBuyVClass] = 0;
  617. APlayerData[playerid][DialogGetCarHouseID] = 0;
  618. return 1;
  619. }
  620.  
  621. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  622. {
  623. switch (dialogid)
  624. {
  625. case DialogHouseMenu: Dialog_HouseMenu(playerid, response, listitem);
  626. case DialogUpgradeHouse: Dialog_UpgradeHouse(playerid, response, listitem);
  627. case DialogGoHome: Dialog_GoHome(playerid, response, listitem);
  628. case DialogHouseNameChange: Dialog_ChangeHouseName(playerid, response, inputtext);
  629. case DialogSellHouse: Dialog_SellHouse(playerid, response);
  630. //case DialogBuyCarClass: Dialog_BuyCarClass(playerid, response, listitem);
  631. //case DialogBuyCar: Dialog_BuyCar(playerid, response, listitem);
  632. //case DialogSellCar: Dialog_SellCar(playerid, response, listitem);
  633. //case DialogBuyInsurance: Dialog_BuyInsurance(playerid, response);
  634. //case DialogGetCarSelectHouse: Dialog_GetCarSelectHouse(playerid, response, listitem);
  635. //case DialogGetCarSelectCar: Dialog_GetCarSelectCar(playerid, response, listitem);
  636. }
  637. return 0;
  638. }
  639. public OnPlayerSpawn(playerid)
  640. {
  641. new HouseID;
  642. APlayerData[playerid][CurrentHouse] = 0;
  643. if (SpawnAtHouse == true)
  644. {
  645. HouseID = APlayerData[playerid][Houses][0];
  646. if (HouseID != 0)
  647. {
  648. SetPlayerPos(playerid, AHouseData[HouseID][HouseX], AHouseData[HouseID][HouseY], AHouseData[HouseID][HouseZ]);
  649. }
  650. }
  651. return 1;
  652. }
  653.  
  654. public OnPlayerDeath(playerid, killerid, reason)
  655. {
  656. APlayerData[playerid][CurrentHouse] = 0;
  657. return 1;
  658. }
  659.  
  660. public OnPlayerRequestClass(playerid, classid)
  661. {
  662. APlayerData[playerid][CurrentHouse] = 0;
  663. return 1;
  664. }
  665.  
  666. public OnPlayerRequestSpawn(playerid)
  667. {
  668. APlayerData[playerid][CurrentHouse] = 0;
  669. return 1;
  670. }
  671.  
  672. public OnVehicleSpawn(vehicleid)
  673. {
  674. if (AVehicleData[vehicleid][Owned] == true)
  675. {
  676. if (AVehicleData[vehicleid][PaintJob] != 0)
  677. {
  678. ChangeVehiclePaintjob(vehicleid, AVehicleData[vehicleid][PaintJob] - 1);
  679. }
  680. ChangeVehicleColor(vehicleid, AVehicleData[vehicleid][Color1], AVehicleData[vehicleid][Color2]);
  681. for (new i; i < 14; i++)
  682. {
  683. RemoveVehicleComponent(vehicleid, GetVehicleComponentInSlot(vehicleid, i));
  684. if (AVehicleData[vehicleid][Components][i] != 0)
  685. AddVehicleComponent(vehicleid, AVehicleData[vehicleid][Components][i]);
  686. }
  687. }
  688. return 1;
  689. }
  690.  
  691. public OnVehicleRespray(playerid, vehicleid, color1, color2)
  692. {
  693. if (AVehicleData[vehicleid][Owned] == true)
  694. {
  695. if ((AVehicleData[vehicleid][Color1] != color1) || (AVehicleData[vehicleid][Color2] != color2))
  696. INT_GivePlayerMoney(playerid, -150);
  697. AVehicleData[vehicleid][Color1] = color1;
  698. AVehicleData[vehicleid][Color2] = color2;
  699. if (color1 == 0)
  700. AVehicleData[vehicleid][PaintJob] = 0;
  701. }
  702.  
  703. return 1;
  704. }
  705.  
  706. public OnVehicleMod(playerid, vehicleid, componentid)
  707. {
  708. if (AVehicleData[vehicleid][Owned] == true)
  709. {
  710. INT_GivePlayerMoney(playerid, -AVehicleModPrices[componentid - 1000]);
  711. AVehicleData[vehicleid][Components][GetVehicleComponentType(componentid)] = componentid;
  712. }
  713.  
  714. return 1;
  715. }
  716.  
  717. public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  718. {
  719. if (AVehicleData[vehicleid][Owned] == true)
  720. {
  721. AVehicleData[vehicleid][PaintJob] = paintjobid + 1;
  722. }
  723.  
  724. return 1;
  725. }
  726.  
  727. public OnVehicleDeath(vehicleid)
  728. {
  729. new HouseID, CarSlot;
  730. if (AVehicleData[vehicleid][Owned] == true)
  731. {
  732. HouseID = AVehicleData[vehicleid][BelongsToHouse];
  733. if (AutomaticInsurance == false)
  734. {
  735. if (HouseID != 0)
  736. {
  737. if (AHouseData[HouseID][Insurance] == false)
  738. {
  739. for (CarSlot = 0; CarSlot < 10; CarSlot++)
  740. {
  741. if (AHouseData[HouseID][VehicleIDs][CarSlot] == vehicleid)
  742. break;
  743. }
  744. Vehicle_Delete(vehicleid, HouseID, CarSlot);
  745. HouseFile_Save(HouseID);
  746. }
  747. }
  748. }
  749. }
  750.  
  751. return 1;
  752. }
  753. /*
  754. public OnPlayerStateChange(playerid,newstate,oldstate)
  755. {
  756. new vid, Name[24], Msg[128], engine, lights, alarm, doors, bonnet, boot, objective;
  757. if (newstate == PLAYER_STATE_DRIVER)
  758. {
  759. vid = GetPlayerVehicleID(playerid);
  760. GetPlayerName(playerid, Name, sizeof(Name));
  761. if (AVehicleData[vid][Owned] == true)
  762. {
  763. if (strcmp(AVehicleData[vid][Owner], Name, false) != 0)
  764. {
  765. RemovePlayerFromVehicle(playerid);
  766. GetVehicleParamsEx(vid, engine, lights, alarm, doors, bonnet, boot, objective);
  767. SetVehicleParamsEx(vid, 0, 0, alarm, doors, bonnet, boot, objective);
  768. format(Msg, 128, "{FF0000}You cannot use this vehicle, it's owned by \"{FFFF00}%s{FF0000}\"", AVehicleData[vid][Owner]);
  769. SendClientMessage(playerid, 0xFFFFFFFF, Msg);
  770. }
  771. }
  772. }
  773.  
  774. return 1;
  775. }
  776. */
  777.  
  778.  
  779. // ******************************************************************************************************************************
  780. // Commands
  781. // ******************************************************************************************************************************
  782.  
  783. COMMAND:createhouse(playerid, params[])
  784. {
  785. if(!IsPlayerAdmin(playerid)) return 0;
  786. new HPrice, MaxLevel, HouseID;
  787. if (GetPlayerVehicleSeat(playerid) == -1)
  788. {
  789. if (sscanf(params, "ii", HPrice, MaxLevel)) SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}Használat: \"/createhouse <ár> <maxlevel (1-10)>\"");
  790. else
  791. {
  792. if ((MaxLevel >= 1) && (MaxLevel <= 10))
  793. {
  794. for (HouseID = 1; HouseID < MAX_HOUSES; HouseID++)
  795. if (!IsValidDynamicPickup(AHouseData[HouseID][PickupID]))
  796. break;
  797. if (!IsValidDynamicPickup(AHouseData[HouseID][PickupID]))
  798. {
  799. new Float:x, Float:y, Float:z, Msg[128];
  800. GetPlayerPos(playerid, x, y, z);
  801. AHouseData[HouseID][Owned] = false;
  802. AHouseData[HouseID][Owner] = 0;
  803. AHouseData[HouseID][HouseX] = x;
  804. AHouseData[HouseID][HouseY] = y;
  805. AHouseData[HouseID][HouseZ] = z;
  806. AHouseData[HouseID][HouseLevel] = 1;
  807. AHouseData[HouseID][HouseMaxLevel] = MaxLevel;
  808. AHouseData[HouseID][HousePrice] = HPrice;
  809. AHouseData[HouseID][HouseOpened] = false;
  810. AHouseData[HouseID][Insurance] = false;
  811. AHouseData[HouseID][StaticHouse] = false;
  812. AHouseData[HouseID][CarSlots] = 1;
  813. House_UpdateEntrance(HouseID);
  814. HouseFile_Save(HouseID);
  815. format(Msg, 128, "{00FF00}Sikeresen létrehoztál egy házat IDje: {FFFF00}%i", HouseID);
  816. SendClientMessage(playerid, 0xFFFFFFFF, Msg);
  817. }
  818. else
  819. SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}Maximum ház-limit elérve");
  820. }
  821. else
  822. SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}Min 1 Max 10-es szintű házat hozhatsz létre!");
  823. }
  824. }
  825. else
  826. SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}Csak gyalogosan rakhatsz le házat!");
  827. return 1;
  828. }
  829.  
  830. COMMAND:createstatichouse(playerid, params[])
  831. {
  832. new HPrice, Carslots, HouseID, Interior;
  833. if(!IsPlayerAdmin(playerid)) return 0;
  834. if (GetPlayerVehicleSeat(playerid) == -1)
  835. {
  836. if (sscanf(params, "iii", HPrice, Carslots, Interior)) SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}Használat: \"/createstatichouse <ár> <Carslots (1-10)> <Interior (1-10)>\"");
  837. else
  838. {
  839. if ((Carslots >= 1) && (Carslots <= 10))
  840. {
  841. if ((Interior >= 1) && (Interior <= 10))
  842. {
  843. for (HouseID = 1; HouseID < MAX_HOUSES; HouseID++)
  844. if (!IsValidDynamicPickup(AHouseData[HouseID][PickupID]))
  845. break;
  846. if (!IsValidDynamicPickup(AHouseData[HouseID][PickupID]))
  847. {
  848. new Float:x, Float:y, Float:z, Msg[128];
  849. GetPlayerPos(playerid, x, y, z);
  850. AHouseData[HouseID][Owned] = false;
  851. AHouseData[HouseID][HouseX] = x;
  852. AHouseData[HouseID][HouseY] = y;
  853. AHouseData[HouseID][HouseZ] = z;
  854. AHouseData[HouseID][HouseLevel] = Interior;
  855. AHouseData[HouseID][HouseMaxLevel] = Interior;
  856. AHouseData[HouseID][HousePrice] = HPrice;
  857. AHouseData[HouseID][HouseOpened] = false;
  858. AHouseData[HouseID][Insurance] = false;
  859. AHouseData[HouseID][StaticHouse] = true;
  860. AHouseData[HouseID][CarSlots] = Carslots;
  861. House_UpdateEntrance(HouseID);
  862. HouseFile_Save(HouseID);
  863. format(Msg, 128, "{00FF00}Sikeresen létrehoztál egy egyedi házat IDje: {FFFF00}%i", HouseID);
  864. SendClientMessage(playerid, 0xFFFFFFFF, Msg);
  865. }
  866. else
  867. SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}Maximum ház-limit elérve");
  868. }
  869. else
  870. SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}Interror id-t kérlek 1-10-ig add meg!");
  871. }
  872. else
  873. SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}Jármű soltot kérlek 1-10-ig add meg!");
  874. }
  875. }
  876. else
  877. SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}Csak gyalog tudsz létrehozni házat!");
  878. return 1;
  879. }
  880. COMMAND:delhouse(playerid, params[])
  881. {
  882. if(!IsPlayerAdmin(playerid)) return 0;
  883. new file[100], Msg[128], Name[24];
  884. if (GetPlayerVehicleSeat(playerid) == -1)
  885. {
  886. for (new HouseID = 1; HouseID < MAX_HOUSES; HouseID++)
  887. {
  888. if (IsValidDynamicPickup(AHouseData[HouseID][PickupID]))
  889. {
  890. if (IsPlayerInRangeOfPoint(playerid, 2.5, AHouseData[HouseID][HouseX], AHouseData[HouseID][HouseY], AHouseData[HouseID][HouseZ]))
  891. {
  892. if (AHouseData[HouseID][Owned] == true)
  893. {
  894. for (new pid; pid < MAX_PLAYERS; pid++)
  895. {
  896. GetPlayerName(pid, Name, sizeof(Name));
  897. if (strcmp(AHouseData[HouseID][Owner], Name, false) == 0)
  898. {
  899. format(Msg, 128, "{FF0000}A házadat {FFFF00}\"%s\"{FF0000} törölte!", AHouseData[HouseID][HouseName]);
  900. SendClientMessage(pid, 0xFFFFFFFF, Msg);
  901. for (new HouseSlot; HouseSlot < MAX_HOUSESPERPLAYER; HouseSlot++)
  902. if (APlayerData[pid][Houses][HouseSlot] == HouseID)
  903. APlayerData[pid][Houses][HouseSlot] = 0;
  904. break;
  905. }
  906. }
  907. }
  908. House_RemoveVehicles(HouseID);
  909. AHouseData[HouseID][Owned] = false;
  910. AHouseData[HouseID][Owner] = 0;
  911. AHouseData[HouseID][HouseName] = 0;
  912. AHouseData[HouseID][Insurance] = false;
  913. AHouseData[HouseID][HouseX] = 0.0;
  914. AHouseData[HouseID][HouseY] = 0.0;
  915. AHouseData[HouseID][HouseZ] = 0.0;
  916. AHouseData[HouseID][HouseLevel] = 0;
  917. AHouseData[HouseID][HouseMaxLevel] = 0;
  918. AHouseData[HouseID][HousePrice] = 0;
  919. AHouseData[HouseID][HouseOpened] = false;
  920. AHouseData[HouseID][StaticHouse] = false;
  921. AHouseData[HouseID][CarSlots] = 0;
  922. DestroyDynamicPickup(AHouseData[HouseID][PickupID]);
  923. DestroyDynamicMapIcon(AHouseData[HouseID][MapIconID]);
  924. DestroyDynamic3DTextLabel(AHouseData[HouseID][DoorText]);
  925. AHouseData[HouseID][PickupID] = 0;
  926. AHouseData[HouseID][MapIconID] = 0;
  927. format(file, sizeof(file), HouseFile, HouseID);
  928. if (fexist(file))
  929. fremove(file);
  930. format(Msg, 128, "{00FF00}Sikeresen törölted ezt a házat! IDje: {FFFF00}%i", HouseID);
  931. SendClientMessage(playerid, 0xFFFFFFFF, Msg);
  932. return 1;
  933. }
  934. }
  935. }
  936. SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}Nincs a közeledbe olyan ház, amit törölni lehetne!");
  937. }
  938. else
  939. SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}Gyalogosnak kell lenned, hogy használni tudd ezt a parancsot!");
  940. return 1;
  941. }
  942. COMMAND:buyhouse(playerid, params[])
  943. {
  944. new Msg[128];
  945. if (GetPlayerVehicleSeat(playerid) == -1)
  946. {
  947. for (new HouseID = 1; HouseID < MAX_HOUSES; HouseID++)
  948. {
  949. if (IsValidDynamicPickup(AHouseData[HouseID][PickupID]))
  950. {
  951. if (IsPlayerInRangeOfPoint(playerid, 2.5, AHouseData[HouseID][HouseX], AHouseData[HouseID][HouseY], AHouseData[HouseID][HouseZ]))
  952. {
  953. if (AHouseData[HouseID][Owned] == false)
  954. {
  955. if (INT_GetPlayerMoney(playerid) >= AHouseData[HouseID][HousePrice])
  956. House_SetOwner(playerid, HouseID);
  957. else
  958. SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}Nem tudod meg venni ezt a házat. Nincs rá elég pénzed!");
  959. }
  960. else
  961. {
  962. format(Msg, 128, "{FF0000}Már van tulajdonosa ennek a háznak, mégpedig: {FFFF00}%s", AHouseData[HouseID][Owner]);
  963. SendClientMessage(playerid, 0xFFFFFFFF, Msg);
  964. }
  965. return 1;
  966. }
  967. }
  968. }
  969. SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}Nem vagy egyetlen ház közelébe sem, vagy ha igen, akkor kérlek menj közelebb!");
  970. }
  971. else
  972. SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}Nem tudsz kocsiban házat venni!");
  973. return 1;
  974. }
  975.  
  976. COMMAND:enter(playerid, params[])
  977. {
  978. new HouseID, IntID;
  979. if (GetPlayerVehicleSeat(playerid) == -1)
  980. {
  981. for (HouseID = 1; HouseID < MAX_HOUSES; HouseID++)
  982. {
  983. if (IsValidDynamicPickup(AHouseData[HouseID][PickupID]))
  984. {
  985. if (IsPlayerInRangeOfPoint(playerid, 2.5, AHouseData[HouseID][HouseX], AHouseData[HouseID][HouseY], AHouseData[HouseID][HouseZ]))
  986. {
  987. if (AHouseData[HouseID][HouseOpened] == false)
  988. {
  989. if (House_PlayerIsOwner(playerid, HouseID) == 0)
  990. {
  991. SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}Nem tudsz bemenni, mert zárva van ez a ház!");
  992. return 1;
  993. }
  994. }
  995. IntID = AHouseData[HouseID][HouseLevel];
  996. SetPlayerVirtualWorld(playerid, 5000 + HouseID);
  997. SetPlayerInterior(playerid, AHouseInteriors[IntID][InteriorID]);
  998. SetPlayerPos(playerid, AHouseInteriors[IntID][IntX], AHouseInteriors[IntID][IntY], AHouseInteriors[IntID][IntZ]);
  999. APlayerData[playerid][CurrentHouse] = HouseID;
  1000. SendClientMessage(playerid, 0xFFFFFFFF, "{00FF00}Használd {FFFF00}/housemenu{00FF00} a házad beállításaidhoz!");
  1001. return 1;
  1002. }
  1003. }
  1004. }
  1005. }
  1006. return 0;
  1007. }
  1008.  
  1009. COMMAND:housemenu(playerid, params[])
  1010. {
  1011. new OptionsList[200], DialogTitle[200], HouseID;
  1012. HouseID = APlayerData[playerid][CurrentHouse];
  1013. if (HouseID != 0)
  1014. {
  1015. format(DialogTitle, sizeof(DialogTitle), "%s", AHouseData[HouseID][HouseName]);
  1016. if (AHouseData[HouseID][StaticHouse] == true)
  1017. {
  1018. format(OptionsList, sizeof(OptionsList), "%sHáz átnevezése\n", OptionsList);
  1019. /*format(OptionsList, sizeof(OptionsList), "%sJármű vásárlása\n", OptionsList);
  1020. format(OptionsList, sizeof(OptionsList), "%sJármű biztosítás\n", OptionsList);
  1021. format(OptionsList, sizeof(OptionsList), "%sJármű eladása\n", OptionsList);*/
  1022. format(OptionsList, sizeof(OptionsList), "%sHáz eladása\n", OptionsList);
  1023. format(OptionsList, sizeof(OptionsList), "%sHáz kinyitása\n", OptionsList);
  1024. format(OptionsList, sizeof(OptionsList), "%sHáz bezárása\n", OptionsList);
  1025. format(OptionsList, sizeof(OptionsList), "%sKilépés a házból\n", OptionsList);
  1026. }
  1027. else
  1028. {
  1029. format(OptionsList, sizeof(OptionsList), "%sHáz átnevezése\n", OptionsList);
  1030. format(OptionsList, sizeof(OptionsList), "%sHáz fejlesztése\n", OptionsList);
  1031. /*format(OptionsList, sizeof(OptionsList), "%sJármű vásárlása\n", OptionsList);
  1032. format(OptionsList, sizeof(OptionsList), "%sJármű biztosítás\n", OptionsList);
  1033. format(OptionsList, sizeof(OptionsList), "%sJármű eladása\n", OptionsList);*/
  1034. format(OptionsList, sizeof(OptionsList), "%sHáz eladása\n", OptionsList);
  1035. format(OptionsList, sizeof(OptionsList), "%sHáz kinyitása\n", OptionsList);
  1036. format(OptionsList, sizeof(OptionsList), "%sHáz bezárása\n", OptionsList);
  1037. format(OptionsList, sizeof(OptionsList), "%sKilépés a házból\n", OptionsList);
  1038. }
  1039. ShowPlayerDialog(playerid, DialogHouseMenu, DIALOG_STYLE_LIST, DialogTitle, OptionsList, "Kiválaszt", "Mégse");
  1040. }
  1041. else
  1042. SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}Nem vagy házban!");
  1043. return 1;
  1044. }
  1045.  
  1046. COMMAND:gohome(playerid, params[])
  1047. {
  1048. new HouseList[1000], HouseID;
  1049. if (GetPlayerVehicleSeat(playerid) == -1)
  1050. {
  1051. for (new HouseSlot; HouseSlot < MAX_HOUSESPERPLAYER; HouseSlot++)
  1052. {
  1053. HouseID = APlayerData[playerid][Houses][HouseSlot];
  1054. if (HouseID != 0)
  1055. format(HouseList, 1000, "%s{00FF00}%s{FFFFFF}\n", HouseList, AHouseData[HouseID][HouseName]);
  1056. else
  1057. format(HouseList, 1000, "%s{FFFFFF}%s{FFFFFF}\n", HouseList, "Üres hely");
  1058. }
  1059. ShowPlayerDialog(playerid, DialogGoHome, DIALOG_STYLE_LIST, "Válaszd ki a házat:", HouseList, "Kiválaszt", "Mégse");
  1060. }
  1061. else
  1062. SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}Csak gyalog tudod használni ezt a parancsot!");
  1063. return 1;
  1064. }
  1065. /*
  1066. COMMAND:getcar(playerid, params[])
  1067. {
  1068. new HouseList[1000], HouseID;
  1069. if (GetPlayerVehicleSeat(playerid) == -1)
  1070. {
  1071. for (new HouseSlot; HouseSlot < MAX_HOUSESPERPLAYER; HouseSlot++)
  1072. {
  1073. HouseID = APlayerData[playerid][Houses][HouseSlot];
  1074. if (HouseID != 0)
  1075. format(HouseList, 1000, "%s{00FF00}%s{FFFFFF}\n", HouseList, AHouseData[HouseID][HouseName]);
  1076. else
  1077. format(HouseList, 1000, "%s{FFFFFF}%s{FFFFFF}\n", HouseList, "Üres hely");
  1078. }
  1079. ShowPlayerDialog(playerid, DialogGetCarSelectHouse, DIALOG_STYLE_LIST, "Válassz egy kocsit:", HouseList, "Kiválaszt", "Mágse");
  1080. }
  1081. else
  1082. SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}Csak gyalog tudod használni ezt a parancsot!");
  1083. return 1;
  1084. }
  1085.  
  1086. COMMAND:park(playerid, params[])
  1087. {
  1088. new Float:x, Float:y, Float:z, Float:rot, vid, HouseID, Msg[128];
  1089. new engine,lights,alarm,doors,bonnet,boot,objective;
  1090. if (GetPlayerVehicleSeat(playerid) == 0)
  1091. {
  1092. vid = GetPlayerVehicleID(playerid);
  1093. HouseID = AVehicleData[vid][BelongsToHouse];
  1094. if (HouseID != 0)
  1095. {
  1096. if (IsPlayerInRangeOfPoint(playerid, ParkRange, AHouseData[HouseID][HouseX], AHouseData[HouseID][HouseY], AHouseData[HouseID][HouseZ]))
  1097. {
  1098. GetVehiclePos(vid, x, y, z);
  1099. GetVehicleZAngle(vid, rot);
  1100. AVehicleData[vid][SpawnX] = x;
  1101. AVehicleData[vid][SpawnY] = y;
  1102. AVehicleData[vid][SpawnZ] = z;
  1103. AVehicleData[vid][SpawnRot] = rot;
  1104. for (new CarSlot; CarSlot < 10; CarSlot++)
  1105. {
  1106. if (AHouseData[HouseID][VehicleIDs][CarSlot] == vid)
  1107. {
  1108. House_ReplaceVehicle(HouseID, CarSlot);
  1109. PutPlayerInVehicle(playerid, AHouseData[HouseID][VehicleIDs][CarSlot], 0);
  1110. GetVehicleParamsEx(AHouseData[HouseID][VehicleIDs][CarSlot], engine, lights, alarm, doors, bonnet, boot, objective);
  1111. SetVehicleParamsEx(AHouseData[HouseID][VehicleIDs][CarSlot], 1, 1, alarm, doors, bonnet, boot, objective);
  1112. break;
  1113. }
  1114. }
  1115. SendClientMessage(playerid, 0xFFFFFFFF, "{00FF00}Sikeresen leparkoltad a kocsidat! :)");
  1116. HouseFile_Save(HouseID);
  1117. }
  1118. else
  1119. {
  1120. format(Msg, 128, "{FF0000}Csak {FFFF00}%im{FF0000} belül tudsz parkolni!", ParkRange);
  1121. SendClientMessage(playerid, 0xFFFFFFFF, Msg);
  1122. }
  1123. }
  1124. else
  1125. SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}A parkolás sikertelen volt mivel ez nem a te kocsid!");
  1126. }
  1127. else
  1128. SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}Ha gyalog vagy, akkor mit akarsz leparkolni?");
  1129. return 1;
  1130. }
  1131. */
  1132. COMMAND:evict(playerid, params[])
  1133. {
  1134. if(!IsPlayerAdmin(playerid)) return 0;
  1135. new Msg[128], Name[24];
  1136. if (GetPlayerVehicleSeat(playerid) == -1)
  1137. {
  1138. for (new HouseID = 1; HouseID < MAX_HOUSES; HouseID++)
  1139. {
  1140. if (IsValidDynamicPickup(AHouseData[HouseID][PickupID]))
  1141. {
  1142. if (IsPlayerInRangeOfPoint(playerid, 2.5, AHouseData[HouseID][HouseX], AHouseData[HouseID][HouseY], AHouseData[HouseID][HouseZ]))
  1143. {
  1144. if (AHouseData[HouseID][Owned] == true)
  1145. {
  1146. for (new pid; pid < MAX_PLAYERS; pid++)
  1147. {
  1148. GetPlayerName(pid, Name, sizeof(Name));
  1149. if (strcmp(AHouseData[HouseID][Owner], Name, false) == 0)
  1150. {
  1151. format(Msg, 128, "{FF0000}Elvesztetted a házadat {FFFF00}\"%s\"{FF0000}, kilakoltatott", AHouseData[HouseID][HouseName]);
  1152. SendClientMessage(pid, 0xFFFFFFFF, Msg);
  1153. for (new HouseSlot; HouseSlot < MAX_HOUSESPERPLAYER; HouseSlot++)
  1154. if (APlayerData[pid][Houses][HouseSlot] == HouseID)
  1155. APlayerData[pid][Houses][HouseSlot] = 0;
  1156. break;
  1157. }
  1158. }
  1159. }
  1160. House_RemoveVehicles(HouseID);
  1161. AHouseData[HouseID][Owned] = false;
  1162. AHouseData[HouseID][Owner] = 0;
  1163. House_UpdateEntrance(HouseID);
  1164. HouseFile_Save(HouseID);
  1165. format(Msg, 128, "{00FF00}Sikeresen kilakoltattad ebből a házból az illetőt. Volt ház IDje: {FFFF00}%i", HouseID);
  1166. SendClientMessage(playerid, 0xFFFFFFFF, Msg);
  1167. return 1;
  1168. }
  1169. }
  1170. }
  1171. SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}Nincs ház a közeledbe");
  1172. }
  1173. else
  1174. SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}Csak gyalog tudsz házat törölni!");
  1175. return 1;
  1176. }
  1177.  
  1178.  
  1179.  
  1180. // ******************************************************************************************************************************
  1181. // Dialog-responses
  1182. // ******************************************************************************************************************************
  1183.  
  1184. Dialog_HouseMenu(playerid, response, listitem)
  1185. {
  1186. if(!response) return 1;
  1187. new UpgradeList[2000], HouseID, DialogTitle[200], Counter, UpgradePrice, Msg[128], CarSlot, VehicleClassList[1000], VehicleList[500];
  1188. new MsgInsurance[128], BuyableCarIndex, bool:HouseHasCars = false;
  1189. HouseID = APlayerData[playerid][CurrentHouse];
  1190. if (AHouseData[HouseID][StaticHouse] == true)
  1191. {
  1192. if (listitem >= 1)
  1193. listitem++;
  1194. }
  1195. switch(listitem)
  1196. {
  1197. case 0:
  1198. {
  1199. if (House_PlayerIsOwner(playerid, HouseID) == 1)
  1200. {
  1201. format(DialogTitle, 200, "Régi ház neve: %s", AHouseData[HouseID][HouseName]);
  1202. ShowPlayerDialog(playerid, DialogHouseNameChange, DIALOG_STYLE_INPUT, DialogTitle, "Add meg a házad új nevét", "OK", "Mégse");
  1203. }
  1204. else
  1205. SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}Csak a tulajdonos tudja használni ezt a parancsot!");
  1206. }
  1207. case 1: // Ház fejlesztése
  1208. {
  1209. if (House_PlayerIsOwner(playerid, HouseID) == 1)
  1210. {
  1211. if (AHouseData[HouseID][HouseLevel] < AHouseData[HouseID][HouseMaxLevel])
  1212. {
  1213. for (new i = AHouseData[HouseID][HouseLevel] + 1; i <= AHouseData[HouseID][HouseMaxLevel]; i++)
  1214. {
  1215. Counter++;
  1216. UpgradePrice = ((AHouseData[HouseID][HousePrice] * Counter) / 100) * HouseUpgradePercent;
  1217. if (INT_GetPlayerMoney(playerid) >= UpgradePrice)
  1218. format(UpgradeList, 2000, "%s{00FF00}%s (level %i)\t\t$%i\n", UpgradeList, AHouseInteriors[i][InteriorName], i, UpgradePrice);
  1219. else
  1220. format(UpgradeList, 2000, "%s{FF0000}%s (level %i)\t\t$%i\n", UpgradeList, AHouseInteriors[i][InteriorName], i, UpgradePrice);
  1221. }
  1222. ShowPlayerDialog(playerid, DialogUpgradeHouse, DIALOG_STYLE_LIST, "Válassz:", UpgradeList, "Kiválaszt", "Mégse");
  1223. }
  1224. else
  1225. SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}A házadat már nem lehet tovább fejleszteni!");
  1226. }
  1227. else
  1228. SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}Csak a tulajdonos tudja használni ezt a parancsot!");
  1229. }/*
  1230. case 2: // Jármű vásárlás
  1231. {
  1232. if (House_PlayerIsOwner(playerid, HouseID) == 1)
  1233. {
  1234. CarSlot = House_GetFreeCarSlot(HouseID);
  1235. if (CarSlot != -1)
  1236. {
  1237. format(VehicleClassList, 1000, "%s{00FF00}%s{FFFFFF}\n", VehicleClassList, "Biciklik & Motorok");
  1238. format(VehicleClassList, 1000, "%s{40FF00}%s{FFFFFF}\n", VehicleClassList, "Hajók");
  1239. format(VehicleClassList, 1000, "%s{80FF00}%s{FFFFFF}\n", VehicleClassList, "Kabriók");
  1240. format(VehicleClassList, 1000, "%s{B0FF00}%s{FFFFFF}\n", VehicleClassList, "Helikopterek");
  1241. format(VehicleClassList, 1000, "%s{FFFF00}%s{FFFFFF}\n", VehicleClassList, "Ipari járművek");
  1242. format(VehicleClassList, 1000, "%s{B0FF40}%s{FFFFFF}\n", VehicleClassList, "Low-riderek");
  1243. format(VehicleClassList, 1000, "%s{80FF80}%s{FFFFFF}\n", VehicleClassList, "Off-Road járművek");
  1244. format(VehicleClassList, 1000, "%s{40FFB0}%s{FFFFFF}\n", VehicleClassList, "Repülők");
  1245. format(VehicleClassList, 1000, "%s{00FFFF}%s{FFFFFF}\n", VehicleClassList, "Szolgálati járművek");
  1246. format(VehicleClassList, 1000, "%s{00B0FF}%s{FFFFFF}\n", VehicleClassList, "RC járművek");
  1247. format(VehicleClassList, 1000, "%s{0080FF}%s{FFFFFF}\n", VehicleClassList, "Szalon járművek");
  1248. format(VehicleClassList, 1000, "%s{0040FF}%s{FFFFFF}\n", VehicleClassList, "Sport járművek");
  1249. format(VehicleClassList, 1000, "%s{0000FF}%s{FFFFFF}\n", VehicleClassList, "Vonat vagonok");
  1250. format(VehicleClassList, 1000, "%s{4000FF}%s{FFFFFF}\n", VehicleClassList, "Kamionos pótok");
  1251. format(VehicleClassList, 1000, "%s{8000FF}%s{FFFFFF}\n", VehicleClassList, "Egyéb járművek");
  1252. ShowPlayerDialog(playerid, DialogBuyCarClass, DIALOG_STYLE_LIST, "Válassz:", VehicleClassList, "Kiválaszt", "Mégse");
  1253. }
  1254. else
  1255. SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}Nem tudsz venni több kocsit. Elérted a maximumot!");
  1256. }
  1257. else
  1258. SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}Csak a tulajdonos tudja használni ezt a parancsot!");
  1259. }
  1260. case 3: // Jármű biztosítás
  1261. {
  1262. if (House_PlayerIsOwner(playerid, HouseID) == 1)
  1263. {
  1264. if (AHouseData[HouseID][Insurance] == false)
  1265. {
  1266. if (INT_GetPlayerMoney(playerid) >= (AHouseData[HouseID][HousePrice] / 10))
  1267. {
  1268. format(MsgInsurance, 128, "Biztos vagy benne hogy biztosítást kötsz $%i -ért?", AHouseData[HouseID][HousePrice] / 10);
  1269. if (AutomaticInsurance == true)
  1270. ShowPlayerDialog(playerid, DialogBuyInsurance, DIALOG_STYLE_MSGBOX, "Biztos vagy benne?", MsgInsurance, "Igen", "Nem");
  1271. else
  1272. ShowPlayerDialog(playerid, DialogBuyInsurance, DIALOG_STYLE_MSGBOX, "Buy insurance?", MsgInsurance, "Igen", "Nem");
  1273. }
  1274. else
  1275. SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}Nincs elég pénzed a biztosításra");
  1276. }
  1277. else
  1278. SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}Már van biztosításod");
  1279. }
  1280. else
  1281. SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}Csak a tulajdonos tudja használni ezt a parancsot!");
  1282. }
  1283. case 4: // Jármű eladása
  1284. {
  1285. if (House_PlayerIsOwner(playerid, HouseID) == 1)
  1286. {
  1287. for (CarSlot = 0; CarSlot < AHouseData[HouseID][CarSlots]; CarSlot++)
  1288. if (AHouseData[HouseID][VehicleIDs][CarSlot] != 0)
  1289. HouseHasCars = true;
  1290. if (HouseHasCars == true)
  1291. {
  1292. for (CarSlot = 0; CarSlot < AHouseData[HouseID][CarSlots]; CarSlot++)
  1293. {
  1294. if (AHouseData[HouseID][VehicleIDs][CarSlot] != 0)
  1295. {
  1296. BuyableCarIndex = VehicleBuyable_GetIndex(GetVehicleModel(AHouseData[HouseID][VehicleIDs][CarSlot]));
  1297. format(VehicleList, 500, "%s{00FF00}%s: $%i{FFFFFF}\n", VehicleList, ABuyableVehicles[BuyableCarIndex][CarName], ABuyableVehicles[BuyableCarIndex][Price] / 2);
  1298. }
  1299. else
  1300. format(VehicleList, 500, "%s{FFFFFF}Üres hely{FFFFFF}\n", VehicleList);
  1301. }
  1302. ShowPlayerDialog(playerid, DialogSellCar, DIALOG_STYLE_LIST, "Válaszd ki amelyiket el akarod adni:", VehicleList, "Kiválaszt", "Mégse");
  1303. }
  1304. else
  1305. SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}Nincs olyan kocsi amit el lehetne adni!");
  1306. }
  1307. else
  1308. SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}Csak a tulajdonos tudja használni ezt a parancsot!");
  1309. }*/
  1310. case 2: // Ház eladása
  1311. {
  1312. if (House_PlayerIsOwner(playerid, HouseID) == 1)
  1313. {
  1314. for (CarSlot = 0; CarSlot < AHouseData[HouseID][CarSlots]; CarSlot++)
  1315. if (AHouseData[HouseID][VehicleIDs][CarSlot] != 0)
  1316. HouseHasCars = true;
  1317. if (HouseHasCars == false)
  1318. {
  1319. format(Msg, 128, "Biztos vagy abban hogy eladod a házadat ennyiért: $%i?", House_CalcSellPrice(HouseID));
  1320. ShowPlayerDialog(playerid, DialogSellHouse, DIALOG_STYLE_MSGBOX, "Biztos?", Msg, "Igen", "Nem");
  1321. }
  1322. else
  1323. SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}Addig nem tudod eladni a házadat, míg a kocsijaidat el nem adtad!");
  1324. }
  1325. else
  1326. SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}Csak a tulajdonos tudja használni ezt a parancsot!");
  1327. }
  1328. case 3:
  1329. {
  1330. if (House_PlayerIsOwner(playerid, HouseID) == 1)
  1331. {
  1332. AHouseData[HouseID][HouseOpened] = true;
  1333. SendClientMessage(playerid, 0xFFFFFFFF, "{00FF00}Sikeresen kinyitottad a házadat");
  1334. }
  1335. else
  1336. SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}Csak a tulajdonos tudja használni ezt a parancsot!");
  1337. }
  1338. case 4:
  1339. {
  1340. if (House_PlayerIsOwner(playerid, HouseID) == 1)
  1341. {
  1342. AHouseData[HouseID][HouseOpened] = false;
  1343. SendClientMessage(playerid, 0xFFFFFFFF, "{00FF00}Bezártad a házadat, mosttantól csak te tudsz belépni!");
  1344. }
  1345. else
  1346. SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}Csak a tulajdonos tudja használni ezt a parancsot!");
  1347. }
  1348. case 5:
  1349. {
  1350. House_Exit(playerid, HouseID);
  1351. }
  1352. }
  1353.  
  1354. return 1;
  1355. }
  1356.  
  1357. Dialog_UpgradeHouse(playerid, response, listitem)
  1358. {
  1359. if(!response) return 1;
  1360. new Msg[128], HouseID, hLevel, Payment;
  1361. HouseID = APlayerData[playerid][CurrentHouse];
  1362. hLevel = listitem + 1 + AHouseData[HouseID][HouseLevel];
  1363. Payment = ((AHouseData[HouseID][HousePrice] * (listitem + 1)) / 100) * HouseUpgradePercent;
  1364. if (INT_GetPlayerMoney(playerid) >= Payment)
  1365. {
  1366. AHouseData[HouseID][HouseLevel] = hLevel;
  1367. AHouseData[HouseID][CarSlots] = hLevel;
  1368. for (new OtherPlayer; OtherPlayer < MAX_PLAYERS; OtherPlayer++)
  1369. {
  1370. if (APlayerData[OtherPlayer][CurrentHouse] == HouseID)
  1371. {
  1372. SetPlayerVirtualWorld(OtherPlayer, 5000 + HouseID);
  1373. SetPlayerInterior(OtherPlayer, AHouseInteriors[hLevel][InteriorID]);
  1374. SetPlayerPos(OtherPlayer, AHouseInteriors[hLevel][IntX], AHouseInteriors[hLevel][IntY], AHouseInteriors[hLevel][IntZ]);
  1375. }
  1376. }
  1377. INT_GivePlayerMoney(playerid, -Payment);
  1378. format(Msg, 128, "{00FF00}Sikeresen fejlesztetted a házadat erre a szintre: {FFFF00}%i{00FF00} ennyiért: {FFFF00}$%i", AHouseData[HouseID][HouseLevel], Payment);
  1379. SendClientMessage(playerid, 0xFFFFFFFF, Msg);
  1380. House_UpdateEntrance(HouseID);
  1381. HouseFile_Save(HouseID);
  1382. }
  1383. else
  1384. SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}Nincs elég pénzed, hogy fejleszd a házadat!");
  1385. return 1;
  1386. }
  1387.  
  1388. Dialog_GoHome(playerid, response, listitem)
  1389. {
  1390. if(!response) return 1;
  1391. new HouseIndex, HouseID;
  1392. HouseIndex = listitem;
  1393. HouseID = APlayerData[playerid][Houses][HouseIndex];
  1394. if (HouseID != 0)
  1395. {
  1396. SetPlayerPos(playerid, AHouseData[HouseID][HouseX], AHouseData[HouseID][HouseY], AHouseData[HouseID][HouseZ]);
  1397. }
  1398. else
  1399. SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}HIBA: Valószínűleg egy üres helyre kattintottál, ezért nem tudtunk a házadhoz teleportálni!");
  1400.  
  1401. return 1;
  1402. }
  1403.  
  1404. Dialog_ChangeHouseName(playerid, response, inputtext[])
  1405. {
  1406. if ((!response) || (strlen(inputtext) == 0)) return 1;
  1407. format(AHouseData[APlayerData[playerid][CurrentHouse]][HouseName], 100, inputtext);
  1408. House_UpdateEntrance(APlayerData[playerid][CurrentHouse]);
  1409. SendClientMessage(playerid, 0xFFFFFFFF, "{00FF00}Sikeresen megváltoztattad a ház nevét!");
  1410. HouseFile_Save(APlayerData[playerid][CurrentHouse]);
  1411.  
  1412. return 1;
  1413. }
  1414.  
  1415. Dialog_BuyCarClass(playerid, response, listitem)
  1416. {
  1417. if(!response) return 1;
  1418. new CarList[1000], DialogTitle[128];
  1419. APlayerData[playerid][DialogBuyVClass] = listitem + 1;
  1420. for (new i; i < sizeof(ABuyableVehicles); i++)
  1421. {
  1422. if (ABuyableVehicles[i][VehicleClass] == APlayerData[playerid][DialogBuyVClass])
  1423. {
  1424. format(CarList, 1000, "%s%s%s ($%i)", CarList, "\n", ABuyableVehicles[i][CarName], ABuyableVehicles[i][Price]);
  1425. }
  1426. }
  1427. if (strlen(CarList) == 0)
  1428. {
  1429. SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}Ez a lista üres, lehet egy admin letiltotta!");
  1430. return 1;
  1431. }
  1432. switch (APlayerData[playerid][DialogBuyVClass])
  1433. {
  1434. case VClassBike: format(DialogTitle, 128, "Válassz:");
  1435. case VClassBoat: format(DialogTitle, 128, "Válassz:");
  1436. case VClassConvertible: format(DialogTitle, 128, "Válassz:");
  1437. case VClassHelicopter: format(DialogTitle, 128, "Válassz:");
  1438. case VClassIndustrial: format(DialogTitle, 128, "Válassz:");
  1439. case VClassLowRider: format(DialogTitle, 128, "Válassz:");
  1440. case VClassOffRoad: format(DialogTitle, 128, "Válassz:");
  1441. case VClassPlane: format(DialogTitle, 128, "Válassz:");
  1442. case VClassPublic: format(DialogTitle, 128, "Válassz:");
  1443. case VClassRCVehicle: format(DialogTitle, 128, "Válassz:");
  1444. case VClassSaloons: format(DialogTitle, 128, "Válassz:");
  1445. case VClassSportCar: format(DialogTitle, 128, "Válassz:");
  1446. case VClassStationCar: format(DialogTitle, 128, "Válassz:");
  1447. case VClassTrailer: format(DialogTitle, 128, "Válassz:");
  1448. case VClassUnique: format(DialogTitle, 128, "Válassz:");
  1449. }
  1450. ShowPlayerDialog(playerid, DialogBuyCar, DIALOG_STYLE_LIST, DialogTitle, CarList, "Kiválaszt", "Mégse");
  1451. return 1;
  1452. }
  1453.  
  1454. Dialog_BuyCar(playerid, response, listitem)
  1455. {
  1456. if(!response) return 1;
  1457. new Counter, Msg[128], cComponents[14], vid;
  1458. new HouseID = APlayerData[playerid][CurrentHouse];
  1459. for (new i; i < sizeof(ABuyableVehicles); i++)
  1460. {
  1461. if (ABuyableVehicles[i][VehicleClass] == APlayerData[playerid][DialogBuyVClass])
  1462. {
  1463. if (Counter == listitem)
  1464. {
  1465. if (INT_GetPlayerMoney(playerid) >= (ABuyableVehicles[i][Price]))
  1466. {
  1467. vid = House_AddVehicle(HouseID, ABuyableVehicles[i][CarModel], 0, cComponents, 2585.0, 2829.0, 10.9, 0.0, random(126), random(126));
  1468. INT_SetVehicleFuel(vid, -1);
  1469. INT_GivePlayerMoney(playerid, -ABuyableVehicles[i][Price]);
  1470. format(Msg, 128, "{00FF00}Sikeresen vettél egy {FFFF00}%s{00FF00} ennyiért: {FFFF00}$%i", ABuyableVehicles[i][CarName], ABuyableVehicles[i][Price]);
  1471. SendClientMessage(playerid, 0xFFFFFFFF, Msg);
  1472. SendClientMessage(playerid, 0xFFFFFFFF, "{00FF00}Most menyj ki és használd: \"{FFFF00}/getcar{00FF00}\" lespawnoláshoz, és utánna használd: \"{FFFF00}/park{00FF00}\" hogy leparkold!");
  1473. HouseFile_Save(HouseID);
  1474. }
  1475. else
  1476. SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}Nincs rá elég pénzed!");
  1477. return 1;
  1478. }
  1479. else
  1480. Counter++;
  1481. }
  1482. }
  1483.  
  1484. return 1;
  1485. }
  1486.  
  1487. Dialog_BuyInsurance(playerid, response)
  1488. {
  1489. if(!response) return 1;
  1490. new Msg[128];
  1491. new HouseID = APlayerData[playerid][CurrentHouse];
  1492. AHouseData[HouseID][Insurance] = true;
  1493. INT_GivePlayerMoney(playerid, -(AHouseData[HouseID][HousePrice] / 10));
  1494. format(Msg, 128, "{00FF00}Sikeresen vettél biztosítást a kocsijaidra {FFFF00}$%i", AHouseData[HouseID][HousePrice] / 10);
  1495. SendClientMessage(playerid, 0xFFFFFFFF, Msg);
  1496. HouseFile_Save(HouseID);
  1497. return 1;
  1498. }
  1499.  
  1500. Dialog_SellHouse(playerid, response)
  1501. {
  1502. if(!response) return 1;
  1503. new HouseID = APlayerData[playerid][CurrentHouse];
  1504. for (new OtherPlayer; OtherPlayer < MAX_PLAYERS; OtherPlayer++)
  1505. {
  1506. if (APlayerData[OtherPlayer][CurrentHouse] == HouseID)
  1507. {
  1508. House_Exit(OtherPlayer, HouseID);
  1509. }
  1510. }
  1511. INT_GivePlayerMoney(playerid, House_CalcSellPrice(HouseID));
  1512. SendClientMessage(playerid, 0xFFFFFFFF, "{00FF00}Sikeresen eladtad a házadat!");
  1513. AHouseData[HouseID][Owned] = false;
  1514. AHouseData[HouseID][Owner] = 0;
  1515. AHouseData[HouseID][HouseName] = 0;
  1516. if (AHouseData[HouseID][StaticHouse] == false)
  1517. {
  1518. AHouseData[HouseID][HouseLevel] = 1;
  1519. AHouseData[HouseID][CarSlots] = 1;
  1520. }
  1521. AHouseData[HouseID][Insurance] = false;
  1522. AHouseData[HouseID][HouseOpened] = false;
  1523. for (new HouseSlot; HouseSlot < MAX_HOUSESPERPLAYER; HouseSlot++)
  1524. {
  1525. if (APlayerData[playerid][Houses][HouseSlot] == HouseID)
  1526. {
  1527. APlayerData[playerid][Houses][HouseSlot] = 0;
  1528. break;
  1529. }
  1530. }
  1531. House_UpdateEntrance(HouseID);
  1532. HouseFile_Save(HouseID);
  1533.  
  1534. return 1;
  1535. }
  1536.  
  1537. Dialog_SellCar(playerid, response, listitem)
  1538. {
  1539. if(!response) return 1;
  1540. new HouseID = APlayerData[playerid][CurrentHouse];
  1541. new vid = AHouseData[HouseID][VehicleIDs][listitem];
  1542. new CarSlot = listitem;
  1543. if (vid != 0)
  1544. {
  1545. new BuyableCarIndex = VehicleBuyable_GetIndex(GetVehicleModel(vid));
  1546. new Msg[128];
  1547. Vehicle_Delete(vid, HouseID, CarSlot);
  1548. INT_GivePlayerMoney(playerid, (ABuyableVehicles[BuyableCarIndex][Price] / 2));
  1549. format(Msg, 128, "{00FF00}Sikeresen eladtad a {FFFF00}%s{00FF00} ennyiért: {FFFF00}$%i", ABuyableVehicles[BuyableCarIndex][CarName], ABuyableVehicles[BuyableCarIndex][Price] / 2);
  1550. SendClientMessage(playerid, 0xFFFFFFFF, Msg);
  1551. HouseFile_Save(HouseID);
  1552. }
  1553. else
  1554. SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}Nincs eladható jármű");
  1555.  
  1556. return 1;
  1557. }
  1558.  
  1559. Dialog_GetCarSelectHouse(playerid, response, listitem)
  1560. {
  1561. if(!response) return 1;
  1562. new HouseID = APlayerData[playerid][Houses][listitem];
  1563. if (HouseID != 0)
  1564. {
  1565. new BuyableCarIndex, VehicleList[500], bool:HouseHasCars = false, CarSlot;
  1566. APlayerData[playerid][DialogGetCarHouseID] = HouseID;
  1567. for (CarSlot = 0; CarSlot < AHouseData[HouseID][CarSlots]; CarSlot++)
  1568. if (AHouseData[HouseID][VehicleIDs][CarSlot] != 0)
  1569. HouseHasCars = true;
  1570. if (HouseHasCars == true)
  1571. {
  1572. for (CarSlot = 0; CarSlot < AHouseData[HouseID][CarSlots]; CarSlot++)
  1573. {
  1574. if (AHouseData[HouseID][VehicleIDs][CarSlot] != 0)
  1575. {
  1576. BuyableCarIndex = VehicleBuyable_GetIndex(GetVehicleModel(AHouseData[HouseID][VehicleIDs][CarSlot]));
  1577. format(VehicleList, 500, "%s{00FF00}%s\n", VehicleList, ABuyableVehicles[BuyableCarIndex][CarName]);
  1578. }
  1579. else
  1580. format(VehicleList, 500, "%s{FFFFFF}Üres hely{FFFFFF}\n", VehicleList);
  1581. }
  1582. ShowPlayerDialog(playerid, DialogGetCarSelectCar, DIALOG_STYLE_LIST, "Válassz:", VehicleList, "Kiválaszt", "Mégse");
  1583. }
  1584. else
  1585. SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}Ehhez a házhoz nem tartozik jármű");
  1586. }
  1587. else
  1588. SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}Üres solt!");
  1589.  
  1590. return 1;
  1591. }
  1592.  
  1593. Dialog_GetCarSelectCar(playerid, response, listitem)
  1594. {
  1595. if(!response) return 1;
  1596. new HouseID = APlayerData[playerid][DialogGetCarHouseID];
  1597. new vid = AHouseData[HouseID][VehicleIDs][listitem];
  1598. if (vid != 0)
  1599. {
  1600. new Float:x, Float:y, Float:z, Float:Angle;
  1601. GetPlayerPos(playerid, x, y, z);
  1602. GetPlayerFacingAngle(playerid, Angle);
  1603. SetVehiclePos(vid, x, y, z);
  1604. PutPlayerInVehicle(playerid, vid, 0);
  1605. SetVehicleZAngle(vid, Angle);
  1606. new engine,lights,alarm,doors,bonnet,boot,objective;
  1607. GetVehicleParamsEx(vid, engine, lights, alarm, doors, bonnet, boot, objective);
  1608. SetVehicleParamsEx(vid, 1, 1, alarm, doors, bonnet, boot, objective);
  1609. SendClientMessage(playerid, 0xFFFFFFFF, "{00FF00}Sikeresen lehívtad a járművedet, most használd \"{FFFF00}/park{00FF00}\" ahhoz, hogy leparkold!");
  1610. }
  1611. else
  1612. SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}Nincs kocsi, üres helyre kattintottál!");
  1613.  
  1614. return 1;
  1615. }
  1616.  
  1617. HouseFile_Load(HouseID)
  1618. {
  1619. new file[100], File:HFile, LineFromFile[100], ParameterName[50], ParameterValue[50];
  1620. format(file, sizeof(file), HouseFile, HouseID);
  1621. if (fexist(file))
  1622. {
  1623. HFile = fopen(file, io_read);
  1624. fread(HFile, LineFromFile);
  1625. while (strlen(LineFromFile) > 0)
  1626. {
  1627. StripNewLine(LineFromFile);
  1628. sscanf(LineFromFile, "s[50]s[50]", ParameterName, ParameterValue);
  1629. if (strlen(LineFromFile) > 0)
  1630. {
  1631. if (strcmp(ParameterName, "Owned", false) == 0) // If the parametername is correct ("Owned")
  1632. {
  1633. if (strcmp(ParameterValue, "Yes", false) == 0) // If the value "Yes" was read
  1634. AHouseData[HouseID][Owned] = true; // House is owned
  1635. else
  1636. AHouseData[HouseID][Owned] = false; // House is not owned
  1637. }
  1638. if (strcmp(ParameterName, "Owner", false) == 0) // If the parametername is correct ("Owner")
  1639. // Store the Owner (Owner will hold "1" if there is no owner (empty string), done by "sscanf" I guess)
  1640. // But this doesn't matter, as the owner will never be displayed when the house is not owned by someone
  1641. format(AHouseData[HouseID][Owner], 24, ParameterValue);
  1642.  
  1643. if (strcmp(ParameterName, "HouseName", false) == 0) // If the parametername is correct ("HouseName")
  1644. format(AHouseData[HouseID][HouseName], 24, ParameterValue); // Store the HouseName
  1645. if (strcmp(ParameterName, "HouseX", false) == 0) // If the parametername is correct ("HouseX")
  1646. AHouseData[HouseID][HouseX] = floatstr(ParameterValue); // Store the HouseX
  1647. if (strcmp(ParameterName, "HouseY", false) == 0) // If the parametername is correct ("HouseY")
  1648. AHouseData[HouseID][HouseY] = floatstr(ParameterValue); // Store the HouseY
  1649. if (strcmp(ParameterName, "HouseZ", false) == 0) // If the parametername is correct ("HouseZ")
  1650. AHouseData[HouseID][HouseZ] = floatstr(ParameterValue); // Store the HouseZ
  1651. if (strcmp(ParameterName, "HouseLevel", false) == 0) // If the parametername is correct ("HouseLevel")
  1652. AHouseData[HouseID][HouseLevel] = strval(ParameterValue); // Store the HouseLevel
  1653. if (strcmp(ParameterName, "HouseMaxLevel", false) == 0) // If the parametername is correct ("HouseMaxLevel")
  1654. AHouseData[HouseID][HouseMaxLevel] = strval(ParameterValue); // Store the HouseMaxLevel
  1655. if (strcmp(ParameterName, "HousePrice", false) == 0) // If the parametername is correct ("HousePrice")
  1656. AHouseData[HouseID][HousePrice] = strval(ParameterValue); // Store the HousePrice
  1657. if (strcmp(ParameterName, "HouseOpened", false) == 0) // If the parametername is correct ("HouseOpened")
  1658. {
  1659. if (strcmp(ParameterValue, "Yes", false) == 0) // If the value "Yes" was read
  1660. AHouseData[HouseID][HouseOpened] = true; // House is open to the public (anyone can enter)
  1661. else
  1662. AHouseData[HouseID][HouseOpened] = false; // House is closed to the public, only house-owner can enter
  1663. }
  1664. if (strcmp(ParameterName, "Insurance", false) == 0) // If the parametername is correct ("Insurance")
  1665. {
  1666. if (strcmp(ParameterValue, "Yes", false) == 0) // If the value "Yes" was read
  1667. AHouseData[HouseID][Insurance] = true; // House has insurance for it's vehicles
  1668. else
  1669. AHouseData[HouseID][Insurance] = false; // House doesn't have insurance
  1670. }
  1671.  
  1672. if (strcmp(ParameterName, "StaticHouse", false) == 0) // If the parametername is correct ("StaticHouse")
  1673. {
  1674. if (strcmp(ParameterValue, "Yes", false) == 0) // If the value "Yes" was read
  1675. AHouseData[HouseID][StaticHouse] = true; // House is static (not upgradable, fixed interior and carslots)
  1676. else
  1677. AHouseData[HouseID][StaticHouse] = false; // House isn't static (upgradable, interior and carslots based on HouseLevel)
  1678. }
  1679. if (strcmp(ParameterName, "CarSlots", false) == 0) // If the parametername is correct ("CarSlots")
  1680. AHouseData[HouseID][CarSlots] = strval(ParameterValue); // Store the CarSlots
  1681. }
  1682. fread(HFile, LineFromFile);
  1683. }
  1684. fclose(HFile);
  1685. House_UpdateEntrance(HouseID);
  1686. TotalHouses++;
  1687. return 1;
  1688. }
  1689. else
  1690. return 0;
  1691. }
  1692.  
  1693. HouseFile_LoadCars(HouseID)
  1694. {
  1695. new file[100], File:HFile, LineFromFile[100], ParameterName[50], ParameterValue[50];
  1696. new vid, cModel, cPaint, cComponents[14], Float:cx, Float:cy, Float:cz, Float:crot, Col1, Col2, cFuel;
  1697. format(file, sizeof(file), HouseFile, HouseID);
  1698. if (fexist(file))
  1699. {
  1700. HFile = fopen(file, io_read);
  1701. fread(HFile, LineFromFile);
  1702. while (strlen(LineFromFile) > 0)
  1703. {
  1704. StripNewLine(LineFromFile);
  1705. sscanf(LineFromFile, "s[50]s[50]", ParameterName, ParameterValue);
  1706. if (strlen(LineFromFile) > 0)
  1707. {
  1708. if (strcmp(ParameterName, "[Vehicle]", false) == 0) // If the parametername is correct ("[Vehicle]")
  1709. {
  1710. for (new i; i < 14; i++)
  1711. cComponents[i] = 0;
  1712. }
  1713. if (strcmp(ParameterName, "VehicleModel", false) == 0) // If the parametername is correct ("VehicleModel")
  1714. cModel = strval(ParameterValue); // Store the VehicleModel
  1715. if (strcmp(ParameterName, "VehiclePaintJob", false) == 0) // If the parametername is correct ("VehiclePaintJob")
  1716. cPaint = strval(ParameterValue); // Store the VehiclePaintJob
  1717. if (strcmp(ParameterName, "VehicleSpoiler", false) == 0) // If the parametername is correct ("VehicleSpoiler")
  1718. cComponents[0] = strval(ParameterValue); // Store the VehicleSpoiler
  1719. if (strcmp(ParameterName, "VehicleHood", false) == 0) // If the parametername is correct ("VehicleHood")
  1720. cComponents[1] = strval(ParameterValue); // Store the VehicleHood
  1721. if (strcmp(ParameterName, "VehicleRoof", false) == 0) // If the parametername is correct ("VehicleRoof")
  1722. cComponents[2] = strval(ParameterValue); // Store the VehicleRoof
  1723. if (strcmp(ParameterName, "VehicleSideSkirt", false) == 0) // If the parametername is correct ("VehicleSideSkirt")
  1724. cComponents[3] = strval(ParameterValue); // Store the VehicleSideSkirt
  1725. if (strcmp(ParameterName, "VehicleLamps", false) == 0) // If the parametername is correct ("VehicleLamps")
  1726. cComponents[4] = strval(ParameterValue); // Store the VehicleLamps
  1727. if (strcmp(ParameterName, "VehicleNitro", false) == 0) // If the parametername is correct ("VehicleNitro")
  1728. cComponents[5] = strval(ParameterValue); // Store the VehicleNitro
  1729. if (strcmp(ParameterName, "VehicleExhaust", false) == 0) // If the parametername is correct ("VehicleExhaust")
  1730. cComponents[6] = strval(ParameterValue); // Store the VehicleExhaust
  1731. if (strcmp(ParameterName, "VehicleWheels", false) == 0) // If the parametername is correct ("VehicleWheels")
  1732. cComponents[7] = strval(ParameterValue); // Store the VehicleWheels
  1733. if (strcmp(ParameterName, "VehicleStereo", false) == 0) // If the parametername is correct ("VehicleStereo")
  1734. cComponents[8] = strval(ParameterValue); // Store the VehicleStereo
  1735. if (strcmp(ParameterName, "VehicleHydraulics", false) == 0) // If the parametername is correct ("VehicleHydraulics")
  1736. cComponents[9] = strval(ParameterValue); // Store the VehicleHydraulics
  1737. if (strcmp(ParameterName, "VehicleFrontBumper", false) == 0) // If the parametername is correct ("VehicleFrontBumper")
  1738. cComponents[10] = strval(ParameterValue); // Store the VehicleFrontBumper
  1739. if (strcmp(ParameterName, "VehicleRearBumper", false) == 0) // If the parametername is correct ("VehicleRearBumper")
  1740. cComponents[11] = strval(ParameterValue); // Store the VehicleRearBumper
  1741. if (strcmp(ParameterName, "VehicleVentRight", false) == 0) // If the parametername is correct ("VehicleVentRight")
  1742. cComponents[12] = strval(ParameterValue); // Store the VehicleVentRight
  1743. if (strcmp(ParameterName, "VehicleVentLeft", false) == 0) // If the parametername is correct ("VehicleVentLeft")
  1744. cComponents[13] = strval(ParameterValue); // Store the VehicleVentLeft
  1745.  
  1746. if (strcmp(ParameterName, "Color1", false) == 0) // If the parametername is correct ("Color1")
  1747. Col1 = strval(ParameterValue); // Store the Color1
  1748. if (strcmp(ParameterName, "Color2", false) == 0) // If the parametername is correct ("Color2")
  1749. Col2 = strval(ParameterValue); // Store the Color2
  1750.  
  1751. if (strcmp(ParameterName, "VehicleX", false) == 0) // If the parametername is correct ("VehicleX")
  1752. cx = floatstr(ParameterValue); // Store the VehicleX
  1753. if (strcmp(ParameterName, "VehicleY", false) == 0) // If the parametername is correct ("VehicleY")
  1754. cy = floatstr(ParameterValue); // Store the VehicleY
  1755. if (strcmp(ParameterName, "VehicleZ", false) == 0) // If the parametername is correct ("VehicleZ")
  1756. cz = floatstr(ParameterValue); // Store the VehicleZ
  1757. if (strcmp(ParameterName, "VehicleAngle", false) == 0) // If the parametername is correct ("VehicleAngle")
  1758. crot = floatstr(ParameterValue); // Store the VehicleAngle
  1759.  
  1760. if (strcmp(ParameterName, "Fuel", false) == 0) // If the parametername is correct ("Fuel")
  1761. cFuel = strval(ParameterValue); // Store the Fuel
  1762.  
  1763. if (strcmp(ParameterName, "[/Vehicle]", false) == 0) // If the parametername is correct ("[/Vehicle]")
  1764. {
  1765. if ((Col1 == 0) && (cPaint != 0))
  1766. Col1 = 1;
  1767. if ((Col2 == 0) && (cPaint != 0))
  1768. Col2 = 1;
  1769. vid = House_AddVehicle(HouseID, cModel, cPaint, cComponents, cx, cy, cz, crot, Col1, Col2);
  1770. INT_SetVehicleFuel(vid, cFuel);
  1771. }
  1772. }
  1773. fread(HFile, LineFromFile);
  1774. }
  1775. fclose(HFile);
  1776. return 1;
  1777. }
  1778. else
  1779. return 0;
  1780. }
  1781.  
  1782. HouseFile_Save(HouseID)
  1783. {
  1784. new file[100], File:HFile, LineForFile[100], vid;
  1785.  
  1786. format(file, sizeof(file), HouseFile, HouseID);
  1787.  
  1788. HFile = fopen(file, io_write);
  1789.  
  1790. if (AHouseData[HouseID][Owned] == true) // Check if the house is owned
  1791. format(LineForFile, 100, "Owned Yes\r\n"); // Construct the line: "Owned Yes"
  1792. else
  1793. format(LineForFile, 100, "Owned No\r\n"); // Construct the line: "Owned No"
  1794. fwrite(HFile, LineForFile); // And save it to the file
  1795.  
  1796. format(LineForFile, 100, "Owner %s\r\n", AHouseData[HouseID][Owner]); // Construct the line: "Owner <Owner>"
  1797. fwrite(HFile, LineForFile); // And save it to the file
  1798.  
  1799. format(LineForFile, 100, "HouseName %s\r\n", AHouseData[HouseID][HouseName]); // Construct the line: "HouseName <HouseName>"
  1800. fwrite(HFile, LineForFile); // And save it to the file
  1801. format(LineForFile, 100, "HouseX %f\r\n", AHouseData[HouseID][HouseX]); // Construct the line: "HouseX <HouseX>"
  1802. fwrite(HFile, LineForFile); // And save it to the file
  1803. format(LineForFile, 100, "HouseY %f\r\n", AHouseData[HouseID][HouseY]); // Construct the line: "HouseY <HouseY>"
  1804. fwrite(HFile, LineForFile); // And save it to the file
  1805. format(LineForFile, 100, "HouseZ %f\r\n", AHouseData[HouseID][HouseZ]); // Construct the line: "HouseZ <HouseZ>"
  1806. fwrite(HFile, LineForFile); // And save it to the file
  1807. format(LineForFile, 100, "HouseLevel %i\r\n", AHouseData[HouseID][HouseLevel]); // Construct the line: "HouseLevel <HouseLevel>"
  1808. fwrite(HFile, LineForFile); // And save it to the file
  1809. format(LineForFile, 100, "HouseMaxLevel %i\r\n", AHouseData[HouseID][HouseMaxLevel]); // Construct the line: "HouseMaxLevel <HouseMaxLevel>"
  1810. fwrite(HFile, LineForFile); // And save it to the file
  1811. format(LineForFile, 100, "HousePrice %i\r\n", AHouseData[HouseID][HousePrice]); // Construct the line: "HousePrice <HousePrice>"
  1812. fwrite(HFile, LineForFile); // And save it to the file
  1813.  
  1814. if (AHouseData[HouseID][HouseOpened] == true) // Check if the house is open to the public
  1815. format(LineForFile, 100, "HouseOpened Yes\r\n"); // Construct the line: "HouseOpened Yes"
  1816. else
  1817. format(LineForFile, 100, "HouseOpened No\r\n"); // Construct the line: "HouseOpened No"
  1818. fwrite(HFile, LineForFile); // And save it to the file
  1819.  
  1820. if (AHouseData[HouseID][Insurance] == true) // Check if the house has insurance for it's vehicles
  1821. format(LineForFile, 100, "Insurance Yes\r\n"); // Construct the line: "Insurance Yes"
  1822. else
  1823. format(LineForFile, 100, "Insurance No\r\n"); // Construct the line: "Insurance No"
  1824. fwrite(HFile, LineForFile); // And save it to the file
  1825.  
  1826. if (AHouseData[HouseID][StaticHouse] == true) // Check if the house is a static house
  1827. format(LineForFile, 100, "StaticHouse Yes\r\n"); // Construct the line: "StaticHouse Yes"
  1828. else
  1829. format(LineForFile, 100, "StaticHouse No\r\n"); // Construct the line: "StaticHouse No"
  1830. fwrite(HFile, LineForFile); // And save it to the file
  1831.  
  1832. format(LineForFile, 100, "CarSlots %i\r\n", AHouseData[HouseID][CarSlots]); // Construct the line: "CarSlots <CarSlots>"
  1833. fwrite(HFile, LineForFile); // And save it to the file
  1834. fwrite(HFile, "\r\n"); // Add an empty line, just for readability
  1835.  
  1836. for (new CarSlot; CarSlot < AHouseData[HouseID][CarSlots]; CarSlot++)
  1837. {
  1838. if (AHouseData[HouseID][VehicleIDs][CarSlot] != 0)
  1839. {
  1840. vid = AHouseData[HouseID][VehicleIDs][CarSlot];
  1841.  
  1842. format(LineForFile, 100, "[Vehicle]\r\n"); // Construct the line: "[Vehicle]"
  1843. fwrite(HFile, LineForFile); // And save it to the file
  1844.  
  1845. format(LineForFile, 100, "VehicleModel %i\r\n", AVehicleData[vid][Model]); // Construct the line: "VehicleModel <VehicleModel>"
  1846. fwrite(HFile, LineForFile); // And save it to the file
  1847. format(LineForFile, 100, "VehiclePaintJob %i\r\n", AVehicleData[vid][PaintJob]); // Construct the line: "VehiclePaintJob <VehiclePaintJob>"
  1848. fwrite(HFile, LineForFile); // And save it to the file
  1849.  
  1850. format(LineForFile, 100, "VehicleSpoiler %i\r\n", AVehicleData[vid][Components][0]); // Construct the line: "VehicleSpoiler <VehicleSpoiler>"
  1851. fwrite(HFile, LineForFile); // And save it to the file
  1852. format(LineForFile, 100, "VehicleHood %i\r\n", AVehicleData[vid][Components][1]); // Construct the line: "VehicleHood <VehicleHood>"
  1853. fwrite(HFile, LineForFile); // And save it to the file
  1854. format(LineForFile, 100, "VehicleRoof %i\r\n", AVehicleData[vid][Components][2]); // Construct the line: "VehicleRoof <VehicleRoof>"
  1855. fwrite(HFile, LineForFile); // And save it to the file
  1856. format(LineForFile, 100, "VehicleSideSkirt %i\r\n", AVehicleData[vid][Components][3]); // Construct the line: "VehicleSideSkirt <VehicleSideSkirt>"
  1857. fwrite(HFile, LineForFile); // And save it to the file
  1858. format(LineForFile, 100, "VehicleLamps %i\r\n", AVehicleData[vid][Components][4]); // Construct the line: "VehicleLamps <VehicleLamps>"
  1859. fwrite(HFile, LineForFile); // And save it to the file
  1860. format(LineForFile, 100, "VehicleNitro %i\r\n", AVehicleData[vid][Components][5]); // Construct the line: "VehicleNitro <VehicleNitro>"
  1861. fwrite(HFile, LineForFile); // And save it to the file
  1862. format(LineForFile, 100, "VehicleExhaust %i\r\n", AVehicleData[vid][Components][6]); // Construct the line: "VehicleSpoiler <VehicleSpoiler>"
  1863. fwrite(HFile, LineForFile); // And save it to the file
  1864. format(LineForFile, 100, "VehicleWheels %i\r\n", AVehicleData[vid][Components][7]); // Construct the line: "VehicleWheels <VehicleWheels>"
  1865. fwrite(HFile, LineForFile); // And save it to the file
  1866. format(LineForFile, 100, "VehicleStereo %i\r\n", AVehicleData[vid][Components][8]); // Construct the line: "VehicleStereo <VehicleStereo>"
  1867. fwrite(HFile, LineForFile); // And save it to the file
  1868. format(LineForFile, 100, "VehicleHydraulics %i\r\n", AVehicleData[vid][Components][9]); // Construct the line: "VehicleHydraulics <VehicleHydraulics>"
  1869. fwrite(HFile, LineForFile); // And save it to the file
  1870. format(LineForFile, 100, "VehicleFrontBumper %i\r\n", AVehicleData[vid][Components][10]); // Construct the line: "VehicleFrontBumper <VehicleFrontBumper>"
  1871. fwrite(HFile, LineForFile); // And save it to the file
  1872. format(LineForFile, 100, "VehicleRearBumper %i\r\n", AVehicleData[vid][Components][11]); // Construct the line: "VehicleRearBumper <VehicleRearBumper>"
  1873. fwrite(HFile, LineForFile); // And save it to the file
  1874. format(LineForFile, 100, "VehicleVentRight %i\r\n", AVehicleData[vid][Components][12]); // Construct the line: "VehicleVentRight <VehicleVentRight>"
  1875. fwrite(HFile, LineForFile); // And save it to the file
  1876. format(LineForFile, 100, "VehicleVentLeft %i\r\n", AVehicleData[vid][Components][13]); // Construct the line: "VehicleVentLeft <VehicleVentLeft>"
  1877. fwrite(HFile, LineForFile); // And save it to the file
  1878.  
  1879. format(LineForFile, 100, "Color1 %i\r\n", AVehicleData[vid][Color1]); // Construct the line: "Color1 <Color1>"
  1880. fwrite(HFile, LineForFile); // And save it to the file
  1881. format(LineForFile, 100, "Color2 %i\r\n", AVehicleData[vid][Color2]); // Construct the line: "Color2 <Color2>"
  1882. fwrite(HFile, LineForFile); // And save it to the file
  1883.  
  1884. format(LineForFile, 100, "VehicleX %f\r\n", AVehicleData[vid][SpawnX]); // Construct the line: "VehicleVentLeft <VehicleVentLeft>"
  1885. fwrite(HFile, LineForFile); // And save it to the file
  1886. format(LineForFile, 100, "VehicleY %f\r\n", AVehicleData[vid][SpawnY]); // Construct the line: "VehicleVentLeft <VehicleVentLeft>"
  1887. fwrite(HFile, LineForFile); // And save it to the file
  1888. format(LineForFile, 100, "VehicleZ %f\r\n", AVehicleData[vid][SpawnZ]); // Construct the line: "VehicleVentLeft <VehicleVentLeft>"
  1889. fwrite(HFile, LineForFile); // And save it to the file
  1890. format(LineForFile, 100, "VehicleAngle %f\r\n", AVehicleData[vid][SpawnRot]); // Construct the line: "VehicleVentLeft <VehicleVentLeft>"
  1891. fwrite(HFile, LineForFile); // And save it to the file
  1892.  
  1893. format(LineForFile, 100, "Fuel %i\r\n", INT_GetVehicleFuel(vid)); // Construct the line: "Fuel <Fuel>"
  1894. fwrite(HFile, LineForFile); // And save it to the file
  1895.  
  1896. format(LineForFile, 100, "[/Vehicle]\r\n"); // Construct the line: "[/Vehicle]"
  1897. fwrite(HFile, LineForFile); // And save it to the file
  1898. fwrite(HFile, "\r\n"); // Add an empty line, just for readability
  1899. }
  1900. }
  1901.  
  1902. fclose(HFile); // Close the file
  1903.  
  1904. return 1;
  1905. }
  1906.  
  1907. House_UpdateEntrance(HouseID)
  1908. {
  1909. new Msg[128], Float:x, Float:y, Float:z;
  1910. x = AHouseData[HouseID][HouseX];
  1911. y = AHouseData[HouseID][HouseY];
  1912. z = AHouseData[HouseID][HouseZ];
  1913. if (IsValidDynamicPickup(AHouseData[HouseID][PickupID]))
  1914. DestroyDynamicPickup(AHouseData[HouseID][PickupID]);
  1915. if (IsValidDynamicMapIcon(AHouseData[HouseID][MapIconID]))
  1916. DestroyDynamicMapIcon(AHouseData[HouseID][MapIconID]);
  1917. if (IsValidDynamic3DTextLabel(AHouseData[HouseID][DoorText]))
  1918. DestroyDynamic3DTextLabel(AHouseData[HouseID][DoorText]);
  1919.  
  1920. // Add a new pickup at the house's location (usually near the door), green = free, blue = owned
  1921. if (AHouseData[HouseID][Owned] == true)
  1922. {
  1923. // Create a blue house-pickup (house is owned)
  1924. AHouseData[HouseID][PickupID] = CreateDynamicPickup(1272, 1, x, y, z, 0);
  1925. if (AHouseData[HouseID][StaticHouse] == true)
  1926. format(Msg, 128, "%s\nTulajdonos: %s\nSize: %i\n/enter", AHouseData[HouseID][HouseName], AHouseData[HouseID][Owner], AHouseData[HouseID][HouseLevel]);
  1927. else
  1928. format(Msg, 128, "%s\nTulajdonos: %s\nHouse-level: %i\n/enter", AHouseData[HouseID][HouseName], AHouseData[HouseID][Owner], AHouseData[HouseID][HouseLevel]);
  1929. AHouseData[HouseID][DoorText] = CreateDynamic3DTextLabel(Msg, 0x008080FF, x, y, z + 1.0, 50.0);
  1930. // Add a streamed icon to the map (red house), type = 32, color = 0, world = 0, interior = 0, playerid = -1, drawdist = 150.0
  1931. if (ShowBoughtHouses == true)
  1932. AHouseData[HouseID][MapIconID] = CreateDynamicMapIcon(x, y, z, 32, 0, 0, 0, -1, 150.0);
  1933. }
  1934. else
  1935. {
  1936. AHouseData[HouseID][PickupID] = CreateDynamicPickup(1273, 1, x, y, z, 0);
  1937. if (AHouseData[HouseID][StaticHouse] == true)
  1938. format(Msg, 128, "Eladó ház\n$%i\nSize: %i\n/buyhouse", AHouseData[HouseID][HousePrice], AHouseData[HouseID][HouseLevel]);
  1939. else
  1940. format(Msg, 128, "Eladó ház\n$%i\nMax-level: %i\n/buyhouse", AHouseData[HouseID][HousePrice], AHouseData[HouseID][HouseMaxLevel]);
  1941. AHouseData[HouseID][DoorText] = CreateDynamic3DTextLabel(Msg, 0x008080FF, x, y, z + 1.0, 50.0);
  1942. AHouseData[HouseID][MapIconID] = CreateDynamicMapIcon(x, y, z, 31, 0, 0, 0, -1, 150.0);
  1943. }
  1944. }
  1945.  
  1946. House_Exit(playerid, HouseID)
  1947. {
  1948. SetPlayerVirtualWorld(playerid, 0);
  1949. SetPlayerInterior(playerid, 0);
  1950. SetPlayerPos(playerid, AHouseData[HouseID][HouseX], AHouseData[HouseID][HouseY], AHouseData[HouseID][HouseZ]);
  1951. APlayerData[playerid][CurrentHouse] = 0;
  1952. if (ExitHouseTimer > 0)
  1953. {
  1954. TogglePlayerControllable(playerid, 0);
  1955. GameTextForPlayer(playerid, "Wait", ExitHouseTimer, 4);
  1956. SetTimerEx("House_ExitTimer", ExitHouseTimer, false, "ii", playerid, HouseID);
  1957. }
  1958.  
  1959. return 1;
  1960. }
  1961.  
  1962. forward House_ExitTimer(playerid, HouseID);
  1963. public House_ExitTimer(playerid, HouseID)
  1964. {
  1965. TogglePlayerControllable(playerid, 1);
  1966. for (new CarSlot; CarSlot < AHouseData[HouseID][CarSlots]; CarSlot++)
  1967. if (AHouseData[HouseID][VehicleIDs][CarSlot] != 0)
  1968. SetVehicleToRespawn(AHouseData[HouseID][VehicleIDs][CarSlot]);
  1969.  
  1970. return 1;
  1971. }
  1972.  
  1973. House_SetOwner(playerid, HouseID)
  1974. {
  1975. new FreeHouseSlot, Name[24], Msg[128];
  1976. FreeHouseSlot = Player_GetFreeHouseSlot(playerid);
  1977. if (FreeHouseSlot != -1)
  1978. {
  1979. GetPlayerName(playerid, Name, sizeof(Name));
  1980. APlayerData[playerid][Houses][FreeHouseSlot] = HouseID;
  1981. INT_GivePlayerMoney(playerid, -AHouseData[HouseID][HousePrice]);
  1982. AHouseData[HouseID][Owned] = true;
  1983. format(AHouseData[HouseID][Owner], 24, Name);
  1984. if (AHouseData[HouseID][StaticHouse] == false)
  1985. {
  1986. AHouseData[HouseID][HouseLevel] = 1;
  1987. AHouseData[HouseID][CarSlots] = 1;
  1988. }
  1989. format(AHouseData[HouseID][HouseName], 100, "%s háza", Name);
  1990. House_UpdateEntrance(HouseID);
  1991. HouseFile_Save(HouseID);
  1992. format(Msg, 128, "{00FF00}Megvetted ezt a házat ennyiért: {FFFF00}$%i", AHouseData[HouseID][HousePrice]);
  1993. SendClientMessage(playerid, 0xFFFFFFFF, Msg);
  1994. }
  1995. else
  1996. SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}Több házat nem tudsz venni, elérted a maximumot!");
  1997.  
  1998. return 1;
  1999. }
  2000.  
  2001. House_AddVehicle(HouseID, cModel, cPaint, cComponents[], Float:cx, Float:cy, Float:cz, Float:crot, Col1, Col2)
  2002. {
  2003. new vid, CarSlot;
  2004. CarSlot = House_GetFreeCarSlot(HouseID);
  2005. if (CarSlot != -1)
  2006. {
  2007. vid = CreateVehicle(cModel, cx, cy, cz, crot, Col1, Col2, 600);
  2008. AHouseData[HouseID][VehicleIDs][CarSlot] = vid;
  2009. AVehicleData[vid][Model] = cModel;
  2010. AVehicleData[vid][PaintJob] = cPaint;
  2011. if (cPaint != 0)
  2012. ChangeVehiclePaintjob(vid, cPaint - 1);
  2013. ChangeVehicleColor(vid, Col1, Col2);
  2014. AVehicleData[vid][Color1] = Col1;
  2015. AVehicleData[vid][Color2] = Col2;
  2016. for (new i; i < 14; i++)
  2017. {
  2018. AVehicleData[vid][Components][i] = cComponents[i];
  2019. if (AVehicleData[vid][Components][i] != 0)
  2020. AddVehicleComponent(vid, AVehicleData[vid][Components][i]);
  2021. }
  2022. AVehicleData[vid][SpawnX] = cx;
  2023. AVehicleData[vid][SpawnY] = cy;
  2024. AVehicleData[vid][SpawnZ] = cz;
  2025. AVehicleData[vid][SpawnRot] = crot;
  2026. AVehicleData[vid][Owned] = true;
  2027. format(AVehicleData[vid][Owner], 24, AHouseData[HouseID][Owner]);
  2028. AVehicleData[vid][BelongsToHouse] = HouseID;
  2029. }
  2030. else
  2031. return 0;
  2032. return vid;
  2033. }
  2034. /*
  2035. House_ReplaceVehicle(HouseID, CarSlot)
  2036. {
  2037. new vid, cModel, cPaint, cComponents[14], Float:cx, Float:cy, Float:cz, Float:crot, Col1, Col2, cFuel;
  2038. vid = AHouseData[HouseID][VehicleIDs][CarSlot];
  2039. cModel = AVehicleData[vid][Model];
  2040. cPaint = AVehicleData[vid][PaintJob];
  2041. for (new i; i < 14; i++)
  2042. cComponents[i] = AVehicleData[vid][Components][i];
  2043. Col1 = AVehicleData[vid][Color1];
  2044. Col2 = AVehicleData[vid][Color2];
  2045. cx = AVehicleData[vid][SpawnX];
  2046. cy = AVehicleData[vid][SpawnY];
  2047. cz = AVehicleData[vid][SpawnZ];
  2048. crot = AVehicleData[vid][SpawnRot];
  2049. cFuel = INT_GetVehicleFuel(vid);
  2050. Vehicle_Delete(vid, HouseID, CarSlot);
  2051. vid = House_AddVehicle(HouseID, cModel, cPaint, cComponents, Float:cx, Float:cy, Float:cz, Float:crot, Col1, Col2);
  2052. INT_SetVehicleFuel(vid, cFuel);
  2053. return vid;
  2054. }
  2055. */
  2056. Vehicle_Delete(vid, HouseID, CarSlot)
  2057. {
  2058. AHouseData[HouseID][VehicleIDs][CarSlot] = 0;
  2059. DestroyVehicle(vid);
  2060. AVehicleData[vid][Owned] = false;
  2061. AVehicleData[vid][Owner] = 0;
  2062. AVehicleData[vid][Model] = 0;
  2063. AVehicleData[vid][PaintJob] = 0;
  2064. for (new i; i < 14; i++)
  2065. AVehicleData[vid][Components][i] = 0;
  2066. AVehicleData[vid][Color1] = 0;
  2067. AVehicleData[vid][Color2] = 0;
  2068. AVehicleData[vid][SpawnX] = 0.0;
  2069. AVehicleData[vid][SpawnY] = 0.0;
  2070. AVehicleData[vid][SpawnZ] = 0.0;
  2071. AVehicleData[vid][SpawnRot] = 0.0;
  2072. AVehicleData[vid][BelongsToHouse] = 0;
  2073. INT_SetVehicleFuel(vid, -1);
  2074. }
  2075.  
  2076. House_RemoveVehicles(HouseID)
  2077. {
  2078. new vid;
  2079. for (new CarSlot; CarSlot < AHouseData[HouseID][CarSlots]; CarSlot++)
  2080. {
  2081. vid = AHouseData[HouseID][VehicleIDs][CarSlot];
  2082. if (vid != 0)
  2083. {
  2084. Vehicle_Delete(vid, HouseID, CarSlot);
  2085. }
  2086. }
  2087. }
  2088.  
  2089. Player_GetFreeHouseSlot(playerid)
  2090. {
  2091. for (new HouseSlot; HouseSlot < MAX_HOUSESPERPLAYER; HouseSlot++)
  2092. if (APlayerData[playerid][Houses][HouseSlot] == 0)
  2093. return HouseSlot;
  2094. return -1;
  2095. }
  2096.  
  2097. House_PlayerIsOwner(playerid, HouseID)
  2098. {
  2099. for (new HouseSlot; HouseSlot < MAX_HOUSESPERPLAYER; HouseSlot++)
  2100. {
  2101. if (APlayerData[playerid][Houses][HouseSlot] == HouseID)
  2102. return 1;
  2103. }
  2104. return 0;
  2105. }
  2106.  
  2107. House_GetFreeCarSlot(HouseID)
  2108. {
  2109. for (new CarSlot; CarSlot < AHouseData[HouseID][CarSlots]; CarSlot++)
  2110. {
  2111. if (AHouseData[HouseID][VehicleIDs][CarSlot] == 0)
  2112. return CarSlot;
  2113. }
  2114. return -1;
  2115. }
  2116.  
  2117. House_CalcSellPrice(HouseID)
  2118. {
  2119. new SellPrice, NumUpgrades, UpgradePrice;
  2120. if (AHouseData[HouseID][StaticHouse] == false)
  2121. {
  2122. SellPrice = AHouseData[HouseID][HousePrice] / 2;
  2123. NumUpgrades = AHouseData[HouseID][HouseLevel] - 1;
  2124. UpgradePrice = ((AHouseData[HouseID][HousePrice] / 100) * HouseUpgradePercent) * NumUpgrades;
  2125. SellPrice = SellPrice + UpgradePrice;
  2126. return SellPrice;
  2127. }
  2128. else
  2129. {
  2130. SellPrice = AHouseData[HouseID][HousePrice] / 2;
  2131. UpgradePrice = ((AHouseData[HouseID][HousePrice] / 1000) * HouseUpgradePercent) * NumUpgrades;
  2132. SellPrice = SellPrice + UpgradePrice;
  2133. return SellPrice;
  2134. }
  2135. }
  2136.  
  2137. VehicleBuyable_GetIndex(vModel)
  2138. {
  2139. for (new i; i < sizeof(ABuyableVehicles); i++)
  2140. {
  2141. if (ABuyableVehicles[i][CarModel] == vModel)
  2142. return i;
  2143. }
  2144.  
  2145. return -1;
  2146. }
  2147.  
  2148. stock StripNewLine(string[])
  2149. {
  2150. new len = strlen(string);
  2151.  
  2152. if (string[0] == 0) return ;
  2153. if ((string[len - 1] == '\n') || (string[len - 1] == '\r'))
  2154. {
  2155. string[len - 1] = 0;
  2156. if (string[0]==0) return ;
  2157. if ((string[len - 2] == '\n') || (string[len - 2] == '\r'))
  2158. string[len - 2] = 0;
  2159. }
  2160. }
  2161.  
  2162. INT_GetPlayerMoney(playerid)
  2163. {
  2164. new Money;
  2165. Money = CallRemoteFunction("Admin_GetPlayerMoney", "i", playerid);
  2166. if (Money == 0)
  2167. return GetPlayerMoney(playerid);
  2168. else
  2169. return Money;
  2170. }
  2171.  
  2172. INT_GivePlayerMoney(playerid, Money)
  2173. {
  2174. new Success;
  2175. Success = CallRemoteFunction("Admin_GivePlayerMoney", "ii", playerid, Money);
  2176. if (Success == 0)
  2177. GivePlayerMoney(playerid, Money);
  2178. }
  2179.  
  2180. INT_SetVehicleFuel(vehicleid, Fuel)
  2181. {
  2182. CallRemoteFunction("Speedo_SetVehicleFuel", "ii", vehicleid, Fuel);
  2183. }
  2184.  
  2185. INT_GetVehicleFuel(vehicleid)
  2186. {
  2187. return CallRemoteFunction("Speedo_GetVehicleFuel", "i", vehicleid);
  2188. }
  2189.  
  2190. forward Housing_IsVehicleOwned(vehicleid);
  2191. public Housing_IsVehicleOwned(vehicleid)
  2192. {
  2193. if (AVehicleData[vehicleid][Owned] == true)
  2194. return 1;
  2195. else
  2196. return -1;
  2197. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement