09.04.2017, 21:04
PHP код:
stock LoadHouses()
{
new hinfo[21][32];
new string[256];
new File:file = fopen("ODA/houses.cfg", io_read);
if(file)
{
new idx = 1;
while(idx < MAX_HOUSES)
{
fread(file, string);
split(string, hinfo, '|');
HouseInfo[idx][hLevel] = strval(hinfo[0]);
HouseInfo[idx][hPrice] = strval(hinfo[1]);
HouseInfo[idx][hStatus] = strval(hinfo[2]);
format(HouseInfo[idx][hOwner], 32, "%s", hinfo[3]);
HouseInfo[idx][hX] = floatstr(hinfo[4]);
HouseInfo[idx][hY] = floatstr(hinfo[5]);
HouseInfo[idx][hZ] = floatstr(hinfo[6]);
HouseInfo[idx][hMoney] = strval(hinfo[7]);
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), "[House ID: %d, House (Lvl: %d)]\n Owner: %s\n Status: For Sale\n$%d", idx, HouseInfo[idx][hLevel], HouseInfo[idx][hOwner], HouseInfo[idx][hPrice]);
else format(string, sizeof(string), "[House ID: %d, House (Lvl: %d)]\n Owner: %s\n Status: %s", idx, HouseInfo[idx][hLevel], HouseInfo[idx][hOwner], RHS(idx));
HouseInfo[idx][hText] = CreateDynamic3DTextLabel(string, -1, HouseInfo[idx][hX], HouseInfo[idx][hY], HouseInfo[idx][hZ]+0.3, 15);
}
idx++;
}
}
print("Houses loaded successfully.");
return 1;
}
Well sorry to inform you but i use what i can manage... Doesn't make sense for me to be posting for help everyday cause i dont know shit about SQL