Invalid ID Help.
#1

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;
}
Reply
#2

-delete pls-
Reply
#3

BUMP
Reply
#4

pawn Код:
if(sscanf(params, "ii", amount, idx)) return SendClientMessage(playerid, COLOR_WHITE, "[Usage]: /giveproducts [bizid] [amount]");
Reply
#5

Didnt fix still the same.
Reply
#6

Helper anywhere?
Reply
#7

pawn Код:
if(sscanf(params, "ui", amount, idx)) return SendClientMessage(playerid, COLOR_WHITE, "[Usage]: /giveproducts [bizid] [amount]");
If it does not work, update your sscanf.
Reply
#8

Update plugins , they are outdated , and i think it use only ip 0 right ?

If it is like that , then the problem is with your plugins update them and please , don't flood on forum
Reply
#9

Quote:
Originally Posted by MrCoder
Посмотреть сообщение
pawn Код:
if(sscanf(params, "ui", amount, idx)) return SendClientMessage(playerid, COLOR_WHITE, "[Usage]: /giveproducts [bizid] [amount]");
If it does not work, update your sscanf.
The sscanf specifier, u, is for Playerid's/names
Код:
u			User name/id (bots and players)
Your checking the business type, not the ID.

You also need
PHP код:
 if(sscanf(params"ii"amountidx)) return SendClientMessage(playeridCOLOR_WHITE"[Usage]: /giveproducts [bizid] [amount]"); 
as there's 2 parameters.
Reply
#10

Tried with the ii didn't work
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)