PHP код:
CMD:buyhouse(playerid, params[])
{
new bool: in_range;
for(new a; a != HouseLoad; ++a)
{
if(IsPlayerInRangeOfPoint(playerid, 3.0, HouseInfo[a][EntranceX], HouseInfo[a][EntranceY], HouseInfo[a][EntranceZ]))
{
if(HouseInfo[a][HousePrice] > GetPlayerMoney(playerid)) return SendClientMessage(playerid, COLOR_RED, "You don't have enough money!");
new draw[200];
format(draw,sizeof(draw),"ID: %i\nPrice %i\nOwned: Yes\nOwner: %s",PlayerName(playerid));
new query[200];
format(query, sizeof(query), "UPDATE houses SET owner='%s', owned='true', text='%s' WHERE id='%i'", PlayerName(playerid), draw, HouseInfo[a][HouseID]);
mysql_query(1, query);
Update3DTextLabelText(HouseLabel, COLOR_GREEN, HouseInfo[a][HouseText]);
GivePlayerMoney(playerid, -HouseInfo[a][HousePrice]);
PlayerInfo[playerid][pHouseID] = HouseInfo[a][HouseID];
SendClientMessage(playerid, COLOR_GREEN, "You've bought this house successfully!");
in_range = true;
break;
}
}
if (!in_range) SendClientMessage(playerid, COLOR_RED, "You are not near any house");
return 1;
}
By the way, I don't know about the update thing you mentioned but the query seems correct and there is a WHERE clause. Print the query and execute it through phpMyAdmin, does it update only for that specific house?