18.05.2017, 00:53
Hi ive a problem with my script. for some reason it wont load business houses gates or doors. The files are there. i didnt touch the script itself it just stopped loading them all of a sudden.
stock LoadBiz()
{
if(!fexist("biz.cfg")) fcreate("biz.cfg");
new binfo[12][32];
new string[256];
new File:file = fopen("biz.cfg", io_read);
if(file)
{
new idx = 1;
while(idx < MAX_BIZ)
{
fread(file, string);
split(string, binfo, '|');
BizInfo[idx][bType] = strval(binfo[0]);
BizInfo[idx][bStatus] = strval(binfo[1]);
format(BizInfo[idx][bOwner], 32, "%s", binfo[2]);
BizInfo[idx][bX] = floatstr(binfo[3]);
BizInfo[idx][bY] = floatstr(binfo[4]);
BizInfo[idx][bZ] = floatstr(binfo[5]);
BizInfo[idx][bMoney] = strval(binfo[6]);
BizInfo[idx][bProducts] = strval(binfo[7]);
BizInfo[idx][bSold] = strval(binfo[8]);
BizInfo[idx][bLevel] = strval(binfo[9]);
BizInfo[idx][bPrice] = strval(binfo[10]);
BizInfo[idx][bAP] = strval(binfo[11]);
if(BizInfo[idx][bType]) // If Business is owned
{
BizInfo[idx][bPickup] = CreateDynamicPickup(1272, 1, BizInfo[idx][bX], BizInfo[idx][bY], BizInfo[idx][bZ], 0);
if(!strcmp("The State", BizInfo[idx][bOwner])) format(string, sizeof(string), "Owner: %s\nBusiness Type: %s\nStatus: For Sale\nPrice: $%d", BizInfo[idx][bOwner], RBT(idx), BizInfo[idx][bPrice]);
else format(string, sizeof(string), "Business of %s\nBusiness type: %s\n%s", BizInfo[idx][bOwner], RBT(idx), RBS(idx));
BizInfo[idx][bText] = CreateDynamic3DTextLabel(string, COLOR_WHITE, BizInfo[idx][bX], BizInfo[idx][bY], BizInfo[idx][bZ]+0.3, 15);
}
idx++;
}
}
print("Businesses loaded successfully.");
return 1;
}
tock LoadHouses()
{
new binfo[21][32];
new string[256];
new File:file = fopen("houses.cfg", io_read);
if(file)
{
new idx = 1;
while(idx < MAX_HOUSES)
{
fread(file, string);
split(string, binfo, '|');
HouseInfo[idx][hLevel] = strval(binfo[0]);
HouseInfo[idx][hPrice] = strval(binfo[1]);
HouseInfo[idx][hStatus] = strval(binfo[2]);
format(HouseInfo[idx][hOwner], 32, "%s", binfo[3]);
HouseInfo[idx][hX] = floatstr(binfo[4]);
HouseInfo[idx][hY] = floatstr(binfo[5]);
HouseInfo[idx][hZ] = floatstr(binfo[6]);
HouseInfo[idx][hMoney] = strval(binfo[7]);
HouseInfo[idx][hMaterials] = strval(binfo[8]);
HouseInfo[idx][hWeed] = strval(binfo[9]);
HouseInfo[idx][hcocaine] = strval(binfo[10]);
HouseInfo[idx][hGun][0] = strval(binfo[11]);
HouseInfo[idx][hGunAmmo][0] = strval(binfo[12]);
HouseInfo[idx][hGun][1] = strval(binfo[13]);
HouseInfo[idx][hGunAmmo][1] = strval(binfo[14]);
HouseInfo[idx][hGun][2] = strval(binfo[15]);
HouseInfo[idx][hGunAmmo][2] = strval(binfo[16]);
HouseInfo[idx][hGun][3] = strval(binfo[17]);
HouseInfo[idx][hGunAmmo][3] = strval(binfo[18]);
HouseInfo[idx][hGun][4] = strval(binfo[19]);
HouseInfo[idx][hGunAmmo][4] = strval(binfo[20]);
if(HouseInfo[idx][hLevel])
{
HouseInfo[idx][hPickup] = CreateDynamicPickup(1273, 1, HouseInfo[idx][hX], HouseInfo[idx][hY], HouseInfo[idx][hZ], 0);
if(!strcmp("The State", HouseInfo[idx][hOwner])) format(string, sizeof(string), "Owner: %s\nHouse Type: %s\nFor Sale\nPrice: $%d", HouseInfo[idx][hOwner], HT(idx), HouseInfo[idx][hPrice]);
else format(string, sizeof(string), "{00C0FF}House of %s\nHouse Type: %s\nStatus: %s", HouseInfo[idx][hOwner], HT(idx), RHS(idx));
HouseInfo[idx][hText] = CreateDynamic3DTextLabel(string, COLOR_WHITE, HouseInfo[idx][hX], HouseInfo[idx][hY], HouseInfo[idx][hZ]+0.3, 15);
}
idx++;
}
}
print("Houses loaded successfully.");
return 1;
}
stock LoadGates()
{
new dinfo[15][128];
new string[256];
new File:file = fopen("gates.cfg", io_read);
if(file)
{
new idx = 1;
while(idx < MAX_GATES)
{
fread(file, string);
split(string, dinfo, '|');
GateInfo[idx][gModel] = strval(dinfo[0]);
GateInfo[idx][gCX] = floatstr(dinfo[1]);
GateInfo[idx][gCY] = floatstr(dinfo[2]);
GateInfo[idx][gCZ] = floatstr(dinfo[3]);
GateInfo[idx][gCRX] = floatstr(dinfo[4]);
GateInfo[idx][gCRY] = floatstr(dinfo[5]);
GateInfo[idx][gCRZ] = floatstr(dinfo[6]);
GateInfo[idx][gOX] = floatstr(dinfo[7]);
GateInfo[idx][gOY] = floatstr(dinfo[8]);
GateInfo[idx][gOZ] = floatstr(dinfo[9]);
GateInfo[idx][gORX] = floatstr(dinfo[10]);
GateInfo[idx][gORY] = floatstr(dinfo[11]);
GateInfo[idx][gORZ] = floatstr(dinfo[12]);
format(GateInfo[idx][gPassword], 256, "%s", dinfo[13]);
GateInfo[idx][gSpeed] = floatstr(dinfo[14]);
if(GateInfo[idx][gModel]) // If gate exists
{
GateInfo[idx][gGate] = CreateDynamicObject(GateInfo[idx][gModel], GateInfo[idx][gCX], GateInfo[idx][gCY], GateInfo[idx][gCZ], GateInfo[idx][gCRX], GateInfo[idx][gCRY], GateInfo[idx][gCRZ]);
GateInfo[idx][gStatus] = 0;
}
idx++;
}
}
print("Gates loaded successfully.");
return 1;
}
stock LoadDoors()
{
new dinfo[16][128];
new string[256];
new File:file = fopen("doors.cfg", io_read);
if(file)
{
new idx = 0;
while(idx < MAX_DOORS)
{
fread(file, string);
split(string, dinfo, '|');
DoorInfo[idx][dType] = strval(dinfo[0]);
DoorInfo[idx][dOX] = floatstr(dinfo[1]);
DoorInfo[idx][dOY] = floatstr(dinfo[2]);
DoorInfo[idx][dOZ] = floatstr(dinfo[3]);
DoorInfo[idx][dIX] = floatstr(dinfo[4]);
DoorInfo[idx][dIY] = floatstr(dinfo[5]);
DoorInfo[idx][dIZ] = floatstr(dinfo[6]);
DoorInfo[idx][dOInt] = strval(dinfo[7]);
DoorInfo[idx][dOVW] = strval(dinfo[8]);
DoorInfo[idx][dIInt] = strval(dinfo[9]);
DoorInfo[idx][dIVW] = strval(dinfo[10]);
DoorInfo[idx][dCInt] = strval(dinfo[11]);
DoorInfo[idx][dCExt] = strval(dinfo[12]);
DoorInfo[idx][dIA] = floatstr(dinfo[13]);
format(DoorInfo[idx][dText], 128, "%s", dinfo[14]);
DoorInfo[idx][dOA] = floatstr(dinfo[15]);
if(DoorInfo[idx][dType]) // If door exists
{
DoorInfo[idx][dPickup] = CreateDynamicPickup(DoorInfo[idx][dType], 1, DoorInfo[idx][dOX], DoorInfo[idx][dOY], DoorInfo[idx][dOZ], DoorInfo[idx][dOVW], DoorInfo[idx][dOInt]);
format(string, sizeof(string), "ID: %d\n%s", idx, DoorInfo[idx][dText]);
DoorInfo[idx][dTextID] = CreateDynamic3DTextLabel(string, COLOR_WHITE, DoorInfo[idx][dOX], DoorInfo[idx][dOY], DoorInfo[idx][dOZ]+0.3, 15);
}
idx++;
}
}
print("Doors loaded successfully.");
return 1;
}
[18:23:15] Static vehicles loaded. [18:23:15] Static objects loaded. [18:23:15] Dynamic vehicles loaded successfully. [18:23:15] Objects loaded successfully. [18:23:15] Objects loaded successfully. [18:23:15] LSPD files loaded successfully. [18:23:15] Government files loaded successfully. [18:23:15] Hitman Agency files loaded successfully. [18:23:15] News Agency files loaded successfully. [18:23:15] LSFMD files loaded successfully. [18:23:15] RCPD files loaded successfully. [18:23:15] NG files loaded successfully.
[17:08:14] Static vehicles loaded. [17:08:14] Static objects loaded. [17:08:14] Dynamic vehicles loaded successfully. [17:08:14] Objects loaded successfully. [17:08:15] Objects loaded successfully. [17:08:15] LSPD files loaded successfully. [17:08:15] Government files loaded successfully. [17:08:15] Hitman Agency files loaded successfully. [17:08:15] News Agency files loaded successfully. [17:08:15] LSFMD files loaded successfully. [17:08:15] RCPD files loaded successfully. [17:08:15] NG files loaded successfully. [17:08:15] Families loaded successfully. [17:08:15] Points loaded successfully. [17:08:15] Businesses loaded successfully. [17:08:15] Houses loaded successfully. [17:08:15] Garages loaded successfully. [17:08:15] Doors loaded successfully. [17:08:15] Gates loaded successfully. [17:08:15] Doors loaded successfully. [17:08:15] Arrest Point loaded successfully.