I am working with a house system selling to players but having this issue...
In this [/php]giveMoney(House[i][houseOwner],House[i][saleprice]); [/php] is not working
it is a number or id of the player that is saved in mysql
PHP Code:
if(House[i][forsale])
{
if(Player[playerid][playerMoney] >= House[i][saleprice] ) //&& Player[playerid][pID] == House[i][houseOwner]
{
new count = countplayerHouse(playerid);
if(count < maxhouse)
{
takeMoney(playerid, House[i][saleprice]);
giveMoney(House[i][houseOwner],House[i][saleprice]);
new nme[100];
format(nme,sizeof(nme),"Your house has been bought by %s",Player[playerid][Name]);
SendClientMessage(House[i][houseOwner],COLOR_YELLOW,nme);
House[i][houseOwner] = Player[playerid][pID];
House[i][houseOwned] = true;
House[i][forsale] = false;
House[i][saleprice] = House[i][housePrice];
format(msg, sizeof(msg), CHAT_INFO"[PRESS Y TO ENTER]\n"CHAT_WHITE"ID : "CHAT_YELLOW"%d\n"CHAT_WHITE"Owner : "CHAT_YELLOW"%s\n"CHAT_WHITE"Title : "CHAT_YELLOW"%s"CHAT_WHITE"\nLocation :"CHAT_YELLOW"%s", House[i][houseID], findName(House[i][houseOwner]), House[i][houseTitle], GetXY2DZone(House[i][housePos][0], House[i][housePos][1]));
DestroyDynamic3DTextLabel(House[i][houseLabel]);
House[i][houseLabel] = CreateDynamic3DTextLabel(msg, COLOR_WHITE, House[i][housePos][0], House[i][housePos][1], House[i][housePos][2] + 0.5, 10.0);
mysql_format(koneksi, msg, sizeof(msg), "UPDATE `house` SET `owner` = '%d',`forsale` = '0' ,`saleprice` = '%d',`owned` = '1' where `id` = '%d'", House[i][houseOwner],House[i][housePrice], House[i][houseID]);
mysql_query(koneksi, msg, false);
}
else
{
if(Player[playerid][english])
//Server(playerid, "You have reached max house.");
SendClientMessage(playerid,COLOR_RED,"You have reached maximum house limit.");
else
Server(playerid, "Kamu telah mencapai batas kepemilikan rumah.");
}
}
it is a number or id of the player that is saved in mysql