SA-MP Forums Archive
Invalid ID Help. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Invalid ID Help. (/showthread.php?tid=389737)



Invalid ID Help. - Laure - 03.11.2012

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;
}



Re: Invalid ID Help. - DBan - 03.11.2012

-delete pls-


Re: Invalid ID Help. - Laure - 03.11.2012

BUMP


Re: Invalid ID Help. - lamarr007 - 03.11.2012

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



Re: Invalid ID Help. - Laure - 03.11.2012

Didnt fix still the same.


Re: Invalid ID Help. - Laure - 03.11.2012

Helper anywhere?


Re: Invalid ID Help. - MrCoder - 03.11.2012

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


Re: Invalid ID Help. - Private200 - 03.11.2012

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


Re: Invalid ID Help. - tyler12 - 03.11.2012

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.


Re: Invalid ID Help. - Laure - 03.11.2012

Tried with the ii didn't work