08.07.2018, 12:39
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
Like i type /buyhouse 1
If I type /buyhouse 2 then, it will say its already bought, while its not
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);
}
If I type /buyhouse 2 then, it will say its already bought, while its not


