Problem in cmds
#1

Hey, I've made a biz system, and when I type /buybiz/ other commands of biz system, that'snt writing anything, and I cannot write anyshit, nothing respond, so I'm restarting the server and than that's making it, Like /createbiz, when I restart that only show me the biz, Here's the full codes of everything in Biz System :

Код:
//////////////////////////////* Business System *////////////////////////////////////////////


CMD:bizhelp(playerid, params[])
{
   	if(!IsPlayerConnected(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
	SendClientMessage(playerid, COLOR_YELLOW, "BUSINESS: {FFFFFF}/buybiz");
	if(PlayerInfo[playerid][pBiz]) SendClientMessage(playerid, COLOR_YELLOW, "BUSINESS OWNER: {FFFFFF}/bizmenu /lockbiz /sellbiztomarket");
	return 1;
}

CMD:bizmenu(playerid, params[])
{
    for(new d = 0 ; d < MAX_BIZ; d++)
	{
        new idx = PlayerInfo[playerid][pVBiz];
     	if(!IsPlayerConnected(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
        if(!PlayerInfo[playerid][pBiz] && !PlayerInfo[playerid][pVBiz]) return SendClientMessage(playerid, COLOR_GREY, "You don't own a busines.");
        SetPVarInt(playerid, "bizmenu", d);
        if(!IsPlayerInRangeOfPoint(playerid, 1, BizInfo[PlayerInfo[playerid][pBiz]][bX], BizInfo[PlayerInfo[playerid][pBiz]][bY], BizInfo[PlayerInfo[playerid][pBiz]][bZ]) || IsPlayerInRangeOfPoint(playerid, 2, BizInfo[idx][bX], BizInfo[idx][bY], BizInfo[idx][bZ]))
        {
            SendClientMessageEx(playerid, COLOR_GRAD2, "   You are not near your business!");
            return 1;
    	}
		if(IsPlayerInRangeOfPoint(playerid, 1, BizInfo[PlayerInfo[playerid][pBiz]][bX], BizInfo[PlayerInfo[playerid][pBiz]][bY], BizInfo[PlayerInfo[playerid][pBiz]][bZ]) || IsPlayerInRangeOfPoint(playerid, 2, BizInfo[idx][bX], BizInfo[idx][bY], BizInfo[idx][bZ]))
        {
            ShowPlayerDialog(playerid,DIALOG_BIZMENU,DIALOG_STYLE_LIST,"BUSINESS ACCOUNT", "Balance\nWithdraw","Select","Cancel");
        	return 1;
        }

	}

    return 1;
}

CMD:lockbiz(playerid, params[])
{
	new string[128], idx, done;//, lockdone
   	if(!IsPlayerConnected(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
	if(PlayerInfo[playerid][pBiz])
	{
		if(IsPlayerInRangeOfPoint(playerid, 2, BizInfo[PlayerInfo[playerid][pBiz]][bX], BizInfo[PlayerInfo[playerid][pBiz]][bY], BizInfo[PlayerInfo[playerid][pBiz]][bZ]))
	    {
	        if(!BizInfo[PlayerInfo[playerid][pBiz]][bStatus])
	        {
		        BizInfo[PlayerInfo[playerid][pBiz]][bStatus] = 1;
				format(string, sizeof(string), "%s\n\n{FFFFFF}%s\nOwner: %s\nID: %d", RBS(PlayerInfo[playerid][pBiz]), RBT(PlayerInfo[playerid][pBiz]), BizInfo[PlayerInfo[playerid][pBiz]][bOwner], PlayerInfo[playerid][pBiz]);
	            UpdateDynamic3DTextLabelText(BizInfo[PlayerInfo[playerid][pBiz]][bText], COLOR_WHITE, string);
		        format(string, sizeof(string), "* %s takes out their business keys and unlocks it.", RPN(playerid));
				ProxDetector(15.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
				GameTextForPlayer(playerid, "~g~Business Unlocked", 3500, 3);
			}
			else if(BizInfo[PlayerInfo[playerid][pBiz]][bStatus])
	        {
		        BizInfo[PlayerInfo[playerid][pBiz]][bStatus] = 0;
				format(string, sizeof(string), "%s\n\n{FFFFFF}%s\nOwner: %s\nID: %d", RBS(PlayerInfo[playerid][pBiz]), RBT(PlayerInfo[playerid][pBiz]), BizInfo[PlayerInfo[playerid][pBiz]][bOwner], PlayerInfo[playerid][pBiz]);
	            UpdateDynamic3DTextLabelText(BizInfo[PlayerInfo[playerid][pBiz]][bText], COLOR_WHITE, string);
		        format(string, sizeof(string), "* %s takes out their business keys and locks it.", RPN(playerid));
				ProxDetector(15.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
				GameTextForPlayer(playerid, "~r~Business Locked", 3500, 3);
			}
			done = 1;
			//lockdone = 1;
	    }
    }
    if(PlayerInfo[playerid][pVBiz] && !done)
	{
	    idx = PlayerInfo[playerid][pVBiz];
		if(IsPlayerInRangeOfPoint(playerid, 2, BizInfo[idx][bX], BizInfo[idx][bY], BizInfo[idx][bZ]))
	    {
	        if(!BizInfo[idx][bStatus])
	        {
		        BizInfo[idx][bStatus] = 1;
				format(string, sizeof(string), "%s\n\n{FFFFFF}%s\nOwner: %s\nID: %d", RBS(idx), RBT(idx), BizInfo[idx][bOwner], idx);
	            UpdateDynamic3DTextLabelText(BizInfo[idx][bText], COLOR_WHITE, string);
		        format(string, sizeof(string), "* %s takes out their business keys and unlocks it.", RPN(playerid));
				ProxDetector(15.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
				GameTextForPlayer(playerid, "~g~Business Unlocked", 3500, 3);
				SaveBiz();
			}
			else if(BizInfo[idx][bStatus])
	        {
		        BizInfo[idx][bStatus] = 0;
				format(string, sizeof(string), "%s\n\n{FFFFFF}%s\nOwner: %s\nID: %d", RBS(idx), RBT(idx), BizInfo[idx][bOwner], idx);
	            UpdateDynamic3DTextLabelText(BizInfo[idx][bText], COLOR_WHITE, string);
		        format(string, sizeof(string), "* %s takes out their business keys and locks it.", RPN(playerid));
				ProxDetector(15.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
				GameTextForPlayer(playerid, "~r~Business Locked", 3500, 3);
				SaveBiz();
			}
			done = 1;
			//lockdone = 1;
	    }
    }
    return 1;
}

CMD:buybiz(playerid, params[])
{
	new string[128], done;
   	if(!IsPlayerConnected(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
   	if(PlayerInfo[playerid][pBiz] && PlayerInfo[playerid][pVBiz] && PlayerInfo[playerid][pDonateRank] >= 4) return SendClientMessage(playerid, COLOR_GREY, "You already own two businesses.");
	if(PlayerInfo[playerid][pBiz] && PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid, COLOR_GREY, "You already own a business.");
	for(new idx=1; idx<MAX_BIZ; idx++)
	{
	    if(IsPlayerInRangeOfPoint(playerid, 2, BizInfo[idx][bX], BizInfo[idx][bY], BizInfo[idx][bZ]))
	    {
			if(!strcmp("The State", BizInfo[idx][bOwner], false))
			{
			    if(GetPVarInt(playerid, "Cash") < BizInfo[idx][bPrice]) return SendClientMessage(playerid, COLOR_GREY, "You don't have enough money to buy this business.");
				SetPVarInt(playerid, "Cash", GetPVarInt(playerid, "Cash") -BizInfo[idx][bPrice]);
				if(PlayerInfo[playerid][pBiz]) PlayerInfo[playerid][pVBiz] = idx;
				else PlayerInfo[playerid][pBiz] = idx;
			    format(BizInfo[idx][bOwner], 32, "%s", RPNU(playerid));
			    format(string, sizeof(string), "%s\n\n{FFFFFF}%s\nOwner: %s\nID: %d", RBS(idx), RBT(idx), BizInfo[idx][bOwner], idx);
				UpdateDynamic3DTextLabelText(BizInfo[idx][bText], COLOR_WHITE, string);
				SendClientMessage(playerid, COLOR_GREEN, " You have successfully bought a business.");
				SendClientMessage(playerid, COLOR_WHITE, " Type /bizhelp to view your business commands.");
				format(string, sizeof(string), "%s has bought business id %d.", RPN(playerid), idx);
				Log("logs/business.log", string);
				idx = MAX_BIZ;
				done = 1;
				SaveBiz();
			}
			if(idx == MAX_BIZ-1 && !done)
			{
			    SendClientMessage(playerid, COLOR_GREY, "This business is owned by someone else.");
			}
	    }
	    if(idx == MAX_BIZ-1 && !done)
	    {
	        SendClientMessage(playerid, COLOR_GREY, "You are not near a buyable business.");
	    }
	}
	return 1;
}

CMD:sellbiztomarket(playerid, params[])
{
	new string[128];
   	if(!IsPlayerConnected(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
	if(!PlayerInfo[playerid][pBiz] && !PlayerInfo[playerid][pVBiz]) return SendClientMessage(playerid, COLOR_GREY, "You don't own a business.");
	if(sscanf(params, "s[8]", params)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /sellbiztomarket [confirm]");
	if(!strcmp(params, "confirm", true))
	{
	    new done;
	    if(IsPlayerInRangeOfPoint(playerid, 2, BizInfo[PlayerInfo[playerid][pBiz]][bX], BizInfo[PlayerInfo[playerid][pBiz]][bY], BizInfo[PlayerInfo[playerid][pBiz]][bZ]))
	    {
	        GiveZaiatMoney(playerid, (75*BizInfo[PlayerInfo[playerid][pBiz]][bPrice])/100);
			BizInfo[PlayerInfo[playerid][pBiz]][bStatus] = 0;
		    format(BizInfo[PlayerInfo[playerid][pBiz]][bOwner], 32, "The State");
		    format(string, sizeof(string), "%s\n\n{FFFFFF}%s\nOwner: %s\nID: %d", RBS(PlayerInfo[playerid][pBiz]), RBT(PlayerInfo[playerid][pBiz]), BizInfo[PlayerInfo[playerid][pBiz]][bOwner], PlayerInfo[playerid][pBiz]);
		    UpdateDynamic3DTextLabelText(BizInfo[PlayerInfo[playerid][pBiz]][bText], COLOR_WHITE, string);
		    SendClientMessage(playerid, COLOR_GREEN, " You have successfully sold your business to The State. (75 percent of original price was paid back)");
            format(string, sizeof(string), "%s has sold business id %d to the market.", RPN(playerid), PlayerInfo[playerid][pBiz]);
			Log("logs/business.log", string);
			PlayerInfo[playerid][pBiz] = 0;
			done = 1;
	    }
	    if(!done)
	    {
	        new idx = PlayerInfo[playerid][pVBiz];
   	 		if(IsPlayerInRangeOfPoint(playerid, 2, BizInfo[idx][bX], BizInfo[idx][bY], BizInfo[idx][bZ]))
		    {
		        GiveZaiatMoney(playerid, (75*BizInfo[idx][bPrice])/100);
				BizInfo[idx][bStatus] = 0;
			    format(BizInfo[idx][bOwner], 32, "The State");
			    format(string, sizeof(string), "%s\n\n{FFFFFF}%s\nOwner: %s\nID: %d", RBS(idx), RBT(idx), BizInfo[idx][bOwner], idx);
			    UpdateDynamic3DTextLabelText(BizInfo[idx][bText], COLOR_WHITE, string);
			    SendClientMessage(playerid, COLOR_GREEN, " You have successfully sold your business to The State. (75 percent of original price was paid back)");
	            format(string, sizeof(string), "%s has sold business id %d to the market.", RPN(playerid), idx);
				Log("logs/business.log", string);
				PlayerInfo[playerid][pVBiz] = 0;
				done = 1;
				SaveBiz();
		    }
	    }
		if(!done)
	    {
	        SendClientMessage(playerid, COLOR_GREY, "You are not near your business.");
	        return 1;
	    }
    }
	return 1;
}

CMD:bizstats(playerid, params[])
{
	new string[128], playerb = playerid, status[16], status2[16];
	// Business Status for non-owners
	if(PlayerInfo[playerb][pBiz]) format(status, sizeof(status), "%s", RBS(PlayerInfo[playerb][pBiz]));
	else if(!PlayerInfo[playerb][pBiz]) format(status, sizeof(status), "None");
	if(PlayerInfo[playerb][pVBiz]) format(status2, sizeof(status2), "%s", RBS(PlayerInfo[playerb][pVBiz]));
	else if(!PlayerInfo[playerb][pVBiz]) format(status2, sizeof(status2), "None");
	if(!IsPlayerConnected(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
	SendClientMessage(playerid, COLOR_LIGHTBLUE, "_____________________________________________________");
	format(string, sizeof(string), "Businesses of %s", RPN(playerb));
	SendClientMessage(playerid, COLOR_ORANGE, string);
	format(string, sizeof(string), "Business 1: %s | ID: %s | Level: %s | Status: %s | Money: %s", RBT(PlayerInfo[playerb][pBiz]), RPBK(playerb), RPBL(playerb),status, RPBP(playerb), RPBM(playerb));
	SendClientMessage(playerid, COLOR_WHITE, string);
	format(string, sizeof(string), "Business 2: %s | ID: %s | Level: %s | Status: %s | Money: %s", RBT(PlayerInfo[playerb][pVBiz]), RPVIPBK(playerb), RPVIPBL(playerb),status2, RPVIPBP(playerb), RPVIPBM(playerb));
	SendClientMessage(playerid, COLOR_FADE2, string);
	SendClientMessage(playerid, COLOR_LIGHTBLUE, "_____________________________________________________");
	return 1;
}

CMD:bused(playerid, params[])
{
	new string[128];
   	if(!IsPlayerConnected(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
	if(PlayerInfo[playerid][pAdmin] < 99998) return SendClientMessage(playerid, COLOR_WHITE, "You must be Admin to use this Command!");
	SendClientMessage(playerid, COLOR_ORANGE, "[Used Businesses]:");
	for(new idx=1; idx<MAX_BIZ; idx++)
	{
	    if(BizInfo[idx][bType])
	    {
			format(string, sizeof(string), "ID: %d | Type: %s | Level: %d | Price: $%d | Products: %d | Vault: $%d | Owner: %s", idx, RBT(idx), BizInfo[idx][bLevel], BizInfo[idx][bPrice],BizInfo[idx][bProducts], BizInfo[idx][bMoney], BizInfo[idx][bOwner]);
			SendClientMessage(playerid, COLOR_ORANGE, string);
	    }
	}
	return 1;
}

CMD:bedit(playerid, params[])
{
	new bizid, string[128], input;
	new Float:X, Float:Y, Float:Z;
	if(!IsPlayerConnected(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
	if(PlayerInfo[playerid][pAdmin] < 99998) return SendClientMessage(playerid, COLOR_WHITE, "You must be Admin to use this Command!");
	if(sscanf(params, "s[32]", params))
	{
		SendClientMessage(playerid, COLOR_WHITE, "USAGE: /bedit [option] [bizid]");
		SendClientMessage(playerid, COLOR_GREY, "OPTIONS: location | price | level | products | vault");
		return 1;
	}
	if(!strcmp(params, "location", true, 8))
	{
	    if(sscanf(params, "s[32]i", params, bizid)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /bedit location [bizid]");
		new idx=bizid;
		if(!BizInfo[bizid][bType]) return SendClientMessage(playerid, COLOR_GREY, "Invalid business id.");
		GetPlayerPos(playerid, BizInfo[bizid][bX], BizInfo[bizid][bY], BizInfo[bizid][bZ]);
		DestroyDynamicPickup(BizInfo[bizid][bPickup]);
    	//BizInfo[bizid][bPickup] = CreateDynamicPickup(1274, 1, BizInfo[bizid][bX], BizInfo[bizid][bY], BizInfo[bizid][bZ], 0);
    	if(BizInfo[bizid][bType] == 1)
	    {
  			BizInfo[bizid][bPickup] = CreateDynamicPickup(1274, 1, X, Y, Z, 0);
  			SaveBiz();
	    }
	    if(BizInfo[bizid][bType] == 2)
	    {
  			BizInfo[bizid][bPickup] = CreateDynamicPickup(1275, 1, X, Y, Z, 0);
  			SaveBiz();
	    }
	    if(BizInfo[bizid][bType] == 3)
	    {
  			BizInfo[bizid][bPickup] = CreateDynamicPickup(1242, 1, X, Y, Z, 0);
  			SaveBiz();
   	    }
   	    if(BizInfo[bizid][bType] == 4)
   	    {
  			BizInfo[bizid][bPickup] = CreateDynamicPickup(1582, 1, X, Y, Z, 0);
  			SaveBiz();
 	    }
 	    if(BizInfo[bizid][bType] == 5)
 	    {
   			BizInfo[bizid][bPickup] = CreateDynamicPickup(1650, 1, X, Y, Z, 0);
   			SaveBiz();
   	    }
   	    if(BizInfo[bizid][bType] == 6)
   	    {
   			BizInfo[bizid][bPickup] = CreateDynamicPickup(19094, 1, X, Y, Z, 0);
   			SaveBiz();
   	    }
   	    if(BizInfo[bizid][bType] == 7)
   	    {
     		BizInfo[bizid][bPickup] = CreateDynamicPickup(321, 1, X, Y, Z, 0);
     		SaveBiz();
  	    }
		DestroyDynamic3DTextLabel(BizInfo[bizid][bText]);
        if(!strcmp("The State", BizInfo[idx][bOwner])) format(string, sizeof(string), "%s\n\n{FFFFFF}%s\nOwner: %s\nFor Sale: $%d\nID: %d", RBS(idx), RBT(idx), BizInfo[idx][bOwner], BizInfo[idx][bPrice], idx);
		else format(string, sizeof(string), "%s\n\n{FFFFFF}%s\nOwner: %s\nID: %d", RBS(idx), RBT(idx), BizInfo[idx][bOwner], idx);
    	BizInfo[bizid][bText] = CreateDynamic3DTextLabel(string, COLOR_WHITE, BizInfo[bizid][bX], BizInfo[bizid][bY], BizInfo[bizid][bZ]+0.8, 4);
	    format(string, sizeof(string), "AdmWarn: %s has changed business ID %d's location.", RPN(playerid), bizid);
		ABroadCast(COLOR_LIGHTRED, string,4);
		Log("logs/business.log", string);
		SaveBiz();
	}
	else if(!strcmp(params, "price", true, 5))
	{
	    if(sscanf(params, "s[32]ii", params, bizid, input)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /bedit price [bizid] [price]");
		if(!BizInfo[bizid][bType]) return SendClientMessage(playerid, COLOR_GREY, "Invalid business id.");
		if(strcmp("The State", BizInfo[bizid][bOwner])) return SendClientMessage(playerid, COLOR_GREY, "You can't edit the price of owned businesses.");
	    BizInfo[bizid][bPrice] = input;
	    format(string, sizeof(string), "%s\n\n{FFFFFF}%s\nOwner: %s\nFor Sale: $%d\nID: %d", RBS(bizid), RBT(bizid), BizInfo[bizid][bOwner], BizInfo[bizid][bPrice], bizid);
	    UpdateDynamic3DTextLabelText(BizInfo[bizid][bText], COLOR_WHITE, string);
	    format(string, sizeof(string), "AdmWarn: %s has set business ID %d's price to $%d.", RPN(playerid), bizid, input);
		ABroadCast(COLOR_LIGHTRED, string,4);
		Log("logs/business.log", string);
		SaveBiz();
	}
	else if(!strcmp(params, "level", true, 5))
	{
	    // L1: 0 | L2: 100 | L3: 300 | L4: 700 | L5: 1200
	    if(sscanf(params, "s[32]ii", params, bizid, input)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /bedit level [bizid] [level]");
    	if(!BizInfo[bizid][bType]) return SendClientMessage(playerid, COLOR_GREY, "Invalid business id.");
    	if(input < 0 || input > 5) return SendClientMessage(playerid, COLOR_GREY, "Levels are between 1 and 5.");
	    BizInfo[bizid][bLevel] = input;
	    if(input == 1) BizInfo[bizid][bSold] = 0;
	    if(input == 2) BizInfo[bizid][bSold] = 100;
	    if(input == 3) BizInfo[bizid][bSold] = 300;
	    if(input == 4) BizInfo[bizid][bSold] = 700;
	    if(input == 5) BizInfo[bizid][bSold] = 1200;
	    format(string, sizeof(string), "AdmWarn: %s has set business ID %d's level to %d.", RPN(playerid), bizid, input);
		ABroadCast(COLOR_LIGHTRED, string,4);
		Log("logs/business.log", string);
		SaveBiz();
	}
	else if(!strcmp(params, "products", true, 8))
	{
	    if(sscanf(params, "s[32]ii", params, bizid, input)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /bedit products [bizid] [amount]");
    	if(!BizInfo[bizid][bType]) return SendClientMessage(playerid, COLOR_GREY, "Invalid business id.");
    	if(input < 0) return SendClientMessage(playerid, COLOR_GREY, "Products can't be negative.");
	    BizInfo[bizid][bProducts] = input;
	    format(string, sizeof(string), "AdmWarn: %s has set business ID %d's products to %d.", RPN(playerid), bizid, input);
		ABroadCast(COLOR_LIGHTRED, string,4);
		Log("logs/business.log", string);
		SaveBiz();
	}
	else if(!strcmp(params, "vault", true, 5))
	{
	    if(sscanf(params, "s[32]ii", params, bizid, input)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /bedit vault [bizid] [amount]");
    	if(!BizInfo[bizid][bType]) return SendClientMessage(playerid, COLOR_GREY, "Invalid business id.");
    	if(input < 0) return SendClientMessage(playerid, COLOR_GREY, "Vault money can't be negative.");
	    BizInfo[bizid][bMoney] = input;
	    format(string, sizeof(string), "AdmWarn: %s has set business ID %d's vault money to $%d.", RPN(playerid), bizid, input);
		ABroadCast(COLOR_LIGHTRED, string,4);
		Log("logs/business.log", string);
		SaveBiz();
	}
	else if(!strcmp(params, "truckers", true, 8))
	{
   	    if(sscanf(params, "s[32]ii", params, bizid, input)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /bedit truckers [bizid] [type] (1=Accepting | 2=NotAccepting");
        if(!BizInfo[bizid][bAP])
		{
		    BizInfo[bizid][bAP] = 1;
		    format(string, sizeof(string), "AdmWarn: %s has set business ID %d to accept truckers.", RPN(playerid), bizid);
			ABroadCast(COLOR_LIGHTRED, string,4);
			Log("logs/business.log", string);
			SaveBiz();
		}
		else
		{
		    BizInfo[bizid][bAP] = 0;
		    format(string, sizeof(string), "AdmWarn: %s has set business ID %d to NOT accept truckers.", RPN(playerid), bizid);
			ABroadCast(COLOR_LIGHTRED, string,4);
			Log("logs/business.log", string);
			SaveBiz();
		}
	}
	return 1;
}

CMD:gotobiz(playerid, params[])
{
    new idx, string[128];
   	if(!IsPlayerConnected(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
	if(PlayerInfo[playerid][pAdmin] < 99998) return SendClientMessage(playerid, COLOR_WHITE, "You must be Admin to use this Command!");
	if(sscanf(params, "i", idx)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /gotobiz [bizid]");
	if(!BizInfo[idx][bType]) return SendClientMessage(playerid, COLOR_GREY, "Invalid business id.");
	SetPlayerVirtualWorld(playerid, 0);
	SetPlayerInterior(playerid, 0);
	SetPlayerPos(playerid, BizInfo[idx][bX], BizInfo[idx][bY], BizInfo[idx][bZ]);
	format(string, sizeof(string), " You have teleported to business ID %d.", idx);
	SendClientMessage(playerid, COLOR_WHITE, string);
	return 1;
}

CMD:asellbiz(playerid, params[])
{
	new bizid, string[128];
   	if(!IsPlayerConnected(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
	if(PlayerInfo[playerid][pAdmin] < 99998) return SendClientMessage(playerid, COLOR_WHITE, "You must be Admin to use this Command!");
	if(sscanf(params, "i", bizid)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /asellbiz [bizid]");
	if(!BizInfo[bizid][bType]) return SendClientMessage(playerid, COLOR_GREY, "Invalid business id.");
	if(!strcmp("The State", BizInfo[bizid][bOwner], true)) return SendClientMessage(playerid, COLOR_GREY, "This business is not owned by anybody.");
	foreach(Player, i)
	{
	    if(IsPlayerConnected(i) && PlayerInfo[i][pBiz] == bizid)
		{
			PlayerInfo[i][pBiz] = 0;
			format(string, sizeof(string), " Administrator %s has sold your business.", RPN(playerid));
			SendClientMessage(i, COLOR_WHITE, string);
		}
	}
	format(string, sizeof(string), "AdmWarn: %s has sold %s's business. (ID %d)", RPN(playerid), BizInfo[bizid][bOwner], bizid);
	ABroadCast(COLOR_LIGHTRED, string,4);
	Log("logs/business.log", string);
    BizInfo[bizid][bStatus] = 0;
    format(BizInfo[bizid][bOwner], 32, "The State");
    format(string, sizeof(string), "%s\n\n{FFFFFF}%s\nOwner: %s\nFor Sale: $%d\nID: %d", RBS(bizid), RBT(bizid), BizInfo[bizid][bOwner], BizInfo[bizid][bPrice], bizid);
 	UpdateDynamic3DTextLabelText(BizInfo[bizid][bText], COLOR_WHITE, string);
 	SaveBiz();
	return 1;
}

CMD:createbiz(playerid, params[])
{
	new type, string[128];
    if(!IsPlayerConnected(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
	if(PlayerInfo[playerid][pAdmin] < 99998) return SendClientMessage(playerid, COLOR_WHITE, "You must be Admin to use this Command!");
	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) Well Stacked Pizza | 5) Gas Station | 6)Burger Shot | 7)Sex Shop");
		return 1;
	}
	if(type < 1 || type > 7) return SendClientMessage(playerid, COLOR_GREY, "Businesses are between 1 and 7.");
	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;
		    BizInfo[idx][bStatus] = 1;
		    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] = 10000000;
		    if(BizInfo[idx][bType] == 1)
    	    {
     			BizInfo[idx][bPickup] = CreateDynamicPickup(1274, 1, X, Y, Z, 0);
    	    }
    	    if(BizInfo[idx][bType] == 2)
    	    {
     			BizInfo[idx][bPickup] = CreateDynamicPickup(1275, 1, X, Y, Z, 0);
    	    }
    	    if(BizInfo[idx][bType] == 3)
    	    {
     			BizInfo[idx][bPickup] = CreateDynamicPickup(1242, 1, X, Y, Z, 0);
    	    }
    	    if(BizInfo[idx][bType] == 4)
    	    {
     			BizInfo[idx][bPickup] = CreateDynamicPickup(1582, 1, X, Y, Z, 0);
    	    }
    	    if(BizInfo[idx][bType] == 5)
    	    {
     			BizInfo[idx][bPickup] = CreateDynamicPickup(1650, 1, X, Y, Z, 0);
    	    }
    	    if(BizInfo[idx][bType] == 6)
    	    {
     			BizInfo[idx][bPickup] = CreateDynamicPickup(19094, 1, X, Y, Z, 0);
    	    }
    	    if(BizInfo[idx][bType] == 7)
    	    {
     			BizInfo[idx][bPickup] = CreateDynamicPickup(321, 1, X, Y, Z, 0);
    	    }
			format(string, sizeof(string), "%s\n\n{FFFFFF}%s\nOwner: %s\nFor Sale: $%d\nID: %d", RBS(idx), RBT(idx), BizInfo[idx][bOwner], BizInfo[idx][bPrice], idx);
			BizInfo[idx][bText] = CreateDynamic3DTextLabel(string, COLOR_WHITE, X, Y, Z+0.8, 4);
			format(string, sizeof(string), "AdmWarn: %s has created business ID %d.", RPN(playerid), idx);
			ABroadCast(COLOR_LIGHTRED, string,4);
			Log("logs/business.log", string);
			idx = MAX_BIZ;
			SaveBiz();
		}
	}
	return 1;
}

CMD:deletebiz(playerid, params[])
{
	new id, string[128];
    if(!IsPlayerConnected(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
	if(PlayerInfo[playerid][pAdmin] < 99998) return SendClientMessage(playerid, COLOR_WHITE, "You must be Admin to use this Command!");
	if(sscanf(params, "i", id)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /deletebiz [bizid]");
	if(!BizInfo[id][bType]) return SendClientMessage(playerid, COLOR_GREY, "Invalid business id.");
    foreach(Player, i)
	{
	    if(IsPlayerConnected(i) && PlayerInfo[i][pBiz] == id)
		{
		    PlayerInfo[playerid][pBiz] = 0;
		    format(string, sizeof(string), " Administrator %s has deleted your business.", RPN(playerid));
			SendClientMessage(i, COLOR_WHITE, string);
		}
	}
	if(!strcmp("The State", BizInfo[id][bOwner]))
	{
		format(string, sizeof(string), "AdmWarn: %s has deleted business ID %d.", RPN(playerid), id);
	}
	else
	{
	    format(string, sizeof(string), "AdmWarn: %s has deleted %s's business. (ID %d)", RPN(playerid), BizInfo[id][bOwner], id);
	}
	ABroadCast(COLOR_LIGHTRED, string,4);
	Log("logs/business.log", string);
	BizInfo[id][bType] = 0;
    BizInfo[id][bStatus] = 0;
    format(BizInfo[id][bOwner], 32, "");
    BizInfo[id][bX] = 0;
    BizInfo[id][bY] = 0;
    BizInfo[id][bZ] = 0;
    BizInfo[id][bMoney] = 0;
    BizInfo[id][bProducts] = 0;
    DestroyDynamicPickup(BizInfo[id][bPickup]);
    DestroyDynamic3DTextLabel(BizInfo[id][bText]);
    SaveBiz();
	return 1;
}
//////////////////////////////////* End of Business System */////////////////////////////////////////
Reply
#2

pawn Код:
CMD:bizhelp(playerid, params[])
{
    if(!IsPlayerConnected(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
    SendClientMessage(playerid, COLOR_YELLOW, "BUSINESS: {FFFFFF}/buybiz");
    if(PlayerInfo[playerid][pBiz]) SendClientMessage(playerid, COLOR_YELLOW, "BUSINESS OWNER: {FFFFFF}/bizmenu /lockbiz /sellbiztomarket");
    return 1;
}
Lots of mistake...
IsPlayerConnected is to check whether he connect and not to check whether he logged in or ETC
if(PlayerInfo[playerid][pBiz]) IS this, u ain't checking anything i mean the compile won't check anything because this code isn't used correctly. Sry, i'm lazy to see the full script.
Reply
#3

Please fix it ...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)