SA-MP Forums Archive
Simple House System by Antironix Need HELP - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Simple House System by Antironix Need HELP (/showthread.php?tid=134319)



Simple House System by Antironix Need HELP - KiraAndPoul - 16.03.2010

Hi i got a problem with the filterscript by Antironix i cant make Housecar everytime i try to /ordercar nothing happens
Please help me !

FS now:
Quote:

#include <a_samp>
#include <dudb>
#define dcmd(%1,%2,%3) if ((strcmp((%3)[1], #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0) && (dcmd_%1(playerid, "")))||(((%3)[(%2) + 1] == 32) && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
//----------------------------
//----------------------------
// Full house script by Antironix!
// Just don't remove the credits!
//----------------------------
//----------------------------
#define MAX_HOUSES 19
#define MAX_RENTCOST 1000
#define MIN_RENTCOST 100
#define MAX_BUY_CARS 17
#define CAR_DELIVER_TIME 1 //The time that it takes that your car will be delivered. In hours.
new HOUSE_STATS = 0; //0 Means housestats on pickup pickup, 1 means only housestats on /housestats command.

//buyable cars
enum CarInfo {CarModel,CarName[24],CarCost};
new Buyable_Cars[MAX_BUY_CARS][CarInfo] =
{ //Modelid, Buy Name, Price
{411,"Infernus",50000},
{522,"NRG-500",50000},
{451,"Turismo",50000},
{541,"Bullet",50000},
{415,"Cheetah",50000},
{429,"Banshee",50000},
{494,"Hotring",50000},
{556,"Monster",25000},
{400,"Landstalker",25000},
{402,"Buffalo",25000},
{405,"Sentinel",50000},
{418,"Moonbeam",10000},
{421,"Washington",10000},
{422,"Bobcat",10000},
{424,"BF Injection",50000},
{445,"Admiral",25000},
{461,"PCJ-600",25000}
};

#define Cost_Admiral 50000
//----------------------------
//----------------------------
#define c_y 0xFFFF00AA
#define c_r 0xAA3333AA
new HousePickup[MAX_HOUSES];
new playerinterior[MAX_PLAYERS]=-1;
new inhousepickup;
new playericonhouse[MAX_PLAYERS];
new Float:housex, Float:housey, Float:housez;
new housemapicon[MAX_PLAYERS];
new playerworld[MAX_PLAYERS];
new bool:KillVeh[MAX_VEHICLES] = false;
forward rentfee();
forward newcar();
forward KillVehicle(carid);

enum HouseInfo
{
Name[24],
Renter[24],
Rentable,
Rentcost,
Cost,
Sell,
Interior,
Virtualworld,
Locked,
Float:InteriorX,
Float:InteriorY,
Float:InteriorZ,
Float:iconx,
Float:icony,
Float:iconz,
Rentfee
}
new hInfo[MAX_HOUSES][HouseInfo];

