27.01.2019, 06:06
Код:
if(strcmp(option, "selltomarket", true) == 0)
{
for(new i; i < MAX_HOUSES; i++)
{
if(IsPlayerInRangeOfPoint(playerid, 2.0, HouseInfo[i][ExteriorPos][0], HouseInfo[i][ExteriorPos][1], HouseInfo[i][ExteriorPos][2]))
{
if(HouseInfo[i][server_ID] == PlayerInfo[playerid][HouseID])
{
new houseprice = HouseInfo[i][Price]*50/100;
format(str, sizeof(str), "You've sold your house for $%d!", houseprice);
SendClientMessage(playerid, COLOR_GREY, str);
DestroyDynamicPickup(HouseInfo[i][Pickup]);
DestroyDynamic3DTextLabel(HouseInfo[i][Label]);
HouseInfo[i][Pickup] = CreateDynamicPickup(1273, 23, HouseInfo[i][ExteriorPos][0], HouseInfo[i][ExteriorPos][1], HouseInfo[i][ExteriorPos][2], HouseInfo[i][ExteriorWorld]);
format(housestring, sizeof(housestring), "{70ff83}This house is for sell!\nPrice: %d\nType /buyhouse to buy it\nType /enter to go inside", HouseInfo[i][Price]);
HouseInfo[i][Label] = CreateDynamic3DTextLabel(housestring , COLOR_ORANGE, HouseInfo[i][ExteriorPos][0], HouseInfo[i][ExteriorPos][1], HouseInfo[i][ExteriorPos][2],30.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 7.0);
HouseInfo[i][ForSell] = 1;
HouseInfo[i][Locked] = 0;
GiveMoney(playerid, houseprice);
return 1;
}
return 1;
}
}
return 1;
}


