17.02.2013, 09:46
Hello everybody.I got problem.My friend made House system.He borrow it to me too.But owner name was in Integer.But Now I don`t know how to switch that integer to classic string.Also..I got problem with label.So when players name who is owning that house is Sanady in game is writed S,=,; .I don`t know why.Here is picture.

And code is :
Take a look,and help me if you know how to.
Thanks Sanady.

And code is :
pawn Код:
forward LoadHouses();
public LoadHouses()
{
mysql_query("SELECT * FROM samp_houses");
mysql_store_result();
if(mysql_num_rows())
{
new tmp[256], houseid;
while(mysql_retrieve_row())
{
mysql_get_field("Owner", hInfo[houseid][hOwner]);
mysql_get_field("EnterX", tmp); hInfo[houseid][hEnterX] = floatstr(tmp);
mysql_get_field("EnterY", tmp); hInfo[houseid][hEnterY] = floatstr(tmp);
mysql_get_field("EnterZ", tmp); hInfo[houseid][hEnterZ] = floatstr(tmp);
mysql_get_field("ExitX", tmp); hInfo[houseid][hExitX] = floatstr(tmp);
mysql_get_field("ExitY", tmp); hInfo[houseid][hExitY] = floatstr(tmp);
mysql_get_field("ExitZ", tmp); hInfo[houseid][hExitZ] = floatstr(tmp);
mysql_get_field("Interior", tmp); hInfo[houseid][hInterior] = strval(tmp);
mysql_get_field("World", tmp); hInfo[houseid][hWorld] = strval(tmp);
mysql_get_field("Locked", tmp); hInfo[houseid][hLocked] = strval(tmp);
mysql_get_field("Price", tmp); hInfo[houseid][hPrice] = strval(tmp);
mysql_get_field("OnSale", tmp); hInfo[houseid][hOnSale] = strval(tmp);
if(hInfo[houseid][hOwner] == 0 || hInfo[houseid][hOnSale] == 1)
{
format(tmp, sizeof(tmp), "[House for sale]\n{FFFFFF}Owner: %s\nPrice: $%d", hInfo[houseid][hOwner],hInfo[houseid][hPrice]);
HouseText[houseid] = Create3DTextLabel(tmp, 0xFFBF00FF, hInfo[houseid][hEnterX], hInfo[houseid][hEnterY], hInfo[houseid][hEnterZ],40.0,0, 1);
}
else
{
format(tmp, sizeof(tmp), "[House]\n{FFFFFF}Owner: {FFFFFF}%s",hInfo[houseid][hOwner]);
HouseText[houseid] = Create3DTextLabel(tmp, 0xFFBF00FF, hInfo[houseid][hEnterX], hInfo[houseid][hEnterY], hInfo[houseid][hEnterZ],40.0,0, 1);
}
houseid++;
}
printf("Loaded houses: %d", houseid);
}
mysql_free_result();
return 1;
}
Thanks Sanady.