house buy problem
#8

Made some changes

Код:
CMD:buyhouse(playerid, params[])
{
	new hid, pqname[24], queryq[69], queryqq[96];
	
	{
	    if(sscanf(params, "i", hid))
	    {
	    
     	Error(playerid, "Invalid house ID.");
		}
		
		
		else if(hInfo[houseid][HouseOwned] == 1)
		{
		cache_get_field_content_int(hid, "HouseID", hInfo[houseid][HouseID]);
		Error(playerid, "This house is already owned by someone else");
		}

		else
		GetPlayerName(playerid, pqname, 24);
		format(queryq, sizeof(queryq), "UPDATE `houses` SET `HouseOwned` = '1' WHERE `HouseID` = '%d' ", hInfo[houseid][HouseID]);
		format(queryqq, 96, "INSERT * INTO `houses` (`HouseOwner`) VALUES ('%s') WHERE `HouseID` = '%d'", pqname, hInfo[houseid][HouseID]);
		mysql_tquery(dbHandle, queryq);
	}
	return 1;
}
But the owner's name isn't even being inserted in the MySQL


Nor the HouseOwned value is being updated to 1..
Reply


Messages In This Thread
house buy problem - by div - 08.07.2018, 12:39
Re: house buy problem - by Trevor19012 - 08.07.2018, 12:43
Re: house buy problem - by Florin48 - 08.07.2018, 12:49
Re: house buy problem - by Rolux - 08.07.2018, 12:51
Re: house buy problem - by Florin48 - 08.07.2018, 12:59
Re: house buy problem - by div - 08.07.2018, 13:00
Re: house buy problem - by Rolux - 08.07.2018, 13:07
Re: house buy problem - by div - 08.07.2018, 13:08
Re: house buy problem - by Florin48 - 08.07.2018, 13:14
Re: house buy problem - by div - 08.07.2018, 13:31

Forum Jump:


Users browsing this thread: 1 Guest(s)