Create biz Error/bug
#1

Hey guys,
When I type /createbiz in game it says you must choose from 1-8 and I do but like Ill do /createbiz 1 and it still says "Business's ..... 1-8" Can you guys help me out?
Код:
CMD:createbiz(playerid, params[])
{
	new type, string[128];
	if(PlayerInfo[playerid][pAdmin] < 4)
	if(sscanf(params, "i", type))
	{
		SendClientMessage(playerid, COLOR_WHITE, "USAGE: /createbiz [type]");
        SendClientMessage(playerid, COLOR_GREY, "TYPES: 1) 24/7 | 2) Clothes Shop | 3) Ammunation | 4) Club");
		SendClientMessage(playerid, COLOR_GREY,	"TYPES: | 5) Advertisement Agency[Buggd] | 6) Fast Food | 7) Gym | 8) VIP");
		return 1;
	}
	if(type < 1 || type > 8) return SendClientMessage(playerid, COLOR_GREY, "Businesses are between 1 and 8.");
	for(new idx=1; idx<MAX_BIZ; idx++)
	{
	    if(!BizInfo[idx][bType])
		{
		    // Getting Business Setup
		    new Float:X, Float:Y, Float:Z;
		    GetPlayerPos(playerid, X, Y, Z);
		    // Making Business
		    BizInfo[idx][bType] = type;
		    format(BizInfo[idx][bOwner], 32, "The State");
		    BizInfo[idx][bX] = X;
		    BizInfo[idx][bY] = Y;
		    BizInfo[idx][bZ] = Z;
		    BizInfo[idx][bMoney] = 0;
		    BizInfo[idx][bProducts] = 0;
		    BizInfo[idx][bSold] = 0;
		    BizInfo[idx][bLevel] = 1;
		    BizInfo[idx][bPrice] = 5000000;
		    BizInfo[PlayerInfo[playerid][pBiz]][bStatus] = 1;
			BizInfo[idx][bPickup] = CreateDynamicPickup(1274, 1, X, Y, Z, 0);
			format(string, sizeof(string), "ID: %d\n%s\nOwner: %s\nStatus: For Sale\nPrice: $%d", idx, RBT(idx), BizInfo[idx][bOwner], BizInfo[idx][bPrice]);
			BizInfo[idx][bText] = CreateDynamic3DTextLabel(string, COLOR_WHITE, X, Y, Z, 15);
			format(string, sizeof(string), "AdmWarn: %s has created business ID %d.", RPN(playerid), idx);
			ABroadCast(COLOR_DARKRED, string, 2 );
			SaveBiz();
			idx = MAX_BIZ;
		}
	}
	return 1;
}
Reply
#2

Weird, it works fine when I added this command to my test-server..

Add this piece of code before the line if(type < 1 || type > 8 ) and see what the value it shows ingame:
pawn Код:
format(string, sizeof(string), "Type: %d", type);
SendClientMessage(playerid, -1, string);
Reply
#3

Nahh, That ain't working either, I got a sscanf error on starting the server up or a warning should I say
Код:
[21:13:24] sscanf warning: Format specifier does not match parameter count.
[21:13:24] sscanf warning: Format specifier does not match parameter count.
[21:13:24] sscanf warning: Format specifier does not match parameter count.
[21:13:24] sscanf warning: Format specifier does not match parameter count.
[21:13:24] sscanf warning: Format specifier does not match parameter count.
[21:13:24] sscanf warning: Format specifier does not match parameter count.
[21:13:24] sscanf warning: Format specifier does not match parameter count.
[21:13:24] sscanf warning: Format specifier does not match parameter count.
[21:13:24] sscanf warning: Format specifier does not match parameter count.
[21:13:24] sscanf warning: Format specifier does not match parameter count.
[21:13:24] sscanf warning: Format specifier does not match parameter count.
[21:13:24] sscanf warning: Format specifier does not match parameter count.
[21:13:24] sscanf warning: Format specifier does not match parameter count.
[21:13:24] sscanf warning: Format specifier does not match parameter count.
[21:13:24] sscanf warning: Format specifier does not match parameter count.
[21:13:24] sscanf warning: Format specifier does not match parameter count.
[21:13:24] sscanf warning: Format specifier does not match parameter count.
[21:13:24] sscanf warning: Format specifier does not match parameter count.
[21:13:24] sscanf warning: Format specifier does not match parameter count.
Reply
#4

Quote:
Originally Posted by xVIP3Rx
Посмотреть сообщение
This happens when you do this:
pawn Код:
new id, secid;
if(sscanf(params, "dd", id))//missing one parameter..
It should happen when you do a command, try to investigate which command is it and fix it.
That's about that warrning
Reply
#5

What's about what warning? lol sorry Add that into the script?
Reply
#6

Quote:
Originally Posted by CountryTrooper441
Посмотреть сообщение
What's about what warning? lol sorry Add that into the script?
I just told you what is causing that warning, again..

This happens when you do this:
pawn Код:
new id, secid;
if(sscanf(params, "dd", id))//missing one parameter..
It should happen when you do a command, try to investigate which command is it and fix it.

And, the warning isn't from that script, from somewhere else
Reply
#7

Ahh Okay, lol sorry
Reply
#8

So, Would there be any way to fix this error I still keep getting?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)