#pragma tabsize 0#include <a_samp>#include <zcmd>#include <dutils>#include <sscanf2>#include <streamer>#pragma unused ret_memcpy // ******************************************************************************************************************************// A beállítások módosíthatóak// ******************************************************************************************************************************// Set timer-delay for exiting houses (this timer freezes a player when he exits a house, this allows the game to load the environment// before the player starts to fall, also the player\'s vehicles assigned to the house he exits from, are respawned by this timer)new ExitHouseTimer = 1000;// This allows you to toggle the red houses on the map (bought houses appear on the map as red house icons when this is set to \"true\")// Setting this to \"false\" doesn\'t show a bought house on the mapnew bool:ShowBoughtHouses = false;// Setting this to \"true\" will load all vehicles assigned to houses when the filterscript loads// Setting this to \"false\" will load the vehicles assigned to a house when the house-owner logs in (they\'ll also disappear when he logs out)// Recommended setting for popular servers (with alot of players): \"false\"// In popular servers, the amount of cars could go over the samp-limit (2000), bugging everything when all cars stay loaded// even when the owner of the vehicle is offlinenew bool:LoadCarsDuringFSInit = false;// Setting this to \"true\" will set all houses to have insurance by default// Seting this to \"false\" required players to buy insurance for their vehicles from within the house// If players don\'t have insurance, their vehicle will be gone forever if it\'s destroyed// If players have insurance, they will get their vehicle back when it\'s destroyednew bool:AutomaticInsurance = true;// Default max number of players is set to 500, re-define it to 50#undef MAX_PLAYERS#define MAX_PLAYERS 50// Define housing parameters#define MAX_HOUSES 2000 // Defines the maximum number of houses that can be created#define MAX_HOUSESPERPLAYER 20 // Defines the maximum number of houses that any player can own (useable values: 1 to 20)#define HouseUpgradePercent 100 // Defines the percentage for upgrading a house (house of 10m can be upgraded for 5m when set to 50)#define ParkRange 150.0 // Defines the range for parking the vehicle around the house to which it belongs (default = 150m)// Define path to house-files and player-files#define HouseFile \"PPC_Housing/House%i.ini\"// Define Dialogs#define DialogHouseMenu 5001#define DialogUpgradeHouse 5002#define DialogGoHome 5003#define DialogHouseNameChange 5004#define DialogSellHouse 5005#define DialogBuyCarClass 5006#define DialogBuyCar 5007#define DialogSellCar 5008#define DialogBuyInsurance 5009#define DialogGetCarSelectHouse 5010#define DialogGetCarSelectCar 5011// Define vehicle-classes#define VClassBike 1#define VClassBoat 2#define VClassConvertible 3#define VClassHelicopter 4#define VClassIndustrial 5#define VClassLowRider 6#define VClassOffRoad 7#define VClassPlane 8#define VClassPublic 9#define VClassRCVehicle 10#define VClassSaloons 11#define VClassSportCar 12#define VClassStationCar 13#define VClassTrailer 14#define VClassUnique 15 // ******************************************************************************************************************************// Enums and the array-setups that use them// ******************************************************************************************************************************// Setup a custom type that holds all data for housesenum THouseData{PickupID, // Holds the pickup-id that is linked to this houseText3D:DoorText, // Holds the reference to the 3DText above the house\'s pickupMapIconID, // Holds the ID of the mapicon for the housebool:Owned, // Holds true if the house is owned by somebodyOwner[24], // Holds the name of the owner of the houseHouseName[100], // Holds the name of the house (this will be displayed above the pickup near the house when it\'s owned)Float:HouseX, // Holds the X-coordinate of the pickup for the houseFloat:HouseY, // Holds the Y-coordinate of the pickup for the houseFloat:HouseZ, // Holds the Z-coordinate of the pickup for the houseHouseLevel, // Holds the level of upgrades the house has, and defines which interior to use when you enter the houseHouseMaxLevel, // Holds the maximum level this house can be upgraded toHousePrice, // Holds the price for buying the house, the same price applies when upgrading a house per level (multiplied by HouseUpgradePercent/100)bool:HouseOpened, // Holds true if the house is open to the public (anyone can enter), false means: only the owner can enter itbool:Insurance, // Holds \"true\" if the house has an insurance for the vehicles belonging to this houseVehicleIDs[10], // Holds the vehicle-id\'s of the vehicles linked to this house (max 10 vehicles per house)bool:StaticHouse, // Holds \"true\" if the house is static (cannot be upgraded and has a fixed interior)CarSlots // Holds the amount of carslots available}// Holds the data for all housesnew AHouseData[MAX_HOUSES][THouseData]; // Setup a custom type to hold all data about a vehicleenum TVehicleData{BelongsToHouse, // Holds the HouseID to which this vehicle belongsbool:Owned, // Holds true if the vehicle is owned by somebodyOwner[24], // Holds the name of the owner of the vehicleModel, // Holds the vehicle-model of this vehiclePaintJob, // Holds the ID of the paintjob applied to the vehicleComponents[14], // Holds all Component-ID\'s for all components on the vehicleColor1, // Holds the primary color for this vehicleColor2, // Holds the secundairy color for this vehicleFloat:SpawnX, // Holds the X-coordinate of the parking spot for this vehicleFloat:SpawnY, // Holds the Y-coordinate of the parking spot for this vehicleFloat:SpawnZ, // Holds the Z-coordinate of the parking spot for this vehicleFloat:SpawnRot // Holds the rotation of the parking spot for this vehicle}// Setup an array which holds all data for every vehicle, max 2000 vehicles (server limit)new AVehicleData[2000][TVehicleData]; // Setup all the fields required for the player data (Speedometer TextDraw, current job, ...)enum TPlayerData{Houses[20], // Holds the HouseID\'s of the houses that the player owns (index of the AHouseData array), maximum 20 houses per player CurrentHouse, // Holds the HouseID to track in which house the player currently is (used when accessing the housemenu)DialogBuyVClass,DialogGetCarHouseID}// Create an array to hold the playerdata for every playernew APlayerData[MAX_PLAYERS][TPlayerData]; // Setup a custom type that holds all data about a house-interior (selected when entering a house, based on the house-level)enum THouseInterior{InteriorName[50], // Holds the name of the interiorInteriorID, // Holds the interior-idFloat:IntX, // Holds the X-coordinate of the spawn-location where you enter the houseFloat:IntY, // Holds the Y-coordinate of the spawn-location where you enter the houseFloat:IntZ // Holds the Z-coordinate of the spawn-location where you enter the house}// Holds the data for all interiors for houses (each house-level has it\'s own interior)new AHouseInteriors[][THouseInterior] ={{\"Dummy\", 0, 0.0, 0.0, 0.0}, // Dummy interior (Level 0), as the house-level starts at 1{\"Small motel room\", 10, 2262.83, -1137.71, 1050.63}, // Level 1{\"Small house\", 2, 2467.36, -1698.38, 1013.51}, // Level 2{\"Small house 2\", 1, 223.00, 1289.26, 1082.20}, // Level 3{\"Medium house\", 10, 2260.76, -1210.45, 1049.02}, // Level 4{\"Medium house 2\", 8, 2365.42, -1131.85, 1050.88}, // Level 5{\"Duplex house\", 12, 2324.33, -1144.79, 1050.71}, // Level 6{\"Big house\", 15, 295.14, 1474.47, 1080.52}, // Level 7{\"Big duplex house\", 3, 235.50, 1189.17, 1080.34}, // Level 8{\"Huge house\", 7, 225.63, 1022.48, 1084.07}, // Level 9{\"Mansion\", 5, 1299.14, -794.77, 1084.00} // Level 10}; // Setup a custom type that holds all data about a buyable vehicleenum TBuyableVehicle{CarName[50], // Holds the name of the vehicleVehicleClass, // Holds the ID of the vehicleclassCarModel, // Holds the model-ID of the vehiclePrice // Holds the price for the vehicle (renting it will be 10% of this price)}new ABuyableVehicles[][TBuyableVehicle] ={{\"Admiral\", VClassSaloons, 445, 50000},{\"Alpha\", VClassSportCar, 602, 50000},{\"Ambulance\", VClassPublic, 416, 50000},{\"Andromada\", VClassPlane, 592, 50000},{\"Article Trailer\", VClassTrailer, 591, 50000},// {\"AT400\", VClassPlane, 577, 50000},{\"Baggage\", VClassUnique, 485, 50000},{\"Baggage Trailer A\", VClassTrailer, 606, 50000},{\"Baggage Trailer B\", VClassTrailer, 607, 50000},{\"Bandito\", VClassOffRoad, 568, 50000},{\"Banshee\", VClassSportCar, 429, 50000},{\"Barracks\", VClassPublic, 433, 50000},{\"Beagle\", VClassPlane, 511, 50000},{\"Benson\", VClassIndustrial, 499, 50000},{\"Berkley\'s RC Van\", VClassIndustrial, 459, 50000},{\"BF Injection\", VClassOffRoad, 424, 50000},{\"BF-400\", VClassBike, 581, 50000},{\"Bike\", VClassBike, 509, 50000},{\"Blade\", VClassLowRider, 536, 50000},{\"Blista Compact\", VClassSportCar, 496, 50000},{\"Bloodring Banger\", VClassSaloons, 504, 50000},{\"BMX\", VClassBike, 481, 50000},{\"Bobcat\", VClassIndustrial, 422, 50000},{\"Boxville 1\", VClassIndustrial, 498, 50000},{\"Boxville 2\", VClassIndustrial, 609, 50000},{\"Bravura\", VClassSaloons, 401, 50000},{\"Broadway\", VClassLowRider, 575, 50000},// {\"Brownstreak (train)\", VClassUnique, 538, 50000},{\"Buccaneer\", VClassSaloons, 518, 50000},{\"Buffalo\", VClassSportCar, 402, 50000},{\"Bullet\", VClassSportCar, 541, 50000},{\"Burrito\", VClassIndustrial, 482, 50000},{\"Bus\", VClassPublic, 431, 50000},{\"Cabbie\", VClassPublic, 438, 50000},{\"Caddy\", VClassUnique, 457, 50000},{\"Cadrona\", VClassSaloons, 527, 50000},{\"Camper\", VClassUnique, 483, 50000},{\"Cargo Trailer\", VClassTrailer, 435, 50000},{\"Cargobob\", VClassHelicopter, 548, 50000},{\"Cement Truck\", VClassIndustrial, 524, 50000},{\"Cheetah\", VClassSportCar, 415, 50000},{\"Clover\", VClassSaloons, 542, 50000},{\"Club\", VClassSportCar, 589, 50000},{\"Coach\", VClassPublic, 437, 50000},{\"Coastguard\", VClassBoat, 472, 50000},{\"Combine Harvester\", VClassUnique, 532, 50000},{\"Comet\", VClassConvertible, 480, 50000},{\"Cropduster\", VClassPlane, 512, 50000},{\"DFT-30\", VClassIndustrial, 578, 50000},{\"Dinghy\", VClassBoat, 473, 50000},{\"Dodo\", VClassPlane, 593, 50000},{\"Dozer\", VClassUnique, 486, 50000},{\"Dumper\", VClassUnique, 406, 50000},{\"Dune\", VClassOffRoad, 573, 50000},{\"Elegant\", VClassSaloons, 507, 50000},{\"Elegy\", VClassSaloons, 562, 50000},{\"Emperor\", VClassSaloons, 585, 50000},{\"Enforcer\", VClassPublic, 427, 50000},{\"Esperanto\", VClassSaloons, 419, 50000},{\"Euros\", VClassSportCar, 587, 50000},{\"Faggio\", VClassBike, 462, 50000},{\"Farm Trailer\", VClassTrailer, 610, 50000},{\"FBI Rancher\", VClassPublic, 490, 50000},{\"FBI Truck\", VClassPublic, 528, 50000},{\"FCR-900\", VClassBike, 521, 50000},{\"Feltzer\", VClassConvertible, 533, 50000},{\"Firetruck\", VClassPublic, 407, 50000},{\"Firetruck LA\", VClassPublic, 544, 50000},{\"Flash\", VClassSportCar, 565, 50000},{\"Flatbed\", VClassIndustrial, 455, 50000},{\"Fluids Trailer\", VClassTrailer, 584, 50000},{\"Forklift\", VClassUnique, 530, 50000},{\"Fortune\", VClassSaloons, 526, 50000},{\"Freeway\", VClassBike, 463, 50000},// {\"Freight (train)\", VClassUnique, 537, 50000},// {\"Freight Box Trailer (train)\", VClassTrailer, 590, 50000},// {\"Freight Flat Trailer (train)\", VClassTrailer, 569, 50000},{\"Glendale\", VClassSaloons, 466, 50000},{\"Glendale Shit\", VClassSaloons, 604, 50000},{\"Greenwood\", VClassSaloons, 492, 50000},{\"Hermes\", VClassSaloons, 474, 50000},{\"Hotdog\", VClassUnique, 588, 50000},{\"Hotknife\", VClassUnique, 434, 50000},{\"Hotring Racer 1\", VClassSportCar, 494, 50000},{\"Hotring Racer 2\", VClassSportCar, 502, 50000},{\"Hotring Racer 3\", VClassSportCar, 503, 50000},{\"HPV1000\", VClassPublic, 523, 50000},{\"Hunter\", VClassHelicopter, 425, 50000},{\"Huntley\", VClassOffRoad, 579, 50000},{\"Hustler\", VClassUnique, 545, 50000},{\"Hydra\", VClassPlane, 520, 50000},{\"Infernus\", VClassSportCar, 411, 50000},{\"Intruder\", VClassSaloons, 546, 50000},{\"Jester\", VClassSportCar, 559, 50000},{\"Jetmax\", VClassBoat, 493, 50000},{\"Journey\", VClassUnique, 508, 50000},{\"Kart\", VClassUnique, 571, 50000},{\"Landstalker\", VClassOffRoad, 400, 50000},{\"Launch\", VClassBoat, 595, 50000},{\"Leviathan\", VClassHelicopter, 417, 50000},{\"Linerunner\", VClassIndustrial, 403, 50000},{\"Majestic\", VClassSaloons, 517, 50000},{\"Manana\", VClassSaloons, 410, 50000},{\"Marquis\", VClassBoat, 484, 50000},{\"Maverick\", VClassHelicopter, 487, 50000},{\"Merit\", VClassSaloons, 551, 50000},{\"Mesa\", VClassOffRoad, 500, 50000},{\"Monster\", VClassOffRoad, 444, 50000},{\"Monster A\", VClassOffRoad, 556, 50000},{\"Monster B\", VClassOffRoad, 557, 50000},{\"Moonbeam\", VClassStationCar, 418, 50000},{\"Mountain Bike\", VClassBike, 510, 50000},{\"Mower\", VClassUnique, 572, 50000},{\"Mr Whoopee\", VClassUnique, 423, 50000},{\"Mule\", VClassIndustrial, 414, 50000},{\"Nebula\", VClassSaloons, 516, 50000},{\"Nevada\", VClassPlane, 553, 50000},{\"Newsvan\", VClassIndustrial, 582, 50000},{\"NRG-500\", VClassBike, 522, 50000},{\"Oceanic\", VClassSaloons, 467, 50000},{\"Ore Trailer\", VClassTrailer, 450, 50000},{\"Packer\", VClassIndustrial, 443, 50000},{\"Patriot\", VClassOffRoad, 470, 50000},{\"PCJ-600\", VClassBike, 461, 50000},{\"Perenniel\", VClassStationCar, 404, 50000},{\"Phoenix\", VClassSportCar, 603, 50000},{\"Picador\", VClassIndustrial, 600, 50000},{\"Pizzaboy\", VClassBike, 448, 50000},{\"Police Car (LSPD)\", VClassPublic, 596, 50000},{\"Police Car (LVPD)\", VClassPublic, 598, 50000},{\"Police Car (SFPD)\", VClassPublic, 597, 50000},{\"Police Maverick\", VClassHelicopter, 497, 50000},{\"Police Ranger\", VClassPublic, 599, 50000},{\"Pony\", VClassIndustrial, 413, 50000},{\"Predator\", VClassBoat, 430, 50000},{\"Premier\", VClassSaloons, 426, 50000},{\"Previon\", VClassSaloons, 436, 50000},{\"Primo\", VClassSaloons, 547, 50000},{\"Quad\", VClassBike, 471, 50000},{\"Raindance\", VClassHelicopter, 563, 50000},{\"Rancher 1\", VClassOffRoad, 489, 50000},{\"Rancher 2\", VClassOffRoad, 505, 50000},// {\"RC Bandit\", VClassRCVehicle, 441, 50000},// {\"RC Baron\", VClassRCVehicle, 464, 50000},// {\"RC Cam\", VClassRCVehicle, 594, 50000},// {\"RC Goblin\", VClassRCVehicle, 501, 50000},// {\"RC Raider\", VClassRCVehicle, 465, 50000},// {\"RC Tiger\", VClassRCVehicle, 564, 50000},{\"Reefer\", VClassBoat, 453, 50000},{\"Regina\", VClassStationCar, 479, 50000},{\"Remington\", VClassLowRider, 534, 50000},{\"Rhino\", VClassPublic, 432, 50000},{\"Roadtrain\", VClassIndustrial, 515, 50000},{\"Romero\", VClassUnique, 442, 50000},{\"Rumpo\", VClassIndustrial, 440, 50000},{\"Rustler\", VClassPlane, 476, 50000},{\"Sabre\", VClassSportCar, 475, 50000},{\"Sadler\", VClassIndustrial, 543, 50000},{\"Sadler Shit\", VClassIndustrial, 605, 50000},{\"SAN News Maverick\", VClassHelicopter, 488, 50000},{\"Sanchez\", VClassBike, 468, 50000},{\"Sandking\", VClassOffRoad, 495, 50000},{\"Savanna\", VClassLowRider, 567, 50000},{\"Seasparrow\", VClassHelicopter, 447, 50000},{\"Securicar\", VClassUnique, 428, 50000},{\"Sentinel\", VClassSaloons, 405, 50000},{\"Shamal\", VClassPlane, 519, 50000},{\"Skimmer\", VClassPlane, 460, 50000},{\"Slamvan\", VClassLowRider, 535, 50000},{\"Solair\", VClassStationCar, 458, 50000},{\"Sparrow\", VClassHelicopter, 469, 50000},{\"Speeder\", VClassBoat, 452, 50000},{\"Squallo\", VClassBoat, 446, 50000},{\"Stafford\", VClassSaloons, 580, 50000},{\"Stallion\", VClassConvertible, 439, 50000},{\"Stratum\", VClassStationCar, 561, 50000},// {\"Streak Trailer (train)\", VClassTrailer, 570, 50000},{\"Stretch\", VClassUnique, 409, 50000},{\"Stuntplane\", VClassPlane, 513, 50000},{\"Sultan\", VClassSaloons, 560, 50000},{\"Sunrise\", VClassSaloons, 550, 50000},{\"Super GT\", VClassSportCar, 506, 50000},{\"S.W.A.T.\", VClassPublic, 601, 50000},{\"Sweeper\", VClassUnique, 574, 50000},{\"Tahoma\", VClassLowRider, 566, 50000},{\"Tampa\", VClassSaloons, 549, 50000},{\"Tanker\", VClassIndustrial, 514, 50000},{\"Taxi\", VClassPublic, 420, 50000},{\"Tornado\", VClassLowRider, 576, 50000},{\"Towtruck\", VClassUnique, 525, 50000},{\"Tractor\", VClassIndustrial, 531, 50000},// {\"Tram\", VClassUnique, 449, 50000},{\"Trashmaster\", VClassIndustrial, 408, 50000},{\"Tropic\", VClassBoat, 454, 50000},{\"Tug\", VClassUnique, 583, 50000},{\"Tug Stairs Trailer\", VClassTrailer, 608, 50000},{\"Turismo\", VClassSportCar, 451, 50000},{\"Uranus\", VClassSportCar, 558, 50000},{\"Utility Trailer\", VClassTrailer, 611, 50000},{\"Utility Van\", VClassIndustrial, 552, 50000},{\"Vincent\", VClassSaloons, 540, 50000},{\"Virgo\", VClassSaloons, 491, 50000},{\"Voodoo\", VClassLowRider, 412, 50000},{\"Vortex\", VClassUnique, 539, 50000},{\"Walton\", VClassIndustrial, 478, 50000},{\"Washington\", VClassSaloons, 421, 50000},{\"Wayfarer\", VClassBike, 586, 50000},{\"Willard\", VClassSaloons, 529, 50000},{\"Windsor\", VClassConvertible, 555, 50000}, {\"Yankee\", VClassIndustrial, 456, 50000},{\"Yosemite\", VClassIndustrial, 554, 50000},{\"ZR-350\", VClassSportCar, 477, 50000}}; // Setup an array that holds all prices for vehicle-componentsnew AVehicleModPrices[] ={400, // ID 1000, Spoiler Pro Certain Transfender cars550, // ID 1001, Spoiler Win Certain Transfender cars200, // ID 1002, Spoiler Drag Certain Transfender cars250, // ID 1003, Spoiler Alpha Certain Transfender cars100, // ID 1004, Hood Champ Scoop Certain Transfender cars150, // ID 1005, Hood Fury Scoop Certain Transfender cars80, // ID 1006, Roof Roof Scoop Certain Transfender cars500, // ID 1007, Sideskirt Right Sideskirt Certain Transfender cars500, // ID 1008, Nitro 5 times Most cars, Most planes and Most Helicopters200, // ID 1009, Nitro 2 times Most cars, Most planes and Most Helicopters1000, // ID 1010, Nitro 10 times Most cars, Most planes and Most Helicopters220, // ID 1011, Hood Race Scoop Certain Transfender cars250, // ID 1012, Hood Worx Scoop Certain Transfender cars100, // ID 1013, Lamps Round Fog Certain Transfender cars400, // ID 1014, Spoiler Champ Certain Transfender cars500, // ID 1015, Spoiler Race Certain Transfender cars200, // ID 1016, Spoiler Worx Certain Transfender cars500, // ID 1017, Sideskirt Left Sideskirt Certain Transfender cars350, // ID 1018, Exhaust Upswept Most cars300, // ID 1019, Exhaust Twin Most cars250, // ID 1020, Exhaust Large Most cars200, // ID 1021, Exhaust Medium Most cars150, // ID 1022, Exhaust Small Most cars350, // ID 1023, Spoiler Fury Certain Transfender cars50, // ID 1024, Lamps Square Fog Certain Transfender cars1000, // ID 1025, Wheels Offroad Certain Transfender cars480, // ID 1026, Sideskirt Right Alien Sideskirt Sultan480, // ID 1027, Sideskirt Left Alien Sideskirt Sultan770, // ID 1028, Exhaust Alien Sultan680, // ID 1029, Exhaust X-Flow Sultan370, // ID 1030, Sideskirt Left X-Flow Sideskirt Sultan370, // ID 1031, Sideskirt Right X-Flow Sideskirt Sultan170, // ID 1032, Roof Alien Roof Vent Sultan120, // ID 1033, Roof X-Flow Roof Vent Sultan790, // ID 1034, Exhaust Alien Elegy150, // ID 1035, Roof X-Flow Roof Vent Elegy500, // ID 1036, SideSkirt Right Alien Sideskirt Elegy690, // ID 1037, Exhaust X-Flow Elegy190, // ID 1038, Roof Alien Roof Vent Elegy390, // ID 1039, SideSkirt Right X-Flow Sideskirt Elegy500, // ID 1040, SideSkirt Left Alien Sideskirt Elegy390, // ID 1041, SideSkirt Right X-Flow Sideskirt Elegy1000, // ID 1042, SideSkirt Right Chrome Sideskirt Broadway500, // ID 1043, Exhaust Slamin Broadway500, // ID 1044, Exhaust Chrome Broadway510, // ID 1045, Exhaust X-Flow Flash710, // ID 1046, Exhaust Alien Flash670, // ID 1047, SideSkirt Right Alien Sideskirt Flash530, // ID 1048, SideSkirt Right X-Flow Sideskirt Flash810, // ID 1049, Spoiler Alien Flash620, // ID 1050, Spoiler X-Flow Flash670, // ID 1051, SideSkirt Left Alien Sideskirt Flash530, // ID 1052, SideSkirt Left X-Flow Sideskirt Flash130, // ID 1053, Roof X-Flow Flash210, // ID 1054, Roof Alien Flash230, // ID 1055, Roof Alien Stratum520, // ID 1056, Sideskirt Right Alien Sideskirt Stratum430, // ID 1057, Sideskirt Right X-Flow Sideskirt Stratum620, // ID 1058, Spoiler Alien Stratum720, // ID 1059, Exhaust X-Flow Stratum530, // ID 1060, Spoiler X-Flow Stratum180, // ID 1061, Roof X-Flow Stratum520, // ID 1062, Sideskirt Left Alien Sideskirt Stratum430, // ID 1063, Sideskirt Left X-Flow Sideskirt Stratum830, // ID 1064, Exhaust Alien Stratum850, // ID 1065, Exhaust Alien Jester750, // ID 1066, Exhaust X-Flow Jester250, // ID 1067, Roof Alien Jester200, // ID 1068, Roof X-Flow Jester550, // ID 1069, Sideskirt Right Alien Sideskirt Jester450, // ID 1070, Sideskirt Right X-Flow Sideskirt Jester550, // ID 1071, Sideskirt Left Alien Sideskirt Jester450, // ID 1072, Sideskirt Left X-Flow Sideskirt Jester1100, // ID 1073, Wheels Shadow Most cars1030, // ID 1074, Wheels Mega Most cars980, // ID 1075, Wheels Rimshine Most cars1560, // ID 1076, Wheels Wires Most cars1620, // ID 1077, Wheels Classic Most cars1200, // ID 1078, Wheels Twist Most cars1030, // ID 1079, Wheels Cutter Most cars900, // ID 1080, Wheels Switch Most cars1230, // ID 1081, Wheels Grove Most cars820, // ID 1082, Wheels Import Most cars1560, // ID 1083, Wheels Dollar Most cars1350, // ID 1084, Wheels Trance Most cars770, // ID 1085, Wheels Atomic Most cars100, // ID 1086, Stereo Stereo Most cars1500, // ID 1087, Hydraulics Hydraulics Most cars150, // ID 1088, Roof Alien Uranus650, // ID 1089, Exhaust X-Flow Uranus450, // ID 1090, Sideskirt Right Alien Sideskirt Uranus100, // ID 1091, Roof X-Flow Uranus750, // ID 1092, Exhaust Alien Uranus350, // ID 1093, Sideskirt Right X-Flow Sideskirt Uranus450, // ID 1094, Sideskirt Left Alien Sideskirt Uranus350, // ID 1095, Sideskirt Right X-Flow Sideskirt Uranus1000, // ID 1096, Wheels Ahab Most cars620, // ID 1097, Wheels Virtual Most cars1140, // ID 1098, Wheels Access Most cars1000, // ID 1099, Sideskirt Left Chrome Sideskirt Broadway940, // ID 1100, Bullbar Chrome Grill Remington780, // ID 1101, Sideskirt Left `Chrome Flames` Sideskirt Remington830, // ID 1102, Sideskirt Left `Chrome Strip` Sideskirt Savanna3250, // ID 1103, Roof Convertible Blade1610, // ID 1104, Exhaust Chrome Blade1540, // ID 1105, Exhaust Slamin Blade780, // ID 1106, Sideskirt Right `Chrome Arches` Remington780, // ID 1107, Sideskirt Left `Chrome Strip` Sideskirt Blade780, // ID 1108, Sideskirt Right `Chrome Strip` Sideskirt Blade1610, // ID 1109, Rear Bullbars Chrome Slamvan1540, // ID 1110, Rear Bullbars Slamin Slamvan55, // ID 1111, Front Sign? Little Sign? Slamvan 55, // ID 1112, Front Sign? Little Sign? Slamvan 3340, // ID 1113, Exhaust Chrome Slamvan3250, // ID 1114, Exhaust Slamin Slamvan2130, // ID 1115, Front Bullbars Chrome Slamvan2050, // ID 1116, Front Bullbars Slamin Slamvan2040, // ID 1117, Front Bumper Chrome Slamvan780, // ID 1118, Sideskirt Right `Chrome Trim` Sideskirt Slamvan940, // ID 1119, Sideskirt Right `Wheelcovers` Sideskirt Slamvan780, // ID 1120, Sideskirt Left `Chrome Trim` Sideskirt Slamvan940, // ID 1121, Sideskirt Left `Wheelcovers` Sideskirt Slamvan780, // ID 1122, Sideskirt Right `Chrome Flames` Sideskirt Remington860, // ID 1123, Bullbars Bullbar Chrome Bars Remington780, // ID 1124, Sideskirt Left `Chrome Arches` Sideskirt Remington1120, // ID 1125, Bullbars Bullbar Chrome Lights Remington3340, // ID 1126, Exhaust Chrome Exhaust Remington3250, // ID 1127, Exhaust Slamin Exhaust Remington3340, // ID 1128, Roof Vinyl Hardtop Blade1650, // ID 1129, Exhaust Chrome Savanna3380, // ID 1130, Roof Hardtop Savanna3290, // ID 1131, Roof Softtop Savanna1590, // ID 1132, Exhaust Slamin Savanna830, // ID 1133, Sideskirt Right `Chrome Strip` Sideskirt Savanna800, // ID 1134, SideSkirt Right `Chrome Strip` Sideskirt Tornado1500, // ID 1135, Exhaust Slamin Tornado1000, // ID 1136, Exhaust Chrome Tornado800, // ID 1137, Sideskirt Left `Chrome Strip` Sideskirt Tornado580, // ID 1138, Spoiler Alien Sultan470, // ID 1139, Spoiler X-Flow Sultan870, // ID 1140, Rear Bumper X-Flow Sultan980, // ID 1141, Rear Bumper Alien Sultan150, // ID 1142, Vents Left Oval Vents Certain Transfender Cars150, // ID 1143, Vents Right Oval Vents Certain Transfender Cars100, // ID 1144, Vents Left Square Vents Certain Transfender Cars100, // ID 1145, Vents Right Square Vents Certain Transfender Cars490, // ID 1146, Spoiler X-Flow Elegy600, // ID 1147, Spoiler Alien Elegy890, // ID 1148, Rear Bumper X-Flow Elegy1000, // ID 1149, Rear Bumper Alien Elegy1090, // ID 1150, Rear Bumper Alien Flash840, // ID 1151, Rear Bumper X-Flow Flash910, // ID 1152, Front Bumper X-Flow Flash1200, // ID 1153, Front Bumper Alien Flash1030, // ID 1154, Rear Bumper Alien Stratum1030, // ID 1155, Front Bumper Alien Stratum920, // ID 1156, Rear Bumper X-Flow Stratum930, // ID 1157, Front Bumper X-Flow Stratum550, // ID 1158, Spoiler X-Flow Jester1050, // ID 1159, Rear Bumper Alien Jester1050, // ID 1160, Front Bumper Alien Jester950, // ID 1161, Rear Bumper X-Flow Jester650, // ID 1162, Spoiler Alien Jester450, // ID 1163, Spoiler X-Flow Uranus550, // ID 1164, Spoiler Alien Uranus850, // ID 1165, Front Bumper X-Flow Uranus950, // ID 1166, Front Bumper Alien Uranus850, // ID 1167, Rear Bumper X-Flow Uranus950, // ID 1168, Rear Bumper Alien Uranus970, // ID 1169, Front Bumper Alien Sultan880, // ID 1170, Front Bumper X-Flow Sultan990, // ID 1171, Front Bumper Alien Elegy900, // ID 1172, Front Bumper X-Flow Elegy950, // ID 1173, Front Bumper X-Flow Jester1000, // ID 1174, Front Bumper Chrome Broadway900, // ID 1175, Front Bumper Slamin Broadway1000, // ID 1176, Rear Bumper Chrome Broadway900, // ID 1177, Rear Bumper Slamin Broadway2050, // ID 1178, Rear Bumper Slamin Remington2150, // ID 1179, Front Bumper Chrome Remington2130, // ID 1180, Rear Bumper Chrome Remington2050, // ID 1181, Front Bumper Slamin Blade2130, // ID 1182, Front Bumper Chrome Blade2040, // ID 1183, Rear Bumper Slamin Blade2150, // ID 1184, Rear Bumper Chrome Blade2040, // ID 1185, Front Bumper Slamin Remington2095, // ID 1186, Rear Bumper Slamin Savanna2175, // ID 1187, Rear Bumper Chrome Savanna2080, // ID 1188, Front Bumper Slamin Savanna2200, // ID 1189, Front Bumper Chrome Savanna1200, // ID 1190, Front Bumper Slamin Tornado1040, // ID 1191, Front Bumper Chrome Tornado940, // ID 1192, Rear Bumper Chrome Tornado1100, // ID 1193 Rear Bumper Slamin Tornado}; // These variables are used when starting the script and debugging purposesnew TotalHouses; // ******************************************************************************************************************************// Callbacks// ******************************************************************************************************************************// The main function (used only once when the server loads)main(){}// This callback gets called when the server initializes the filterscriptpublic OnFilterScriptInit(){// Loop through all houses and try to load them (HouseID 0 isn\'t used)for (new HouseID = 1; HouseID < MAX_HOUSES; HouseID++){ // Try to load the house-fileHouseFile_Load(HouseID);// Load housecars too if chosen to do soif (LoadCarsDuringFSInit == true) HouseFile_LoadCars(HouseID);} return 1;}// This callback gets called when a player connects to the serverpublic OnPlayerConnect(playerid){// Setup local variablesnew HouseID, HouseSlot, Name[24];// Get the player\'s nameGetPlayerName(playerid, Name, sizeof(Name));// Loop through all houses to find the ones which belong to this playerfor (HouseID = 1; HouseID < MAX_HOUSES; HouseID++){// Check if the house existsif (IsValidDynamicPickup(AHouseData[HouseID][PickupID])){ // Check if the house is owned if (AHouseData[HouseID][Owned] == true) { // Check if the player is the owner of the house if (strcmp(AHouseData[HouseID][Owner], Name, false) == 0) { // Add the HouseID to the player\'s account for faster reference later on APlayerData[playerid][Houses][HouseSlot] = HouseID; // Load housecars if they weren\'t loaded at FilterscriptInit if (LoadCarsDuringFSInit == false) HouseFile_LoadCars(HouseID); // Select the next HouseSlot HouseSlot++; } }}}return 1;}// This callback gets called when a player disconnects from the serverpublic OnPlayerDisconnect(playerid, reason){// Setup local variablesnew HouseSlot;// Loop through all Houses the player ownsfor (HouseSlot = 0; HouseSlot < MAX_HOUSESPERPLAYER; HouseSlot++){// Check if the house existsif (APlayerData[playerid][Houses][HouseSlot] != 0){ // Save the housefile HouseFile_Save(APlayerData[playerid][Houses][HouseSlot]);}}// Unload housecars if they were loaded when the owner logged inif (LoadCarsDuringFSInit == false){// Loop through all Houses the player ownsfor (HouseSlot = 0; HouseSlot < MAX_HOUSESPERPLAYER; HouseSlot++){ // Check if the house exists if (APlayerData[playerid][Houses][HouseSlot] != 0) { // Unload all vehicles assigned to this house House_RemoveVehicles(APlayerData[playerid][Houses][HouseSlot]); }}}// Clear all data for this player// Loop through all Houses the player ownsfor (HouseSlot = 0; HouseSlot < MAX_HOUSESPERPLAYER; HouseSlot++){ // Clear the HouseID\'sAPlayerData[playerid][Houses][HouseSlot] = 0;}APlayerData[playerid][CurrentHouse] = 0;APlayerData[playerid][DialogBuyVClass] = 0;APlayerData[playerid][DialogGetCarHouseID] = 0;return 1;}// This callback gets called when a player interacts with a dialogpublic OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]){// Select the proper dialog to processswitch (dialogid){case DialogHouseMenu: Dialog_HouseMenu(playerid, response, listitem); // Process the main housemenucase DialogUpgradeHouse: Dialog_UpgradeHouse(playerid, response, listitem); // Process the house-upgrade menucase DialogGoHome: Dialog_GoHome(playerid, response, listitem); // Port to one of your housescase DialogHouseNameChange: Dialog_ChangeHouseName(playerid, response, inputtext); // Change the name of your housecase DialogSellHouse: Dialog_SellHouse(playerid, response); // Sell the housecase DialogBuyCarClass: Dialog_BuyCarClass(playerid, response, listitem); // The player chose a vehicleclass from where he can buy a vehiclecase DialogBuyCar: Dialog_BuyCar(playerid, response, listitem); // The player chose a vehicle from the list of vehicles from the vehicleclass he chose beforecase DialogSellCar: Dialog_SellCar(playerid, response, listitem);case DialogBuyInsurance: Dialog_BuyInsurance(playerid, response);case DialogGetCarSelectHouse: Dialog_GetCarSelectHouse(playerid, response, listitem);case DialogGetCarSelectCar: Dialog_GetCarSelectCar(playerid, response, listitem);} return 1;}// This callback gets called when a player spawns somewherepublic OnPlayerSpawn(playerid){// Reset the HouseID where the player is locatedAPlayerData[playerid][CurrentHouse] = 0;return 1;}// This callback gets called whenever a player diespublic OnPlayerDeath(playerid, killerid, reason){// Reset the HouseID where the player is locatedAPlayerData[playerid][CurrentHouse] = 0;return 1;}// This callback gets called when the player is selecting a class (but hasn\'t clicked \"Spawn\" yet)public OnPlayerRequestClass(playerid, classid){// Reset the HouseID where the player is locatedAPlayerData[playerid][CurrentHouse] = 0;return 1;}// This callback is called when the player attempts to spawn via class-selectionpublic OnPlayerRequestSpawn(playerid){// Reset the HouseID where the player is locatedAPlayerData[playerid][CurrentHouse] = 0; return 1;}// This callback gets called when a vehicle respawns at it\'s spawn-location (where it was created)public OnVehicleSpawn(vehicleid){// Only use this for house-vehiclesif (AVehicleData[vehicleid][Owned] == true){// Re-apply the paintjob (if any was applied)if (AVehicleData[vehicleid][PaintJob] != 0){ // Re-apply the paintjob ChangeVehiclePaintjob(vehicleid, AVehicleData[vehicleid][PaintJob] - 1);}// Also update the car-colorChangeVehicleColor(vehicleid, AVehicleData[vehicleid][Color1], AVehicleData[vehicleid][Color2]);// Re-add all components that were installed (if they were there)for (new i; i < 14; i++){ // Remove all mods from the vehicle (all added mods applied by hackers will hopefully be removed this way when the vehicle respawns) RemoveVehicleComponent(vehicleid, GetVehicleComponentInSlot(vehicleid, i)); // Check if the componentslot has a valid component-id if (AVehicleData[vehicleid][Components] != 0) AddVehicleComponent(vehicleid, AVehicleData[vehicleid][Components]); // Add the component to the vehicle}} return 1;}// This callback is called when the vehicle leaves a mod shoppublic OnVehicleRespray(playerid, vehicleid, color1, color2){// Only use this for house-vehiclesif (AVehicleData[vehicleid][Owned] == true){// Let the player pay $150 for changing the color (if they have been changed)if ((AVehicleData[vehicleid][Color1] != color1) || (AVehicleData[vehicleid][Color2] != color2)) INT_GivePlayerMoney(playerid, -150);// Save the colorsAVehicleData[vehicleid][Color1] = color1;AVehicleData[vehicleid][Color2] = color2;// If the primary color is black, remove the paintjobif (color1 == 0) AVehicleData[vehicleid][PaintJob] = 0;}return 1;}// This callback gets called whenever a player mods his vehiclepublic OnVehicleMod(playerid, vehicleid, componentid){// Only use this for house-vehiclesif (AVehicleData[vehicleid][Owned] == true){// When the player changes a component of his vehicle, reduce the price of the component from the player\'s moneyINT_GivePlayerMoney(playerid, -AVehicleModPrices[componentid - 1000]);// Store the component in the AVehicleData arrayAVehicleData[vehicleid][Components][GetVehicleComponentType(componentid)] = componentid;}return 1;}// This callback gets called whenever a player VIEWS at a paintjob in a mod garage (viewing automatically applies it)public OnVehiclePaintjob(playerid, vehicleid, paintjobid){// Only use this for house-vehiclesif (AVehicleData[vehicleid][Owned] == true){// Store the paintjobid for the vehicle (add 1 to the value, otherwise checking for an applied paintjob is difficult) AVehicleData[vehicleid][PaintJob] = paintjobid + 1;}return 1;}// This callback gets called whenever a vehicle enters the water or is destroyed (explodes)public OnVehicleDeath(vehicleid){// Setup local variablesnew HouseID, CarSlot;// Only use this for house-vehiclesif (AVehicleData[vehicleid][Owned] == true){// Get the houseid to which this vehicle belongsHouseID = AVehicleData[vehicleid][belongsToHouse];// If automatic insurance has been turned off, check if the vehicle\'s house has insurance for the vehicleif (AutomaticInsurance == false){ // Check if this vehicle belongs to a house if (HouseID != 0) { // If the house doesn\'t have insurance for it\'s vehicles if (AHouseData[HouseID][insurance] == false) { // Find the CarSlot where this vehicle is stored for (CarSlot = 0; CarSlot < 10; CarSlot++) { // Check if the vehicle is stored in this carslot if (AHouseData[HouseID][VehicleIDs][CarSlot] == vehicleid) break; // Stop searching, because CarSlot now hold the carslot of the vehicle where it\'s stored } // Delete the vehicle, clear the data and remove it from the house it belongs to Vehicle_Delete(vehicleid, HouseID, CarSlot); // Save the house (and linked vehicles) HouseFile_Save(HouseID); } }}}return 1;}// This callback gets called when the player changes statepublic OnPlayerStateChange(playerid,newstate,oldstate){// Setup local variablesnew vid, Name[24], Msg[128], engine, lights, alarm, doors, bonnet, boot, objective;// Check if the player became the driver of a vehicleif (newstate == PLAYER_STATE_DRIVER){// Get the ID of the player\'s vehiclevid = GetPlayerVehicleID(playerid);// Get the player\'s nameGetPlayerName(playerid, Name, sizeof(Name));// Check if the vehicle is ownedif (AVehicleData[vid][Owned] == true){ // Check if the vehicle is owned by somebody else (strcmp will not be 0) if (strcmp(AVehicleData[vid][Owner], Name, false) != 0) { // Force the player out of the vehicle RemovePlayerFromVehicle(playerid); // Turn off the lights and engine GetVehicleParamsEx(vid, engine, lights, alarm, doors, bonnet, boot, objective); SetVehicleParamsEx(vid, 0, 0, alarm, doors, bonnet, boot, objective); // Let the player know he cannot use somebody else\'s vehicle format(Msg, 128, \"{FF0000}Nem tudod használni a jármûvet, {FF0000}tulajdonosa \\\"{FFFF00}%s{FF0000}\\\"\", AVehicleData[vid][Owner]); SendClientMessage(playerid, 0xFFFFFFFF, Msg); }}}return 1;} // ******************************************************************************************************************************// Commands// ******************************************************************************************************************************// Lets the player add new houses (a house that can be upgraded and where the houselevel determines the amount of carslots)COMMAND:createhouse(playerid, params[]){// Setup local variablesnew HPrice, MaxLevel, HouseID;// If a player hasn\'t logged in properly, he cannot use this commandif (INT_IsPlayerLoggedIn(playerid) == 0) return 0;// If the player has an insufficient admin-level (he needs level 5 or RCON admin), exit the command// returning \"SERVER: Unknown command\" to the playerif (INT_CheckPlayerAdminLevel(playerid, 5) == 0) return 0;// Check if the player isn\'t inside a vehicle (the admin-player must be on foot to use this command)if (GetPlayerVehicleSeat(playerid) == -1){if (sscanf(params, \"ii\", HPrice, MaxLevel)) SendClientMessage(playerid, 0xFFFFFFFF, \"{FF0000}Használat: \\\"/createhouse <ár> <maxlevel (1-10)>\\\"\");else{ // Check if the player entered a proper maxlevel if ((MaxLevel >= 1) && (MaxLevel <= 10)) { // Find the first free HouseID for (HouseID = 1; HouseID < MAX_HOUSES; HouseID++) if (!IsValidDynamicPickup(AHouseData[HouseID][PickupID])) // Check if an empty house-index has been found (PickupID is 0) break; // Stop searching, the first free HouseID has been found now // Check if the house-limit hasn\'t been reached yet // This would seem to double-check the pickup-id, but in case there was no free houseslot found (HouseID points // to the last index, the last index would hold a house, so be sure to not overwrite it if (!IsValidDynamicPickup(AHouseData[HouseID][PickupID])) { // Setup some local variables new Float:x, Float:y, Float:z, Msg[128]; // Get the player\'s position GetPlayerPos(playerid, x, y, z); // Set some default data AHouseData[HouseID][Owned] = false; AHouseData[HouseID][Owner] = 0; AHouseData[HouseID][HouseX] = x; AHouseData[HouseID][HouseY] = y; AHouseData[HouseID][HouseZ] = z; AHouseData[HouseID][HouseLevel] = 1; AHouseData[HouseID][HouseMaxLevel] = MaxLevel; AHouseData[HouseID][HousePrice] = HPrice; AHouseData[HouseID][HouseOpened] = false; AHouseData[HouseID][insurance] = false; AHouseData[HouseID][staticHouse] = false; AHouseData[HouseID][CarSlots] = 1; // This must be equal to the house-level for a normal house // Add the pickup and 3DText at the location of the house-entrance (where the player is standing when he creates the house) House_UpdateEntrance(HouseID); // Save the house HouseFile_Save(HouseID); // Inform the player that he created a new house format(Msg, 128, \"{00FF00}Ház létrehozva, azonosító (ID): {FFFF00}%i\", HouseID); SendClientMessage(playerid, 0xFFFFFFFF, Msg); } else SendClientMessage(playerid, 0xFFFFFFFF, \"{FF0000}Nem lehet több házat létrehozni!\"); } else SendClientMessage(playerid, 0xFFFFFFFF, \"{FF0000}Max szint: 1 - 10\");}}else SendClientMessage(playerid, 0xFFFFFFFF, \"{FF0000}Csak gyalog lehet házat létrehozni!\");// Let the server know that this was a valid commandreturn 1;}// Lets the player add new houses (a house that cannot be upgraded, has a fixed interior and a fixed amount of carslots)COMMAND:createstatichouse(playerid, params[]){// Setup local variablesnew HPrice, Carslots, HouseID, Interior;// If a player hasn\'t logged in properly, he cannot use this commandif (INT_IsPlayerLoggedIn(playerid) == 0) return 0;// If the player has an insufficient admin-level (he needs level 5 or RCON admin), exit the command// returning \"SERVER: Unknown command\" to the playerif (INT_CheckPlayerAdminLevel(playerid, 5) == 0) return 0;// Check if the player isn\'t inside a vehicle (the admin-player must be on foot to use this command)if (GetPlayerVehicleSeat(playerid) == -1){if (sscanf(params, \"iii\", HPrice, Carslots, Interior)) SendClientMessage(playerid, 0xFFFFFFFF, \"{FF0000}Használat: \\\"/createstatichouse <ár> <Jármûhelyek (1-10)> <Interior (1-10)>\\\"\");else{ // Check if the player entered a proper amount of Carslots if ((Carslots >= 1) && (Carslots <= 10)) { // Check if the player entered a valid interior if ((Interior >= 1) && (Interior <= 10)) { // Find the first free HouseID for (HouseID = 1; HouseID < MAX_HOUSES; HouseID++) if (!IsValidDynamicPickup(AHouseData[HouseID][PickupID])) // Check if an empty house-index has been found (PickupID is 0) break; // Stop searching, the first free HouseID has been found now // Check if the house-limit hasn\'t been reached yet // This would seem to double-check the pickup-id, but in case there was no free houseslot found (HouseID points // to the last index, the last index would hold a house, so be sure to not overwrite it if (!IsValidDynamicPickup(AHouseData[HouseID][PickupID])) { // Setup some local variables new Float:x, Float:y, Float:z, Msg[128]; // Get the player\'s position GetPlayerPos(playerid, x, y, z); // Set some default data AHouseData[HouseID][Owned] = false; AHouseData[HouseID][HouseX] = x; AHouseData[HouseID][HouseY] = y; AHouseData[HouseID][HouseZ] = z; AHouseData[HouseID][HouseLevel] = Interior; // The house-level indicates the static interior AHouseData[HouseID][HouseMaxLevel] = Interior; AHouseData[HouseID][HousePrice] = HPrice; AHouseData[HouseID][HouseOpened] = false; AHouseData[HouseID][insurance] = false; AHouseData[HouseID][staticHouse] = true; AHouseData[HouseID][CarSlots] = Carslots; // Add the pickup and 3DText at the location of the house-entrance (where the player is standing when he creates the house) House_UpdateEntrance(HouseID); // Save the house HouseFile_Save(HouseID); // Inform the player that he created a new house format(Msg, 128, \"{00FF00}A statikus ház létrehozva, azonosító (ID): {FFFF00}%i\", HouseID); SendClientMessage(playerid, 0xFFFFFFFF, Msg); } else SendClientMessage(playerid, 0xFFFFFFFF, \"{FF0000}Nem lehet több házat létrehozni!\"); } else SendClientMessage(playerid, 0xFFFFFFFF, \"{FF0000}Belsõ (Interior) azonosítók: 1 - 10\"); } else SendClientMessage(playerid, 0xFFFFFFFF, \"{FF0000}Jármûférõhelyeket add meg! (1 - 10)\");}}else SendClientMessage(playerid, 0xFFFFFFFF, \"{FF0000}Csak gyalog lehet házat létrehozni!\");// Let the server know that this was a valid commandreturn 1;}// This command lets the player delete a houseCOMMAND:dellhouse(playerid, params[]){// Setup local variablesnew file[100], Msg[128];// If a player hasn\'t logged in properly, he cannot use this commandif (INT_IsPlayerLoggedIn(playerid) == 0) return 0;// If the player has an insufficient admin-level (he needs level 5 or RCON admin), exit the command// returning \"SERVER: Unknown command\" to the playerif (INT_CheckPlayerAdminLevel(playerid, 5) == 0) return 0;// Check if the player isn\'t inside a vehicle (the admin-player must be on foot to use this command)if (GetPlayerVehicleSeat(playerid) == -1){// Loop through all housesfor (new HouseID = 1; HouseID < MAX_HOUSES; HouseID++){ // Check if the house exists if (IsValidDynamicPickup(AHouseData[HouseID][PickupID])) { // Check if the house has no owner (owned houses cannot be deleted) if (AHouseData[HouseID][Owned] == false) { // Check if the player is in range of the house-pickup if (IsPlayerInRangeOfPoint(playerid, 2.5, AHouseData[HouseID][HouseX], AHouseData[HouseID][HouseY], AHouseData[HouseID][HouseZ])) { // Clear all data of the house AHouseData[HouseID][Owned] = false; AHouseData[HouseID][Owner] = 0; AHouseData[HouseID][HouseName] = 0; AHouseData[HouseID][insurance] = false; AHouseData[HouseID][HouseX] = 0.0; AHouseData[HouseID][HouseY] = 0.0; AHouseData[HouseID][HouseZ] = 0.0; AHouseData[HouseID][HouseLevel] = 0; AHouseData[HouseID][HouseMaxLevel] = 0; AHouseData[HouseID][HousePrice] = 0; AHouseData[HouseID][HouseOpened] = false; AHouseData[HouseID][staticHouse] = false; AHouseData[HouseID][CarSlots] = 0; // Destroy the mapicon, 3DText and pickup for the house DestroyDynamicPickup(AHouseData[HouseID][PickupID]); DestroyDynamicMapIcon(AHouseData[HouseID][MapIconID]); DestroyDynamic3DTextLabel(AHouseData[HouseID][DoorText]); AHouseData[HouseID][PickupID] = 0; AHouseData[HouseID][MapIconID] = 0; // Delete the house-file format(file, sizeof(file), HouseFile, HouseID); // Construct the complete filename for this house-file if (fexist(file)) // Make sure the file exists fremove(file); // Delete the file // Also let the player know he deleted the house format(Msg, 128, \"{00FF00}Törölted a {FFFF00}%i {00FF00}azonosítószámú házat!\", HouseID); SendClientMessage(playerid, 0xFFFFFFFF, Msg); // Exit the function return 1; } } else SendClientMessage(playerid, 0xFFFFFFFF, \"{FF0000}Tulajdonossal rendelkezõ házakat nem törölhetsz!\"); }}// There was no house in range, so let the player know about itSendClientMessage(playerid, 0xFFFFFFFF, \"{FF0000}Nincs a közelben ház!\");}else SendClientMessage(playerid, 0xFFFFFFFF, \"{FF0000}Csak gyalog lehet házat törölni!\");// Let the server know that this was a valid commandreturn 1;}// This command lets the player buy a house when he\'s standing in range of a house that isn\'t owned yetCOMMAND:buyhouse(playerid, params[]){// Setup local variablesnew Msg[128];// If a player hasn\'t logged in properly, he cannot use this commandif (INT_IsPlayerLoggedIn(playerid) == 0) return 0;// Check if the player isn\'t inside a vehicle (the player must be on foot to use this command)if (GetPlayerVehicleSeat(playerid) == -1){// Check if the player is near a house-pickupfor (new HouseID = 1; HouseID < MAX_HOUSES; HouseID++){ // Check if the house exists if (IsValidDynamicPickup(AHouseData[HouseID][PickupID])) { // Check if the player is in range of the house-pickup if (IsPlayerInRangeOfPoint(playerid, 2.5, AHouseData[HouseID][HouseX], AHouseData[HouseID][HouseY], AHouseData[HouseID][HouseZ])) { // Check if the house isn\'t owned yet if (AHouseData[HouseID][Owned] == false) { // Check if the player can afford this house if (INT_GetPlayerMoney(playerid) >= AHouseData[HouseID][HousePrice]) House_SetOwner(playerid, HouseID); // Give ownership of the house to the player (if he has a spare houseslot) else SendClientMessage(playerid, 0xFFFFFFFF, \"{FF0000}Nem engedheted meg magadnak ezt a házat! Ok: kevés pénz\"); // The player cannot afford this house } else { // Let the player know that this house is already owned by a player format(Msg, 128, \"{FF0000}Ezt a házat már megvették! {FF0000}Tulajdonos: {FFFF00}%s\", AHouseData[HouseID][Owner]); SendClientMessage(playerid, 0xFFFFFFFF, Msg); } // The player was in range of a house-pickup, so stop searching for the other house pickups return 1; } }}// All houses have been processed, but the player wasn\'t in range of any house-pickup, let him know about itSendClientMessage(playerid, 0xFFFFFFFF, \"{FF0000}Házvásárláshoz közel kell légy egy ház-pickuphoz!\");}else SendClientMessage(playerid, 0xFFFFFFFF, \"{FF0000}Nem tudsz jármûben házat venni!\");// Let the server know that this was a valid commandreturn 1;}// This command lets the player enter the house/business if he\'s the ownerCOMMAND:enterhouse(playerid, params[]){// Setup local variablesnew HouseID, IntID;// If a player hasn\'t logged in properly, he cannot use this commandif (INT_IsPlayerLoggedIn(playerid) == 0) return 0;// Check if the player isn\'t inside a vehicle (the player must be on foot to use this command)if (GetPlayerVehicleSeat(playerid) == -1){// Loop through all housesfor (HouseID = 1; HouseID < MAX_HOUSES; HouseID++){ // Check if the house exists if (IsValidDynamicPickup(AHouseData[HouseID][PickupID])) { // Check if the player is in range of the house-pickup if (IsPlayerInRangeOfPoint(playerid, 2.5, AHouseData[HouseID][HouseX], AHouseData[HouseID][HouseY], AHouseData[HouseID][HouseZ])) { // Check if the house is closed to the public if (AHouseData[HouseID][HouseOpened] == false) { // The house isn\'t open to the public, so keep anyone out who isn\'t the owner of the house if (House_PlayerIsOwner(playerid, HouseID) == 0) { // Let the player know that this house isn\'t open to the public and he can\'t enter it SendClientMessage(playerid, 0xFFFFFFFF, \"{FF0000}Ez a ház magánház, nem léphetsz be!\"); return 1; } } // The house is open to the public, or the player trying to enter is the owner, so let the player inside the house // Get the interior to put the player in IntID = AHouseData[HouseID][HouseLevel]; // Get the level of the house // Set the worldid so other players cannot see him anymore (but allow all players in the same house to see eachother) SetPlayerVirtualWorld(playerid, 5000 + HouseID); // Set the player inside the interior of the house SetPlayerInterior(playerid, AHouseInteriors[intID][interiorID]); // Set the position of the player at the spawn-location of the house\'s interior SetPlayerPos(playerid, AHouseInteriors[intID][intX], AHouseInteriors[intID][intY], AHouseInteriors[intID][intZ]); // Also set a tracking-variable to enable /housemenu to track in which house the player is APlayerData[playerid][CurrentHouse] = HouseID; // Also let the player know he can use /housemenu to upgrade/exit his house SendClientMessage(playerid, 0xFFFFFFFF, \"{00FF00}Használd a {FFFF00}/housemenu{00FF00} parancsot, hogy megváltoztasd a házad dolgait.\"); // Exit the function return 1; } }}}// Let the server know that this was a valid commandreturn 1;}// This command opens a menu when you\'re inside your house to allow to access the options of your houseCOMMAND:housemenu(playerid, params[]){// Setup local variablesnew OptionsList[200], DialogTitle[200], HouseID;// If a player hasn\'t logged in properly, he cannot use this commandif (INT_IsPlayerLoggedIn(playerid) == 0) return 0;// Get the HouseID where the player has enteredHouseID = APlayerData[playerid][CurrentHouse];// Check if the player is inside a houseif (HouseID != 0){format(DialogTitle, sizeof(DialogTitle), \"Válassz opciót itt: %s\", AHouseData[HouseID][HouseName]);// Create 2 different option-lists, based on StaticHouseif (AHouseData[HouseID][staticHouse] == true){ // Create the dialog for a static house (has the same options as a normal house, except for upgrading the house) format(OptionsList, sizeof(OptionsList), \"%sHáznév megváltoztatása\\n\", OptionsList); format(OptionsList, sizeof(OptionsList), \"%sJármû vásárlás a ház mellé\\n\", OptionsList); format(OptionsList, sizeof(OptionsList), \"%sJármû biztosítás kötése\\n\", OptionsList); format(OptionsList, sizeof(OptionsList), \"%sHázjármû eladása\\n\", OptionsList); format(OptionsList, sizeof(OptionsList), \"%sHáz eladása\\n\", OptionsList); format(OptionsList, sizeof(OptionsList), \"%sHáz kinyitása a társadalomnak\\n\", OptionsList); format(OptionsList, sizeof(OptionsList), \"%sHáz elzárása a társadalomtól\\n\", OptionsList); format(OptionsList, sizeof(OptionsList), \"%sKilépés a házból\\n\", OptionsList);}else{ // Create the dialog for a normal house format(OptionsList, sizeof(OptionsList), \"%sHáznév megváltoztatása\\n\", OptionsList); format(OptionsList, sizeof(OptionsList), \"%sHáz frissítése\\n\", OptionsList); format(OptionsList, sizeof(OptionsList), \"%sJármû vásárlás a ház mellé\\n\", OptionsList); format(OptionsList, sizeof(OptionsList), \"%sJármû biztosítás kötése\\n\", OptionsList); format(OptionsList, sizeof(OptionsList), \"%sHázjármû eladása\\n\", OptionsList); format(OptionsList, sizeof(OptionsList), \"%sHáz eladása\\n\", OptionsList); format(OptionsList, sizeof(OptionsList), \"%sHáz kinyitása a társadalomnak\\n\", OptionsList); format(OptionsList, sizeof(OptionsList), \"%sHáz elzárása a társadalomtól\\n\", OptionsList); format(OptionsList, sizeof(OptionsList), \"%sKilépés a házból\\n\", OptionsList);}// Show the housemenuShowPlayerDialog(playerid, DialogHouseMenu, DIALOG_STYLE_LIST, DialogTitle, OptionsList, \"Kiválaszt\", \"Mégsem\");}else SendClientMessage(playerid, 0xFFFFFFFF, \"{FF0000}Nem vagy házban!\");// Let the server know that this was a valid commandreturn 1;}// This command teleports you to your selected houseCOMMAND:gohome(playerid, params[]){// Setup local variablesnew HouseList[1000], HouseID;// If a player hasn\'t logged in properly, he cannot use this commandif (INT_IsPlayerLoggedIn(playerid) == 0) return 0;// Check if the player isn\'t inside a vehicle (the player must be on foot to use this command)if (GetPlayerVehicleSeat(playerid) == -1){// Ask to which house the player wants to portfor (new HouseSlot; HouseSlot < MAX_HOUSESPERPLAYER; HouseSlot++){ // Get the HouseID in this slot HouseID = APlayerData[playerid][Houses][HouseSlot]; // Check if this houseindex is occupied if (HouseID != 0) format(HouseList, 1000, \"%s{00FF00}%s{FFFFFF}\\n\", HouseList, AHouseData[HouseID][HouseName]); else format(HouseList, 1000, \"%s{FFFFFF}%s{FFFFFF}\\n\", HouseList, \"Üres ház\"); // Eredetileg Empty house-slot}ShowPlayerDialog(playerid, DialogGoHome, DIALOG_STYLE_LIST, \"Válaszd ki azt a házat ahova menni szeretnél:\", HouseList, \"Kiválaszt\", \"Mégsem\");}elseSendClientMessage(playerid, 0xFFFFFFFF, \"{FF0000}Gyalog kell lenned, hogy tudj a házadhoz teleportálni.\");// Let the server know that this was a valid commandreturn 1;}// This command allows you to port a vehicle from your house to your locationCOMMAND:getcar(playerid, params[]){// Setup local variablesnew HouseList[1000], HouseID;// If a player hasn\'t logged in properly, he cannot use this commandif (INT_IsPlayerLoggedIn(playerid) == 0) return 0;// Check if the player isn\'t inside a vehicle (the player must be on foot to use this command)if (GetPlayerVehicleSeat(playerid) == -1){// Ask to which house the player wants to portfor (new HouseSlot; HouseSlot < MAX_HOUSESPERPLAYER; HouseSlot++){ // Get the HouseID in this slot HouseID = APlayerData[playerid][Houses][HouseSlot]; // Check if this houseindex is occupied if (HouseID != 0) format(HouseList, 1000, \"%s{00FF00}%s{FFFFFF}\\n\", HouseList, AHouseData[HouseID][HouseName]); else format(HouseList, 1000, \"%s{FFFFFF}%s{FFFFFF}\\n\", HouseList, \"Üres ház\");}ShowPlayerDialog(playerid, DialogGetCarSelectHouse, DIALOG_STYLE_LIST, \"Válaszd ki a házat ahonnan ki akarod szedni a kocsit:\", HouseList, \"Select\", \"Cancel\");}elseSendClientMessage(playerid, 0xFFFFFFFF, \"{FF0000}Gyalog kell lenned, hogy egy kocsit magadhoz teleportálj.\");// Let the server know that this was a valid commandreturn 1;}// This command checks if the player is inside a vehicle that he owns and if he\'s in range of the house where the vehicle is assigned toCOMMAND:park(playerid, params[]){// Setup local variablesnew Float:x, Float:y, Float:z, Float:rot, vid, HouseID, Msg[128];new engine,lights,alarm,doors,bonnet,boot,objective;// If a player hasn\'t logged in properly, he cannot use this commandif (INT_IsPlayerLoggedIn(playerid) == 0) return 0;// Check if the player is inside a vehicle (he must be the driver)if (GetPlayerVehicleSeat(playerid) == 0){// Get the vehicle-idvid = GetPlayerVehicleID(playerid);// Get the HouseID to which this vehicle belongsHouseID = AVehicleData[vid][belongsToHouse];// Check if this vehicle belongs to a house (if not, the vehicle cannot be parked, as it\'s not a house-vehicle)if (HouseID != 0){ // Check if the vehicle is in range of the house-entrance (you cannot park a vehicle further away from your house than 150m) if (IsPlayerInRangeOfPoint(playerid, ParkRange, AHouseData[HouseID][HouseX], AHouseData[HouseID][HouseY], AHouseData[HouseID][HouseZ])) { // Get the player\'s position and angle GetVehiclePos(vid, x, y, z); GetVehicleZAngle(vid, rot); // Save those values for the vehicle AVehicleData[vid][spawnX] = x; AVehicleData[vid][spawnY] = y; AVehicleData[vid][spawnZ] = z; AVehicleData[vid][spawnRot] = rot; // Loop through all carslots of this house to find the vehicle-id for (new CarSlot; CarSlot < 10; CarSlot++) { // Check if this carslot holds the same vehicle-id if (AHouseData[HouseID][VehicleIDs][CarSlot] == vid) { House_ReplaceVehicle(HouseID, CarSlot); // Re-create the vehicle at the same spot the player wants to park his vehicle PutPlayerInVehicle(playerid, AHouseData[HouseID][VehicleIDs][CarSlot], 0); // Turn on the engine and lights GetVehicleParamsEx(AHouseData[HouseID][VehicleIDs][CarSlot], engine, lights, alarm, doors, bonnet, boot, objective); SetVehicleParamsEx(AHouseData[HouseID][VehicleIDs][CarSlot], 1, 1, alarm, doors, bonnet, boot, objective); break; // Stop the for-loop } } // Let the player know he parked his vehicle SendClientMessage(playerid, 0xFFFFFFFF, \"{00FF00}Leparkoltad a jármûved.\"); // Save the housefile HouseFile_Save(HouseID); } else { format(Msg, 128, \"{FFFF00}%iméteren{FF0000} belül kell parkolj a házadhoz közel.\", ParkRange); SendClientMessage(playerid, 0xFFFFFFFF, Msg); }}else SendClientMessage(playerid, 0xFFFFFFFF, \"{FF0000}Nem tudod leparkolni a jármûved, mert nem a te tulajdonodban van!\");}else SendClientMessage(playerid, 0xFFFFFFFF, \"{FF0000}Csak jármûben tudod leparkolni a saját jármûvedet.\");// Let the server know that this was a valid commandreturn 1;} // ******************************************************************************************************************************// Dialog-responses// ******************************************************************************************************************************// This function processes the housemenu dialogDialog_HouseMenu(playerid, response, listitem){// Just close the dialog if the player clicked \"Cancel\"if(!response) return 1;// Setup local variablesnew UpgradeList[2000], HouseID, DialogTitle[200], Counter, UpgradePrice, Msg[128], CarSlot, VehicleClassList[1000], VehicleList[500]; new MsgInsurance[128], BuyableCarIndex, bool:HouseHasCars = false;// Get the HouseID of the house where the player isHouseID = APlayerData[playerid][CurrentHouse];// Skip listitem 1 if this house is a static house (listitem 1 = buy house-car => item 2, ...)if (AHouseData[HouseID][staticHouse] == true){// If listitem is 1 or higher, increase the listitem by 1, skipping the \"upgrade house\" option// but still keep the \"change housename\" option (listitem 0)if (listitem >= 1) listitem++;}// Select an option based on the selection in the listswitch(listitem){ case 0: // Change house name { // Only the house-owner can use this option if (House_PlayerIsOwner(playerid, HouseID) == 1) { format(DialogTitle, 200, \"Régi háznév: %s\", AHouseData[HouseID][HouseName]); ShowPlayerDialog(playerid, DialogHouseNameChange, DIALOG_STYLE_INPUT, DialogTitle, \"Adj egy új nevet a házadnak\", \"Kiválaszt\", \"Mégsem\"); } else SendClientMessage(playerid, 0xFFFFFFFF, \"{FF0000}Csak a ház tulajdonosa tudja használni ezt az opciót.\"); } case 1: // Upgrade the house { // Only the house-owner can use this option if (House_PlayerIsOwner(playerid, HouseID) == 1) { // Check if it\'s possible to upgrade further if (AHouseData[HouseID][HouseLevel] < AHouseData[HouseID][HouseMaxLevel]) { // Add only the upgrades above the current house-level to the upgradelist for (new i = AHouseData[HouseID][HouseLevel] + 1; i <= AHouseData[HouseID][HouseMaxLevel]; i++) { Counter++; // Add 1 to the counter each time an upgrade is added to the upgradelist UpgradePrice = ((AHouseData[HouseID][HousePrice] * Counter) / 100) * HouseUpgradePercent; // Add the upgrade-info in green if the player can afford it, and in red if he cannot afford it if (INT_GetPlayerMoney(playerid) >= UpgradePrice) format(UpgradeList, 2000, \"%s{00FF00}%s (szint %i)\\t\\t$%i\\n\", UpgradeList, AHouseInteriors[interiorName], i, UpgradePrice); else format(UpgradeList, 2000, \"%s{FF0000}%s (szint %i)\\t\\t$%i\\n\", UpgradeList, AHouseInteriors[interiorName], i, UpgradePrice); } // Show another dialog to let the player select which upgrade he wants for his house ShowPlayerDialog(playerid, DialogUpgradeHouse, DIALOG_STYLE_LIST, \"Válaszd ki a frissítést:\", UpgradeList, \"Kiválaszt\", \"Mégsem\"); } else SendClientMessage(playerid, 0xFFFFFFFF, \"{FF0000}A házad e
#define MAX_HOUSESPERPLAYER 20 // helyette -->#define MAX_HOUSESPERPLAYER 2
new AHouseInteriors[][THouseInterior] ={ {\"Dummy\", 0, 0.0, 0.0, 0.0}, // Dummy interior (Level 0), as the house-level starts at 1 {\"Small motel room\", 10, 2262.83, -1137.71, 1050.63}, // Level 1 {\"Small house\", 2, 2467.36, -1698.38, 1013.51}, // Level 2 {\"Small house 2\", 1, 223.00, 1289.26, 1082.20}, // Level 3 {\"Medium house\", 10, 2260.76, -1210.45, 1049.02}, // Level 4 {\"Medium house 2\", 8, 2365.42, -1131.85, 1050.88}, // Level 5 {\"Duplex house\", 12, 2324.33, -1144.79, 1050.71}, // Level 6 {\"Big house\", 15, 295.14, 1474.47, 1080.52}, // Level 7 {\"Big duplex house\", 3, 235.50, 1189.17, 1080.34}, // Level 8 {\"Huge house\", 7, 225.63, 1022.48, 1084.07}, // Level 9 {\"Mansion\", 5, 1299.14, -794.77, 1084.00} // Level 10};
House_Exit(playerid, HouseID);