13.10.2012, 10:23
(
Последний раз редактировалось RenovanZ; 22.11.2012 в 11:21.
)
Removed
if(GetPlayerMoney(playerid) < BusinessInfo[id][bPrice])
CMD:buybiz(playerid, params[]) { if(gPlayerLogged[playerid] == 0) return 1; new id = IsPlayerNearBizEnt(playerid); if(id == -1 || id == 0) return SendClientMessage(playerid, COLOR_GREY, "You are not near a biz"); if(BusinessInfo[id][bOwned] != 0 || BusinessInfo[id][bPrice] == 0) return SendClientMessage(playerid, COLOR_GREY, "This biz is not for sale."); if(PlayerInfo[playerid][BizID] != 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You already own a biz."); if(PlayerInfo[playerid][pCash] < BusinessInfo[id][bPrice]) return SendClientMessage(playerid, COLOR_LIGHTRED, "Sorry, you can not afford this biz."); if(GetPlayerMoney(playerid) > BusinessInfo[id][bPrice]) PlayerInfo[playerid][BizID] = id; PlayerInfo[playerid][pCash] -= BusinessInfo[id][bPrice]; GivePlayerMoney(playerid, -BusinessInfo[id][bPrice]); BusinessInfo[id][bLocked] = 0; BusinessInfo[id][bOwned] = 1; BusinessInfo[id][bOwner] = RemoveUnderScore(playerid); SendClientMessage(playerid, COLOR_YELLOW, "Congratulations on your new biz! Use /bizhelp to get help, or /ask!"); return 1; }
CMD:buybiz(playerid, params[])
{
if(gPlayerLogged[playerid] == 0) return 1;
new id = IsPlayerNearBizEnt(playerid);
if(id == -1 || id == 0) return SendClientMessage(playerid, COLOR_GREY, "You are not near a biz");
if(BusinessInfo[id][bOwned] != 0 || BusinessInfo[id][bPrice] == 0) return SendClientMessage(playerid, COLOR_GREY, "This biz is not for sale.");
if(PlayerInfo[playerid][BizID] != 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You already own a biz.");
if(GetPlayerMoney(playerid) < BusinessInfo[id][bPrice]) return SendClientMessage(playerid, COLOR_LIGHTRED, "Sorry, you can not afford this biz.");
PlayerInfo[playerid][BizID] = id;
PlayerInfo[playerid][pCash] -= BusinessInfo[id][bPrice];
GivePlayerMoney(playerid, -BusinessInfo[id][bPrice]);
BusinessInfo[id][bLocked] = 0;
BusinessInfo[id][bOwned] = 1;
BusinessInfo[id][bOwner] = RemoveUnderScore(playerid);
SendClientMessage(playerid, COLOR_YELLOW, "Congratulations on your new biz! Use /bizhelp to get help, or /ask!");
return 1;
}