Error ! help me !
#1

Код:
SERVER: Unknown command. Please use /help to list all available commands



This is script:
Код:
CMD:dathang(playerid, params[])
{
    new string[128], soluong;
	new bizid = PlayerInfo[playerid][pPbiskey];
    if(PlayerInfo[playerid][pBRank] != 6)
	{
		SendClientMessageEx(playerid, COLOR_GREY, "Ban khong phai la chu cua hang.");
		return 1;
	}
	else
	{
		if(!IsPlayerInRangeOfPoint(playerid,100,BizzInfo[bizid][bExitX],BizzInfo[bizid][bExitY],BizzInfo[bizid][bExitZ]))
		{
			SendClientMessage(playerid, COLOR_GREY, "   Ban khong o trong cua hang cua ban!");
			return 1;
		}
		else
		{
    		if(sscanf(params, "d", soluong))
    		{
				SendClientMessageEx(playerid, COLOR_GREY, "SUDUNG: /dathang [so luong]");
				return 1;
			}
			else
			{
    			if(UseGetProdsTimer[playerid])
    			{
					SendClientMessage(playerid,COLOR_GREY,"  Ban can cho doi 30 phut sau moi co the lay hang tiep!");
					return 1;
				}
				else
				{
    				if(soluong < 100 || soluong > 2000)
    				{
						SendClientMessageEx(playerid, COLOR_GRAD2, "So luong phai nam trong gioi han tu 100 toi 2000.");
						return 1;
					}
					else
					{
						if(bizid == INVALID_BUSINESSES_ID)
						{
	    					SendClientMessageEx(playerid, COLOR_GREY, "Ban khong so huu cua hang nao.");
							return 1;
						}
						else
						{
							BizzInfo[bizid][bDelivProd] += soluong;
							BizzInfo[bizid][bPriceProd] += soluong*23;
							if(BizzInfo[bizid][bBizBank] < BizzInfo[bizid][bPriceProd])
							{
								SendClientMessage( playerid, COLOR_GREY, "Cua hang cua ban khong du tien de mua san pham!");
								return 1;
							}
							else
							{
								format( string, sizeof( string ), "Ban da mua thanh cong %d san pham voi gia $%d.", soluong, BizzInfo[bizid][bPriceProd]);
								SendClientMessage( playerid, COLOR_LIGHTBLUE, string);
								SendClientMessage( playerid, COLOR_YELLOW, "San pham cua ban se duoc chuyen den trong vong 10 phut.");
								SetTimerEx("FillingBizz", 600000, false, "i", playerid);
								UseGetProdsTimer[playerid] = true;
								SetTimerEx("UseGetProds", 1800000, false,"i",playerid);
								SaveBusiness(bizid);
								return 1;
							}
						}
					}
				}
			}
		}
	}
}
Reply
#2

Here, should be fixed now.

Код:
CMD:dathang(playerid, params[])
{
    new string[128], soluong, bizid = PlayerInfo[playerid][pPbiskey];
    if(PlayerInfo[playerid][pBRank] != 6) return SendClientMessageEx(playerid, COLOR_GREY, "Ban khong phai la chu cua hang.");
 if(!IsPlayerInRangeOfPoint(playerid,100,BizzInfo[bizid][bExitX],BizzInfo[bizid][bExitY],BizzInfo[bizid][bExitZ])) return SendClientMessage(playerid, COLOR_GREY, "   Ban khong o trong cua hang cua ban!");
 if(sscanf(params, "d", soluong)) return SendClientMessageEx(playerid, COLOR_GREY, "SUDUNG: /dathang [so luong]");
 if(UseGetProdsTimer[playerid]) return SendClientMessage(playerid,COLOR_GREY,"  Ban can cho doi 30 phut sau moi co the lay hang tiep!");
 if(soluong < 100 || soluong > 2000) return SendClientMessageEx(playerid, COLOR_GRAD2, "So luong phai nam trong gioi han tu 100 toi 2000.");
 if(bizid == INVALID_BUSINESSES_ID) return SendClientMessageEx(playerid, COLOR_GREY, "Ban khong so huu cua hang nao.");
 BizzInfo[bizid][bDelivProd] += soluong;
 BizzInfo[bizid][bPriceProd] += soluong*23;
 if(BizzInfo[bizid][bBizBank] < BizzInfo[bizid][bPriceProd]) return SendClientMessage( playerid, COLOR_GREY, "Cua hang cua ban khong du tien de mua san pham!");
 format( string, sizeof( string ), "Ban da mua thanh cong %d san pham voi gia $%d.", soluong, BizzInfo[bizid][bPriceProd]);
 SendClientMessage( playerid, COLOR_LIGHTBLUE, string);
 SendClientMessage( playerid, COLOR_YELLOW, "San pham cua ban se duoc chuyen den trong vong 10 phut.");
 SetTimerEx("FillingBizz", 600000, false, "i", playerid);
 UseGetProdsTimer[playerid] = true;
 SetTimerEx("UseGetProds", 1800000, false,"i",playerid);
 SaveBusiness(bizid);
 return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)