07.10.2010, 15:30
Sorry for double posting, but here's the right code.
I fixed the errors.
pawn Код:
if (strcmp("/sellhouse", cmdtext) == 0)
{
for(new i; i<MAX_HOUSES; i++)
{
if(IsPlayerInRangeOfPoint(playerid, 2, HouseInfo[i][PickupX], HouseInfo[i][PickupY], HouseInfo[i][PickupZ]))
{
new Pname[24]; GetPlayerName(playerid, Pname, 24);
if(strcmp(Pname, HouseInfo[i][HouseOwner]) != 0) return SendClientMessage(playerid, 0xF60000AA, "You don't own this house!");
GivePlayerMoney(playerid, -HouseInfo[i][HouseSell]);
GameTextForPlayer(playerid, "~r~House Sold!", 2000, 3);
HouseInfo[i][Owned] = 0;
HouseInfo[i][HouseOwner] = 0;
HouseInfo[i][PickupX] = 9999.9999;
HouseInfo[i][PickupY] = -9999.9999;
HouseInfo[i][PickupZ] = 9999.9999;
dini_Unset("Owners.ini", Pname);
return 1;
}
SendClientMessage(playerid, 0xF60000AA, "You are not close enough to a house");
return 1;
}
return 1;
}