Originally Posted by Drew_Connolly
Here ill give u tuturial, i suggest using notepad because theres 2 of the same line and it confused me before and follow all instructions.
ADDING HOUSES FULL TUTORIAL (you can also do it with sneaky but he doesn't tell you enough and you will bug your script up): Go in front of the entrance of the house you want to make, and type /save houseentrance Then take a normal sized car, park it somewhere close, and save the position also (for the housecar). Then go into your property.cfg and make a new line which will start by the first 3 variable of the position of the entrance: entranceX,entranceY,entranceZ, Then you follow by the position inside the interior (interior IDs+coordinates here: https://sampwiki.blast.hk/index.php/InteriorIDs) which will give you: entranceX, entranceY,entranceZ,interiorX,interiorY,interiorZ, Then you add 6 zeros: entranceX, entranceY,entranceZ,interiorX,interiorY,interiorZ, 0,0,0,0,0,0, Then you add the name of owner (i just use The State as default, when you buy the house ingame the name will change) followed by a short description of the house and its price: entranceX, entranceY,entranceZ,interiorX,interiorY,interiorZ, 0,0,0,0,0,0,NameOfOwner,DescriptionOfHouse,Price, Then you add two zeros (health/armor upgrades which you will buy ingame) followed by the interior ID of the house: entranceX, entranceY,entranceZ,interiorX,interiorY,interiorZ, 0,0,0,0,0,0,NameOfOwner,DescriptionOfHouse,Price,h ealthupgrade,armorupgrade,interiorID, After that: interiorID, locked(1)/unlocked(0), owned(1)/notowned(0), numberofrooms, rentfee, rentable(1) or not (0), housebank, housecar modelID, carcolor1, carcolor2, timesincelastlogin, level Then, once your ligne in property.cfg is done, open your script and look for this line: Quote new HouseInfo[34][hInfo]; Change the "34" to a "35" (if you add only 1 house). Then look for Код:
new Float:HouseCarSpawns[34][4] = { Код:
{housecarX,housecarY,housecarZ,housecarANGLE}//your new housecar Код:
new Float:HouseCarSpawns[34][4] = { {2342.5,-1039.8,52.5,180.1809},//flash //trailer 0 {2064.4,-1694.4,13.1,271.1561},//elergy 1 {2246.9573,-1909.0677,14.2518,177.5861}, {1109.8,-968.0,42.7,0.0},//house3 {2497.6274,-2025.6306,13.2521,355.4281}, // hosue 4 {2645.0,-1990.8,13.1,180.0},//balde hr - 5 {2503.5977,-1364.4044,28.2365,357.6592},//house 6 {1910.5149,-1120.5304,25.4493,177.8350},//house7 {828.8,-887.0,68.5,230.7095},//blistac 8 {2149.6,-1610.9,14.0,90.7904},//remington 9 {760.1,-1687.8,4.3,180.6},//10 {645.5,-1616.1,14.9,0.0},//supergt 11 {1830.7705,-1404.1754,13.1338,269.9360},//house 12 {1679.2,-1462.9,13.3,270.0},//comet 13 {959.5864,-901.0845,45.8584,177.3087},//newhouse cheeta 14 {2445.8,-1326.8,23.6,18.4}, {2845.9,-1286.8,18.9,90.0},//savanna 8 house 16 {2159.8,-1803.9,13.3,271.4}, //blank 17 {2485.1,-1653.4,13.1,90.7904},//bullit 10 house 18 {977.6,-829.0,95.6,0.0},//hotring 2 house 19 {1514.0,-694.6,94.5,90.0},//bullit 10 house 20 {1246.7,-1107.6,25.5,266.4},//rancher 5 house 21 {831.7,-857.5,69.9,180.0},//bucaner//hotrod 6 house 22 {1007.9,-659.4,121.1,130.6194},//cheetah 23 {1110.0,-726.4,100.1,90.0},//zr350 //house 24 {259.7,-1221.0,74.7,202.0011},//infurnus house25 {1463.7,-901.7,55.8,359.0},//euros //house26 {1440.1,-890.6,51.2,0.0},//banshee //house 27 {1040.7,-1053.7,31.7,0.0},//banshee //house 19 {1146.2,-2046.5,69.0,301.3}, //{1880.2,-2022.3,13.3,180.0},//banshee //house 20 //move {963.5,-1830.8,12.6,254.8},//banshee //house 21 {2088.6,-1140.6,25.5,90.8},//banshee //house 21 {904.5523,-1454.7026,12.9286,269.2811}, {1534.1,-841.5,65.0,93.2},<--------- Add this comma! {housecarX,housecarY,housecarZ,housecarANGLE}//your new housecar <--------- NOTICE no comma at the end of this one, because its the last line. }; You see the 35? This means that the housecar you just added is now considered a cop car by the script, and it will turn you orange (criminal) if you enter it. So, simply edit the 35 and every ID you see so that the script recognizes the housecar for what it is: a housecar. Do this for the whole part: Код:
public IsAPlane(carid) { if((carid >= 66<---put 67 here && carid <=71<---put 72 here) || carid == 60<---put 61 here) { return 1; } return 0; } public IsACopCar(carid) { if((carid >= 35<---put 36 here) && (carid <= 60<---put 61 here)) { return 1; } return 0; } public IsAnAmbulance(carid) { if((carid >= 61<---put 62 here) && (carid <= 63<---put 64 here)) { return 1; } return 0; } public IsATruck(carid) { if(carid >= 78<---put 79 here && carid <= 81<---put 82 here) { return 1; } return 0; } Now that you've successfully taken care of copcar, ambulance, plane and truck IDs, lets take a look at Rentcar IDs. Search for "/rentcar" in your script, and you will come to a part of script with two lines: Код:
if(newcar >= 71<--- put 72 && newcar <= 74<---put 75) Код:
if(newcar >= 75<--- put 76 && newcar <= 77<--- put 78) Код:
if(strcmp(cmd, "/rentcar", true) == 0) { if(GetPlayerVehicleID(playerid) >= 71 && GetPlayerVehicleID(playerid) <= 77) <--- BE CAREFUL! This line represents rentcars as a WHOLE, that means 71 to 77 includes ALL the rentcars in your script. Just add 1 to each number if you added 1 house { new hirefee = HireCost(GetPlayerVehicleID(playerid)); if(GetPlayerVehicleID(playerid) >= 71 && GetPlayerVehicleID(playerid) <= 74)<-- same as above here, add 1 to both numbers, this represents the SECOND rentcar biz cars { if(BizzInfo[9][bProd] == 0) { GameTextForPlayer(playerid, "~r~Out Of Stock", 5000, 1); return 1; } if(PlayerInfo[playerid][pPbiskey] == 9) { GameTextForPlayer(playerid, "~w~No charge for the boss", 5000, 3); TogglePlayerControllable(playerid, 1); return 1; } if (GetPlayerMoney(playerid) < BizzInfo[9][bEntcost]) { SendClientMessage(playerid, COLOR_GRAD2, " You dont have that much cash"); return 1; } GivePlayerMoney(playerid,-BizzInfo[9][bEntcost]); BizzInfo[9][bTakings] = BizzInfo[9][bTakings]+BizzInfo[9][bEntcost]; BizzInfo[9][bProd]--; } if(GetPlayerVehicleID(playerid) >= 75 && GetPlayerVehicleID(playerid) <= 77)<---same as above here also, add 1 to the numbers. This line represents the rentcars for the FIRST biz { if(BizzInfo[8][bProd] == 0) { GameTextForPlayer(playerid, "~r~Out Of Stock", 5000, 1); return 1; } if(PlayerInfo[playerid][pPbiskey] == Cool { GameTextForPlayer(playerid, "~w~No charge for the boss", 5000, 3); TogglePlayerControllable(playerid, 1); return 1; } if (GetPlayerMoney(playerid) < BizzInfo[8][bEntcost]) { SendClientMessage(playerid, COLOR_GRAD2, " You dont have that much cash"); return 1; } GivePlayerMoney(playerid,-BizzInfo[8][bEntcost]); BizzInfo[8][bTakings] = BizzInfo[8][bTakings]+BizzInfo[8][bEntcost]; BizzInfo[8][bProd]--; } Код:
if(GetPlayerVehicleID(playerid) >= 71<---Add 1 here && GetPlayerVehicleID(playerid) <= 77<---Add 1 here as well) Credits Jashugan hope this helps |
Originally Posted by Drew_Connolly
No, there isnt. I got like 47 different houses. You just cant use that same interior twice or it will screw up again.
|
Originally Posted by Newbz0r
Dude.. thats best tutorial ever! All worked For me! Thanks Alot !
![]() |