18.03.2015, 15:30
(
Последний раз редактировалось Sc0pion; 19.03.2015 в 11:29.
)
Fixed!
pInfo[playerid][Houses] ++;
if(pInfo[playerid][Houses] > 3) return SendClientMessage(playerid, -1, "You already have 3 houses.");
#define MAX_HOUSES 3
if(pHouses[playerid] > MAX_HOUSES) return SendClientMessage(playerid, -1, "You have the maximum amount of houses.");
stock IsPlayerAllowedToBuyHouse(playerid)
{
new count, name[MAX_PLAYER_NAME], bool:state = false;
GetPlayerName(playerid, name, MAX_PLAYER_NAME);
for(new i = 0; i < MAX_HOUSES; i ++)
{
if(strcmp(hInfo[i][Owner], name, true) == 0) count ++;
if(count == 3)
{
state = true;
break;
}
}
if(state == true) return false;
return true;
}
if(!IsPlayerAllowedToBuyHouse(playerid)) return SendClientMessage(playerid, -1, "You can't purchase another house, sell one first!");
new pHouses[MAX_PLAYERS];