if (PlayerData[playerid][pBusinessKey][0] == 0) return PlayerData[playerid][pBusinessKey][0] = id; if (PlayerData[playerid][pBusinessKey][1] == 0) return PlayerData[playerid][pBusinessKey][1] = id; if (PlayerData[playerid][pBusinessKey][2] == 0) return PlayerData[playerid][pBusinessKey][2] = id;
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) return PlayerData[playerid][pBusinessKey][0] = id; if (PlayerData[playerid][pBusinessKey][1] == 0) return PlayerData[playerid][pBusinessKey][1] = id; if (PlayerData[playerid][pBusinessKey][2] == 0) return PlayerData[playerid][pBusinessKey][2] = id; }
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;
}
if (PlayerData[playerid][pBusinessKey][0] == 0)
return PlayerData[playerid][pBusinessKey][0] = id;
else if (PlayerData[playerid][pBusinessKey][1] == 0)
return PlayerData[playerid][pBusinessKey][1] = id;
else (PlayerData[playerid][pBusinessKey][2] == 0)
return PlayerData[playerid][pBusinessKey][2] = id;
Please people, EXPLAIN where the error is, and not just paste up solutions, that MAY work, yet not teach him ANYTHING at all about why the issue is happening.
Fact is that every question he asks about is script related, and then he ends up not posting the information needed, even when asked about it. Really, this is why pasting solutions, does nothing. If you said "Read up on XXXX" then he'd go ****** and read. If you said "It's in this section of the script" he'll go ****** that, and read up on it. By posting up simple "fixes", with a simple "try this" it doesn't teach them anything except to copy and paste, after asking the simplest questions on the forums. |
Please people, EXPLAIN where the error is, and not just paste up solutions, that MAY work, yet not teach him ANYTHING at all about why the issue is happening.
Fact is that every question he asks about is script related, and then he ends up not posting the information needed, even when asked about it. Really, this is why pasting solutions, does nothing. If you said "Read up on XXXX" then he'd go ****** and read. If you said "It's in this section of the script" he'll go ****** that, and read up on it. By posting up simple "fixes", with a simple "try this" it doesn't teach them anything except to copy and paste, after asking the simplest questions on the forums. |
Better than posting up incorrect code and "hoping" that it works...
|