house buy problem
#1

Hello, it's about a house system..

When i type a command /buyhouse [id]

if I type a house, first time will work fine.. but after that, it will say it is already owned

Код:
CMD:buyhouse(playerid, params[])
{
	{
	    if(sscanf(params, "i", hInfo[playerid][HouseID]))
	    {
	    
     	Error(playerid, "Invalid house ID.");
		}
		
		else if(hInfo[playerid][HouseOwned] == 1)
		return Error(playerid, "This house is already owned by someone else");


		else
		BuyHouse(playerid);
	}
	return 1;
}

BuyHouse(playerid)
{
	hInfo[playerid][HouseOwned] = 1;
	new pqname[24];
	GetPlayerName(playerid, pqname, 24);
	new queryq[96];
	format(queryq, sizeof(queryq), "UPDATE `houses` SET `HouseOwner` = '%s', `HouseOwned` = '1' WHERE `HouseID` = '%d' ", pqname, hInfo[playerid][HouseID]);
	mysql_tquery(dbHandle, queryq);
}
Like i type /buyhouse 1

If I type /buyhouse 2 then, it will say its already bought, while its not
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)