26.02.2014, 13:38
pawn Код:
CMD:buybiz(playerid, params[])
{
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][Money] < BusinessInfo[id][bPrice]) return SendClientMessage(playerid, COLOR_LIGHTRED, "Sorry, you can not afford this biz.");
PlayerInfo[playerid][BizID] = id;
PlayerInfo[playerid][Money] -= 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;
}
pawn Код:
(80008) : error 017: undefined symbol "IsPlayerNearBizEnt"
(80012) : error 017: undefined symbol "BusinessInfo"
(80012) : warning 215: expression has no effect
(80012) : error 001: expected token: ";", but found "]"
(80012) : error 029: invalid expression, assumed zero
(80012) : fatal error 107: too many error messages on one line
Lines with errors:
pawn Код:
Line 80008: new id = IsPlayerNearBizEnt(playerid);
Line 80012: if(BusinessInfo[id][bOwned] != 0 || BusinessInfo[id][bPrice] == 0) return SendClientMessage(playerid, COLOR_GREY, "This biz is not for sale.");