30.09.2015, 18:33
try this i hope it will work
PHP код:
else if ((id = Business_Nearest(playerid)) != -1)
{
if (Business_GetCount(playerid) >= MAX_OWNABLE_BUSINESSES)
return SendErrorMessage(playerid, "You can only own %d businesses at a time.", MAX_OWNABLE_BUSINESSES);
if (BusinessData[id][bizOwner] != 0)
return SendErrorMessage(playerid, "This business is already owned at the moment.");
if (BusinessData[id][bizPrice] > GetMoney(playerid))
return SendErrorMessage(playerid, "You have insufficient funds for the purchase.");
BusinessData[id][bizOwner] = GetPlayerSQLID(playerid);
Business_Refresh(id);
Business_Save(id);
GiveMoney(playerid, -BusinessData[id][bizPrice]);
SendServerMessage(playerid, "You have purchased \"%s\" for %s!", BusinessData[id][bizName], FormatNumber(BusinessData[id][bizPrice]));
ShowPlayerFooter(playerid, "You have ~g~purchased~w~ a business!");
Log_Write("logs/biz_log.txt", "[%s] %s has purchased business ID: %d for %s.", ReturnDate(), ReturnName(playerid), id, FormatNumber(BusinessData[id][bizPrice]));
if(PlayerData[playerid][pBusinessKey][0] == 0) PlayerData[playerid][pBusinessKey][0] = id;
else if(PlayerData[playerid][pBusinessKey][1] == 0) PlayerData[playerid][pBusinessKey][1] = id;
else if(PlayerData[playerid][pBusinessKey][2] == 0) PlayerData[playerid][pBusinessKey][2] = id;
}