14.01.2012, 11:37
Ok so i wanted to make a sell house command but i dont know how to get the house owner.... this is what im trying to:
Anyone has an idea ? if the owner was matching with database it should sell but i cant assign string to string but i dont know how to do it else way :S Thanks in advance
pawn Код:
CMD:sellhouse(playerid, params[])
{
new name[42], string[128], owner[40];
GetPlayerName(playerid, name, sizeof(name));
for(new i; i < MAX_HOUSES; i++)
{
if(IsPlayerInRangeOfPoint(playerid, 2.5, AHouseData[i][HouseX],AHouseData[i][HouseY],AHouseData[i][HouseZ]))
{
if(strlen(AHouseData[i][Owner]) > 0)
{
format(string, sizeof(string), "SELECT Houseowner = '%s' FROM Houses WHERE ID = '%d'", owner, i);
mysql_query(string);
mysql_store_result();
if(AHouseData[i][Owner] == owner)
{
}
}
}
}
return 1;
}