27.11.2010, 12:10
its says im not close enought to a house when i am right on top of it
pawn Код:
if (strcmp("/buy", cmdtext) == 0)
{
for(new i = 0; i<MAX_HOUSES; i++)
{
if(IsPlayerInRangeOfPoint(playerid, 6.0, HouseInfo[i][PickupX], HouseInfo[i][PickupY], HouseInfo[i][PickupZ]))
{
new Pname[24]; GetPlayerName(playerid, Pname, 24);
if(strlen(dini_Get("Owned.ini", Pname)))
if(GetPlayerMoney(playerid) < HouseInfo[i][HouseCost]) return SendClientMessage(playerid, 0xF60000AA, "You don't have enough money to buy this house");
if(HouseInfo[i][Owned] == 1) return SendClientMessage(playerid, 0xF60000AA, "This house is already owned!");
GivePlayerMoney(playerid, - HouseInfo[i][HouseCost]);
GameTextForPlayer(playerid, "~r~House Purchased!", 2000, 3);
HouseInfo[i][Owned] = 1;
GetPlayerName(playerid, Pname, 24);
format(HouseInfo[i][HouseOwner], 24, "%s", Pname);
dini_Set("Owners.ini", Pname, HouseInfo[i][HouseNames]);
return 1;
}
SendClientMessage(playerid, 0xF60000AA, "You are not near enough to a house");
return 1;
}
return 1;
}