stock GetHouse2DZone(id, zone[], len)
{
new Float:x = haz[id][EnterX], Float:y = haz[id][EnterY];
for(new i = 0; i != sizeof(SanAndreasZones); i++ )
{
if(x >= SanAndreasZones[Zone_Area][0] && x <= SanAndreasZones[Zone_Area][3] && y >= SanAndreasZones[Zone_Area][1] && y <= SanAndreasZones[Zone_Area][4])
return format(zone, len, SanAndreasZones[Zone_Name], 0);
}
return 0;
}
stock CreateSaveHouse(name[],id,price,level,vw,Float:PosX,Float:PosY,Float:PosZ)
{
new dFile[32],string[200],number = randomEx(1000,9999);
new zone[48];
new Year, Month, Day;
getdate(Year, Month, Day);
GetHouse2DZone(id, zone, 48);
format(dFile, 35, mappa, id);
new
INI:File = INI_Open(dFile);
INI_WriteFloat(File, \"EnterX\", PosX);
INI_WriteFloat(File, \"EnterY\", PosY);
INI_WriteFloat(File, \"EnterZ\", PosZ);
INI_WriteFloat(File, \"ExitX\", 223.42928466797);
INI_WriteFloat(File, \"ExitY\", 1287.3064941406);
INI_WriteFloat(File, \"ExitZ\", 1082.14);
INI_WriteString(File, \"HouseName\", name);
INI_WriteString(File, \"Owner\", \"Reszleg\");
INI_WriteInt(File, \"Price\", price);
INI_WriteInt(File, \"Level\", level);
INI_WriteInt(File, \"Interior\", 1);
INI_WriteInt(File, \"VW\", vw);
INI_WriteInt(File, \"On_Sell\", 1);
INI_WriteInt(File, \"Lock\", 0);
INI_WriteInt(File, \"RentPrice\", 100);
INI_WriteString(File, \"PlayerRent\", \"Nobody\");
INI_WriteInt(File, \"Money\", 0);
INI_WriteInt(File, \"Gun1\", 0);
INI_WriteInt(File, \"Gun2\", 0);
INI_WriteInt(File, \"Ammo1\", 0);
INI_WriteInt(File, \"Ammo2\", 0);
INI_WriteString(File, \"LockPass\", \"1111\");
INI_WriteFloat(File, \"hCarX\", 0);
INI_WriteFloat(File, \"hCarY\", 0);
INI_WriteFloat(File, \"hCarZ\", 0);
INI_WriteFloat(File, \"hCarA\", 0);
INI_WriteInt(File, \"hCarC1\", 0);
INI_WriteInt(File, \"hCarC2\", 0);
INI_WriteInt(File, \"hCarID\", 0);
INI_WriteInt(File, \"hCarMoney\",0);
INI_WriteInt(File, \"hCarGun1\",0);
INI_WriteInt(File, \"hCarGun2\",0);
INI_WriteInt(File, \"hCarAmmo1\", 0);
INI_WriteInt(File, \"hCarAmmo2\", 0);
format(string,sizeof(string),\"%d\",number);
INI_WriteString(File, \"PhoneNum\", string);
format(string,sizeof(string),\"%s %d\",zone,id);
INI_WriteString(File, \"Address\", string);
INI_WriteInt(File, \"DayEnter\", Day);
INI_WriteInt(File, \"MonthEnter\", Month);
INI_Close(File);
haz[id][EnterX] = PosX;
haz[id][EnterY] = PosY;
haz[id][EnterZ] = PosZ;
haz[id][ExitX] = 223.42928466797;
haz[id][ExitY] = 1287.3064941406;
haz[id][ExitZ] = 1082.14;
format(haz[id][HouseName],48,\"%s\",name);
format(haz[id][Owner],48,\"Reszleg\");
haz[id][Price] = price;
haz[id][Level] = level;
haz[id][intID] = 1;
haz[id][VW] = vw;
haz[id][On_Sell] = 1;
haz[id][Lock] = 0;
haz[id][RentPrice] = 100;
format(haz[id][Player_Rent],48,\"Nobody\");
haz[id][Money] = 0;
haz[id][Gun1] = 0;
haz[id][Gun2] = 0;
haz[id][Ammo1] = 0;
haz[id][Ammo2] = 0;
format(haz[id][LockPass],48,\"1111\");
haz[id][hCarX] = 0;
haz[id][hCarY] = 0;
haz[id][hCarZ] = 0;
haz[id][hCarA] = 0;
haz[id][hCarC1] = 0;
haz[id][hCarC2] = 0;
haz[id][hCarID] = 0;
haz[id][hCarMoney] = 0;
haz[id][hCarGun1] = 0;
haz[id][hCarGun2] = 0;
haz[id][hCarAmmo1] = 0;
haz[id][hCarAmmo2] = 0;
format(haz[id][PhoneNum],5,\"%d\",number);
format(haz[id][Address],32,\"%s %d\",zone,id);
haz[id][DayEnter] = Day;
haz[id][MonthEnter] = Month;
haz[id][PickupU] = CreateDynamicPickup(1273, 23, PosX,PosY,PosZ,-1,-1,-1,100.0);
format(string,sizeof(string),\"{29CC3F}\\n{29CC3F}Ház neve: %s\\n{29CC3F}Ár: %d\\n{29CC3F}Szint: %d\\n{29CC3F}Cím: %s %d\\n (/buyhouse)\",name,price,level,zone,id);
haz[id][DLabel] = CreateDynamic3DTextLabel(string, 0xFFFFFF, PosX,PosY,PosZ, 100, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 100);
haz[id][icon] = CreateDynamicMapIcon(PosX,PosY,PosZ, 31, 0, -1, -1, -1, 100.0);
}