03.11.2012, 11:18
Hi there,I tried to make a Command that fills a business on command performed by admin but any valid Biz id i choose it says Invalid Business ID think i have something wrong with the line with Invalid Business ID in the Command So Can please help me?The code
Код:
CMD:giveproducts(playerid, params[]) { new amount, idx, string[128]; if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command."); if(PlayerInfo[playerid][pAdmin] < 4) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command."); if(sscanf(params, "i", amount, idx)) return SendClientMessage(playerid, COLOR_WHITE, "[Usage]: /giveproducts [bizid] [amount]"); foreach(Player, i) if(!BizInfo[idx][bType]) return SendClientMessage(playerid, COLOR_GREY, "Invalid Business ID."); BizInfo[idx][bProducts] = amount; format(string, sizeof(string), "AdmInfo: %s has set business id %d's products to %d.(Owner: %s)", RPN(playerid), idx, amount, BizInfo[idx][bOwner]); SendAdminMessage(COLOR_DARKRED, 1, string); return 1; }