enum HouseCarInfo
{
HouseCar,
GotCar,
Houseid,
CarModel,
Float:CarX,
Float:CarY,
Float:CarZ,
CarColor1,
CarColor2,
Respawn_Delay,
NewCar
}
new cInfo[MAX_HOUSES][HouseCarInfo];
#define FILTERSCRIPT
#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" Country Side Roleplay housing");
print(" Made with: Simple House System by Antironix");
print("--------------------------------------\n");
AddHouse(0,0.0,0.0,0.0,0.0,0.0,0.0,0,0,0,0);//Error Bug Fixer
AddHouse(1, -2134.090576, -2505.094726, 31.755706, 2251.85, -1138.16, 1050.63, 50000, 49000, 9, 0); //A small house
AddHouse(2, -2160.635742, -2534.739257, 31.816270, 2251.85, -1138.16, 1050.63, 50000, 49000, 9, 1); //A small house
AddHouse(3, -2180.881347, -2519.911376, 31.816270, 2251.85, -1138.16, 1050.63, 50000, 49000, 9, 2); //A small house
AddHouse(4, -2199.235107, -2512.092285, 31.816270, 2251.85, -1138.16, 1050.63, 50000, 49000, 9, 3); //A small house
AddHouse(5, -2224.063720, -2482.088867, 31.816272, 2251.85, -1138.16, 1050.63, 50000, 49000, 9, 4); //A small house
AddHouse(6, -21.8475, -2529.2012, 36.6484, 267.1000, 305.0000, 999.1484, 50000, 49000, 2, 5); // The Highway Motel
AddHouse(7, -17.5867, -2526.9045, 36.6555, 267.1000, 305.0000, 999.1484, 50000, 49000, 2, 6); // The Highway Motel
AddHouse(8, -12.9636, -2524.4128, 36.6555, 267.1000, 305.0000, 999.1484, 50000, 49000, 2, 7); // The Highway Motel
AddHouse(9, -8.6514, -2522.0891, 36.6555, 267.1000, 305.0000, 999.1484, 50000, 49000, 2, ; // The Highway Motel
AddHouse(10, -4.1901, -2519.6843, 36.6555, 267.1000, 305.0000, 999.1484, 50000, 49000, 2, 9); // The Highway Motel
AddHouse(11, -7.6181, -2510.4478, 36.6555, 267.1000, 305.0000, 999.1484, 50000, 49000, 2, 10); // The Highway Motel
AddHouse(12, -10.2789, -2506.1904, 36.6555, 267.1000, 305.0000, 999.1484, 50000, 49000, 2, 11); // The Highway Motel
AddHouse(13, -12.8996, -2501.9976, 36.6555, 267.1000, 305.0000, 999.1484, 50000, 49000, 2, 12); // The Highway Motel
AddHouse(14, -15.7341, -2497.4617, 36.6484, 267.1000, 305.0000, 999.1484, 50000, 49000, 2, 13); // The Highway Motel
AddHouse(15, -18.1708, -2493.5625, 36.6484, 267.1000, 305.0000, 999.1484, 50000, 49000, 2, 14); // The Highway Motel
AddHouse(16, -23.6176, -2482.5513, 36.6484, 267.1000, 305.0000, 999.1484, 50000, 49000, 2, 15); // The Highway Motel
AddHouse(17, -27.6498, -2485.3477, 36.6484, 267.1000, 305.0000, 999.1484, 50000, 49000, 2, 16); // The Highway Motel
AddHouse(18, -31.7744, -2488.2090, 36.6484, 267.1000, 305.0000, 999.1484, 50000, 49000, 2, 17); // The Highway Motel
AddHouse(19, -35.7951, -2490.9985, 36.6484, 267.1000, 305.0000, 999.1484, 50000, 49000, 2, 1; // The Highway Motel
AddHouse(20, -40.0932, -2493.9792, 36.6484, 267.1000, 305.0000, 999.1484, 50000, 49000, 2, 19); // The Highway Motel
/*
AddHouseCar(1, 551, -2126.285644, -2502.618896, 30.181900, 0, 0, 5*60,1000); // Default housecar
AddHouseCar(2, 551, -2148.807128, -2543.629150, 30.181840, 126, 126, 5*60,1000); // Default housecar
AddHouseCar(3, 551, -2167.020263, -2526.358642, 30.186355, 33, 33, 5*60,1000); // Default housecar
AddHouseCar(4, 551, -2198.755371, -2501.422607, 30.188419, 86, 86, 5*60,1000); // Default housecar
AddHouseCar(5, 551, -2235.352783, -2479.249023, 30.739850, 0, 0, 5*60,1000); // Default housecar
AddHouseCar(6, 551, -39.3615, -2498.9734, 36.3564, 0, 91, 5*60,1000); // Default Housecar
AddHouseCar(7, 551, -36.6334, -2496.9341, 36.4508, 0, 75, 5*60,1000); // Default Housecar
AddHouseCar(8, 551, -34.0641, -2495.2297, 36.4490, 0, 67, 5*60,1000); // Default Housecar
AddHouseCar(9, 551, -31.2255, -2493.4365, 36.4491, 0, 109, 5*60,1000); // Default Housecar
AddHouseCar(10, 551, -13.3851, -2509.4531, 36.4561, 0, 109, 5*60,1000); // Default Housecar
AddHouseCar(11, 551, -15.3029, -2506.7083, 36.4559, 0, 67, 5*60,1000); // Default Housecar
AddHouseCar(12, 551, -17.1021, -2503.9558, 36.4561, 0, 75, 5*60,1000); // Default Housecar
AddHouseCar(13, 551, -18.8908, -2501.1384, 36.4490, 0, 91, 5*60,1000); // Default Housecar
AddHouseCar(14, 551, -20.6611, -2498.1858, 36.4491, 0, 109, 5*60,1000); // Default Housecar
AddHouseCar(15, 551, -22.7123, -2495.3108, 36.4489, 0, 67, 5*60,1000); // Default Housecar
AddHouseCar(16, 551, -24.5800, -2492.5500, 36.4490, 0, 75, 5*60,1000); // Default Housecaar
AddHouseCar(17, 551, -13.7842, -2519.2458, 36.4561, 0, 91, 5*60,1000); // Default Housecar
AddHouseCar(18, 551, -16.8034, -2520.9883, 36.4559, 0, 109, 5*60,1000); // Default Housecar
AddHouseCar(19, 551, -19.7450, -2522.5010, 36.4527, 0, 67, 5*60,1000); // Default Housecar
AddHouseCar(20, 551, -22.3337, -2524.3574, 36.4443, 0, 91, 5*60,1000); // Default Housecar
*/


}

public OnFilterScriptExit()
{
for(new i=0;i<MAX_HOUSES;i++)
{
DestroyPickup(HousePickup[i]);
}
return 1;
}

#else
#endif

public OnPlayerCommandText(playerid, cmdtext[])
{
dcmd(buy,3,cmdtext);
dcmd(sell,4,cmdtext);
dcmd(enter,5,cmdtext);
dcmd(exit,4,cmdtext);
dcmd(lock,4,cmdtext);
dcmd(unlock,6,cmdtext);
dcmd(home,4,cmdtext);
dcmd(setrent,7,cmdtext);
dcmd(rent,4,cmdtext);
dcmd(unrent,6,cmdtext);
dcmd(house,5,cmdtext);
dcmd(housestats,10,cmdtext);
dcmd(getrent,7,cmdtext);
dcmd(payrent,7,cmdtext);
dcmd(ordercar,8,cmdtext);
return 0;
}

AddHouse(houseid, Float:iconX, Float:iconY, Float:iconZ, Float:interiorX, Float:interiorY, Float:interiorZ, Costa, Sella, Interiora, virtualworld)
{
new house[256];
format(house, sizeof(house), "Houses/houseid%d",houseid);
if(!dini_Exists(house))
{
dini_Create(house);
format(hInfo[houseid][Name], 24, "ForSale");
dini_Set(house, "Name", "ForSale");
format(hInfo[houseid][Renter], 24, "ForRent");
dini_Set(house, "Renter", "ForRent");
hInfo[houseid][Rentable] = 0;
dini_IntSet(house, "Rentable", 0);
hInfo[houseid][Rentcost] = 0;
dini_IntSet(house, "Rentcost", 0);
hInfo[houseid][Cost] = Costa;
dini_IntSet(house, "Cost", Costa);
hInfo[houseid][Sell] = Sella;
dini_IntSet(house, "Sell", Sella);
hInfo[houseid][Interior] = Interiora;
dini_IntSet(house, "Interior", Interiora);
dini_IntSet(house, "Virtualworld", virtualworld);
hInfo[houseid][Virtualworld] = virtualworld;
hInfo[houseid][Locked] = 1;
dini_IntSet(house, "Locked", 1);
hInfo[houseid][InteriorX] = interiorX;
hInfo[houseid][InteriorY] = interiorY;
hInfo[houseid][InteriorZ] = interiorZ;
dini_FloatSet(house, "X", interiorX);
dini_FloatSet(house, "Y", interiorY);
dini_FloatSet(house, "Z", interiorZ);
dini_IntSet(house, "RentPay", 0);
dini_IntSet(house, "RentGet", 0);
cInfo[houseid][HouseCar] = 429;
dini_IntSet(house, "HouseCar", 0);
cInfo[houseid][CarModel] = 429;
dini_IntSet(house, "CarModel", 1);
cInfo[houseid][CarX] = 0;
cInfo[houseid][CarY] = 0;
cInfo[houseid][CarZ] = 0;
dini_FloatSet(house, "CarX", 0);
dini_FloatSet(house, "CarY", 0);
dini_FloatSet(house, "CarZ", 0);
cInfo[houseid][CarColor1] = 0;
cInfo[houseid][CarColor2] = 0;
dini_FloatSet(house, "CarColor1", 0);
dini_FloatSet(house, "CarColor2", 0);
cInfo[houseid][GotCar] = 0;
print("-");
print("--------------House Created--------------");
printf("- Houseid: %d", houseid);
printf("- Buy Cost: %d", Costa);
printf("- Sell Cost: %d", Sella);
printf("- Interior: %d", Interiora);
printf("- VirtualWorld: %d", virtualworld);
print("-----------------------------------------");
print("-");
}
else
{
format(hInfo[houseid][Name], 24, dini_Get(house, "Name"));
format(hInfo[houseid][Renter], 24, dini_Get(house, "Renter"));
hInfo[houseid][Rentable] = dini_Int(house, "Rentable");
hInfo[houseid][Rentcost] = dini_Int(house, "Rentcost");
hInfo[houseid][Cost] = dini_Int(house, "Cost");
hInfo[houseid][Sell] = dini_Int(house, "Sell");
hInfo[houseid][Interior] = dini_Int(house, "Interior");
hInfo[houseid][Locked] = dini_Int(house, "Locked");
hInfo[houseid][InteriorX] = dini_Float(house, "X");
hInfo[houseid][InteriorY] = dini_Float(house, "Y");
hInfo[houseid][InteriorZ] = dini_Float(house, "Z");
hInfo[houseid][Virtualworld] = dini_Int(house, "Virtualworld");
}
hInfo[houseid][iconx]=iconX;
hInfo[houseid][icony]=iconY;
hInfo[houseid][iconz]=iconZ;
format(house, sizeof(house), "Houses/houseid%d",houseid);
if(strcmp(hInfo[playericonhouse[houseid]][Name],"ForSale",true)==0)
{
HousePickup[houseid] = CreatePickup(1273, 23, iconX, iconY, iconZ);//not bought
}
else
{
HousePickup[houseid] = CreatePickup(1272,23, iconX, iconY, iconZ);//bought
}
}

AddHouseCar(houseid, modelid, Float:Carx, Float:Cary, Float:Carz, color1, color2, respawn_delay)
{
new house[256];
format(house, sizeof(house), "Houses/houseid%d",houseid);
if(dini_Exists(house))
{
cInfo[houseid][GotCar] = 0;
if(!dini_Isset(house, "CarModel"))
{
dini_IntSet(house, "CarModel", modelid);
cInfo[houseid][CarModel] = modelid;
}
else
{
cInfo[houseid][CarModel] = dini_Int(house, "CarModel");
}
cInfo[houseid][CarX] = Carx;
cInfo[houseid][CarY] = Cary;
cInfo[houseid][CarZ] = Carz;
dini_FloatSet(house, "CarX", Carx);
dini_FloatSet(house, "CarY", Cary);
dini_FloatSet(house, "CarZ", Carz);
cInfo[houseid][CarColor1] = color1;
cInfo[houseid][CarColor2] = color2;
dini_IntSet(house, "CarColor1", color1);
dini_IntSet(house, "CarColor2", color2);
dini_IntSet(house, "Respawn_Delay", respawn_delay);
cInfo[houseid][Respawn_Delay] = respawn_delay;
cInfo[houseid][HouseCar] = CreateVehicle(cInfo[houseid][CarModel], Carx, Cary, Carz, 0.0, color1, color2, respawn_delay);
print("-");
print("--------------Car Created--------------");
printf("- Car Houseid: %d", houseid);
printf("- Modelid: %d", modelid);
printf("- Color 1: %d", color1);
printf("- Color 2: %d", color2);
printf("- Respawn Delay: %d", respawn_delay);
print("---------------------------------------");
print("-");

}
}
Also get a error:
Quote:

D:\Documents and Settings\Poul&Kira\Desktop\Server\filterscripts\CS-RPHouse.pwn(1021) : warning 203: symbol is never used: "AddHouseCar"

Please help me

also tryed #pragma unused AddHouseCar,strtok
and many other's

EDIT: sorry for smiley's dont know how to use this forum yet lol


Re: Simple House System by Antironix Need HELP - Jeffry - 16.03.2010

This is only a warning that this variable is never used in your script.
It is here, cause you used the /* */ on all AddHouseCars.
You can fix this, if you remove the /* */ or remove the function which you declared.

But if you decide to use it anywhen, you can simply ignore this.

Btw: use:
Code:
pawn Code:
here your code between



Re: Simple House System by Antironix Need HELP - KiraAndPoul - 16.03.2010

yea i know but i want to use the AddHouseCar and if i remove the /* */ i get

Quote:

CS-RPHouse.pwn(125) : warning 202: number of arguments does not match definition




Re: Simple House System by Antironix Need HELP - Jeffry - 16.03.2010

Change it to:

pawn Code:
AddHouseCar(20, 551, -22.3337, -2524.3574, 36.4443, 0, 91, 60);
Cause it is as you defined:
Code:
AddHouseCar(houseid, modelid, Float:Carx, Float:Cary, Float:Carz, color1, color2, respawn_delay)
So you have now:

Houseid: 20
Model: 551
XPos: -22
YPos: -2524
ZPos: 36
Col1: 0
Col2: 91
Respawn time: 60



Re: Simple House System by Antironix Need HELP - KiraAndPoul - 16.03.2010

sorry didnt understand that atall

all AddHouseCar(s)
is like defined AddHouseCar(houseid, modelid, Float:Carx, Float:Cary, Float:Carz, color1, color2, respawn_delay)

the problem i think is that it skips toattly the
Pawn code:
Quote:

AddHouseCar(houseid, modelid, Float:Carx, Float:Cary, Float:Carz, color1, color2, respawn_delay)
{
new house[256];
format(house, sizeof(house), "Houses/houseid%d",houseid);
if(dini_Exists(house))
{
cInfo[houseid][GotCar] = 0;
if(!dini_Isset(house, "CarModel"))
{
dini_IntSet(house, "CarModel", modelid);
cInfo[houseid][CarModel] = modelid;
}
else
{
cInfo[houseid][CarModel] = dini_Int(house, "CarModel");
}
cInfo[houseid][CarX] = Carx;
cInfo[houseid][CarY] = Cary;
cInfo[houseid][CarZ] = Carz;
dini_FloatSet(house, "CarX", Carx);
dini_FloatSet(house, "CarY", Cary);
dini_FloatSet(house, "CarZ", Carz);
cInfo[houseid][CarColor1] = color1;
cInfo[houseid][CarColor2] = color2;
dini_IntSet(house, "CarColor1", color1);
dini_IntSet(house, "CarColor2", color2);
dini_IntSet(house, "Respawn_Delay", respawn_delay);
cInfo[houseid][Respawn_Delay] = respawn_delay;
cInfo[houseid][HouseCar] = CreateVehicle(cInfo[houseid][CarModel], Carx, Cary, Carz, 0.0, color1, color2, respawn_delay);
print("-");
print("--------------Car Created--------------");
printf("- Car Houseid: %d", houseid);
printf("- Modelid: %d", modelid);
printf("- Color 1: %d", color1);
printf("- Color 2: %d", color2);
printf("- Respawn Delay: %d", respawn_delay);
print("---------------------------------------");
print("-");

}
}

Cause when i open the server it isnt saying ---:car created:--
like it does with the houses

EDIT: and tryed to change the

cInfo[houseid][CarModel] = dini_Int(house, "CarModel");
}

