23.01.2013, 20:01
pawn Код:
forward LoadCreatedHouses(houseid, name[], value[]);
public LoadCreatedHouses(houseid, name[], value[])
{
if(!strcmp(name, "HouseOwner")) strset(HouseData[houseid][E_HOUSE_OWNER], value);
if(!strcmp(name, "House_IntUID")) HouseData[houseid][E_HOUSE_INT_UID] = strval(value);
if(!strcmp(name, "HouseCost")) HouseData[houseid][E_HOUSE_COST] = strval(value);
if(!strcmp(name, "HouseLocked")) HouseData[houseid][E_HOUSE_LOCKED] = strval(value);
if(!strcmp(name, "HouseDescription")) strset(HouseData[houseid][E_HOUSE_DESCRIPTION], value);
if(!strcmp(name, "HouseInX")) HouseData[houseid][E_HOUSE_IN][0] = floatstr(value);
if(!strcmp(name, "HouseInY")) HouseData[houseid][E_HOUSE_IN][1] = floatstr(value);
if(!strcmp(name, "HouseInZ")) HouseData[houseid][E_HOUSE_IN][2] = floatstr(value);
if(!strcmp(name, "HouseInA")) HouseData[houseid][E_HOUSE_IN][3] = floatstr(value);
if(!strcmp(name, "HouseInInt")) HouseData[houseid][E_HOUSE_IN_INT] = strval(value);
if(!strcmp(name, "HouseInVW")) HouseData[houseid][E_HOUSE_IN_VW] = strval(value);
if(!strcmp(name, "HouseOutX")) HouseData[houseid][E_HOUSE_OUT][0] = floatstr(value);
if(!strcmp(name, "HouseOutY")) HouseData[houseid][E_HOUSE_OUT][1] = floatstr(value);
if(!strcmp(name, "HouseOutZ")) HouseData[houseid][E_HOUSE_OUT][2] = floatstr(value);
if(!strcmp(name, "HouseOutA")) HouseData[houseid][E_HOUSE_OUT][3] = floatstr(value);
if(!strcmp(name, "HouseOutInt")) HouseData[houseid][E_HOUSE_OUT_INT] = strval(value);
if(!strcmp(name, "HouseOutVW")) HouseData[houseid][E_HOUSE_OUT_VW] = strval(value);
PickupUID[houseid] = CreatePickup(19198, 1, HouseData[houseid][E_HOUSE_OUT][0], HouseData[houseid][E_HOUSE_OUT][1], HouseData[houseid][E_HOUSE_OUT][2]+0.5, HouseData[houseid][E_HOUSE_OUT_VW]);
new string[128];
format(string, sizeof(string), "Właściciel: \"%s\"\nKoszt: %d\nOpis: \"%s\"", HouseData[houseid][E_HOUSE_OWNER], HouseData[houseid][E_HOUSE_COST], HouseData[houseid][E_HOUSE_DESCRIPTION]);
HouseData[houseid][E_HOUSE_LABEL] = Create3DTextLabel(string, 0xFFC973FF, HouseData[houseid][E_HOUSE_OUT][0], HouseData[houseid][E_HOUSE_OUT][1], HouseData[houseid][E_HOUSE_OUT][2], 3.0, HouseData[houseid][E_HOUSE_OUT_VW], 0);
return true;
}
stock LoadHouses()
{
for(new i = 0; i != MAX_HOUSES; i++)
{
INI_ParseFile(HouseFile(i), "LoadCreatedHouses", .bExtra = true, .extra = i);
}
}
pawn Код:
PickupUID[houseid]
P.S
Can't open/close houses as well, so that seems like script just doesn't get it that i loaded some houses. I tried debugging and it said it has loaded some files and the ids was right.