to

cInfo[houseid][CarModel] = dini_Int(house, "CarModel");
{
blablabla



Re: Simple House System by Antironix Need HELP - Jeffry - 16.03.2010

Hm, thats strange.
Maybe you should ask the creator of this script.
Or try if the cars will be created.


Re: Simple House System by Antironix Need HELP - KiraAndPoul - 16.03.2010

i tryed as you said remove the /* */ and remove the #pragma unused AddHouseCar,strtok

and change the
AddHouseCar(20, 551, -22.3337, -2524.3574, 36.4443, 0, 91, 5*60*1000); // Default Housecar
to
AddHouseCar(20, 551, -22.3337, -2524.3574, 36.4443, 0, 91, 60); // Default Housecar

now it's compiling without error's ill try to open the server and see if it's working brb

EDIT: Ehm. the car's arent appearing ingame


Re: Simple House System by Antironix Need HELP - Jeffry - 16.03.2010

Does this file exist?
Cause he checks here:
pawn Code:
format(house, sizeof(house), "Houses/houseid%d",houseid);
if(dini_Exists(house)) // here, if the file exist
"Houses/houseid%d"

But maybe you try to contact the Creator, or use AddStaticVehicle/CreateVehicle



Re: Simple House System by Antironix Need HELP - KiraAndPoul - 16.03.2010

I give up have no idea what to do and tryed that you said AddStaticVehicle/CreateVehicle
and didnt work either have no idea :S


Re: Simple House System by Antironix Need HELP - Jeffry - 16.03.2010

Quote:
Originally Posted by KiraAndPoul
have no idea :S
Same here. maybe you try another house system.