help pls trucker dosen't work loaded with business?
#1

I want player of me use a command is /nhanchuyenhang to get checkpoint , if a businesser someone need get products



Код:
IsAtTruckDeliveryPoint(playerid)
{
    for(new b = 0; b< MAX_BUSINESSES; b++)
    {
    	if(IsPlayerInRangeOfPoint(playerid, 6, 920.421142, -1361.637084, 13.003659) || IsPlayerInRangeOfPoint(playerid, 6, 1197.744384, -886.373901, 42.819854) ||
		IsPlayerInRangeOfPoint(playerid, 6, 2111.115722, -1783.749877, 13.188007) || IsPlayerInRangeOfPoint(playerid, 6, 2236.051757, -1690.114990, 13.744861) ||
  		IsPlayerInRangeOfPoint(playerid, 6, 454.168640, -1501.456909, 30.757781) || IsPlayerInRangeOfPoint(playerid, 6, 2111.877929, -1218.093139, 23.604995) ||
 	    IsPlayerInRangeOfPoint(playerid, 6, 2197.721923, -1975.567260, 13.359717) || IsPlayerInRangeOfPoint(playerid, 6, 1339.484497, -1763.289916, 13.332603) ||
 	    IsPlayerInRangeOfPoint(playerid, 6, 1003.885925, -906.400634, 41.986915) || IsPlayerInRangeOfPoint(playerid, 6, 653.9890,1690.1085,6.9922) ||
	    IsPlayerInRangeOfPoint(playerid, 6, 2781.596435, -2494.261230, 13.457942) || IsPlayerInRangeOfPoint(playerid, 6, 2443.682373, -1426.901489, 23.796508) ||
	    IsPlayerInRangeOfPoint(playerid, 6, 2166.486083, -2273.158935, 13.166786) || IsPlayerInRangeOfPoint(playerid, 6, BizzInfo[b][bDeliverX], BizzInfo[b][bDeliverY], BizzInfo[b][bDeliverZ]))
	    { return true; }
    }
    return false;
}
Код:
forward LoadTruck(playerid);
public LoadTruck(playerid)
{
    SetPVarInt(playerid, "LoadTruckTime", GetPVarInt(playerid, "LoadTruckTime")-1);
	new string[128];
	format(string, sizeof(string), "~n~~n~~n~~n~~n~~n~~n~~n~~n~~w~%d giay cho doi", GetPVarInt(playerid, "LoadTruckTime"));
	GameTextForPlayer(playerid, string, 1100, 3);

	if(GetPVarInt(playerid, "LoadTruckTime") > 0) SetTimerEx("LoadTruck", 1000, 0, "d", playerid);

	if(GetPVarInt(playerid, "LoadTruckTime") <= 0)
	{
		DeletePVar(playerid, "LoadTruckTime");
		DeletePVar(playerid, "IsFrozen");
		TogglePlayerControllable(playerid, 1);

  		new vehicleid = GetPlayerVehicleID(playerid);
  		new truckdeliver = GetPVarInt(playerid, "TruckDeliver");
  		TruckContents{vehicleid} = truckdeliver;
  		TruckUsed[playerid] = vehicleid;

		new rand = random(MAX_BUSINESSES - 1);
		if(BizzInfo[rand][bDeliverX] == 0 || BizzInfo[rand][bDeliverX] == 0 || BizzInfo[rand][bDeliverX] == 0)
		{
			rand = 1;
	        if(++rand >= MAX_BUSINESSES)
			{
		        rand = 1;
			}
		}

		if(truckdeliver == 1)
		{
			SendClientMessageEx(playerid, COLOR_LIGHTBLUE,"* Xe cua ban dang van chuyen Luong thuc va Nuoc uong.");
			new szMessage[1480];
			for(new i = 5; i < sizeof( BizzInfo ); i++)
			{
			    if(BizzInfo[i][bType] == 6)
				{
			        format(szMessage, sizeof(szMessage), "%s%s (ID %d), Hue Hong Thu Mua San Pham Cho Ban la %d$.\n",szMessage, BizzInfo[i][bMessage], i, BizzInfo[i][bGiaMua]);
                    ShowPlayerDialog(playerid,DIALOG_THUMUALT,DIALOG_STYLE_LIST,"Hue Hong Thu Mua San Pham Cho Ban", szMessage,"Chon","huy bo");
                    //SetPVarInt(playerid, "ThuMuaVL", i);
                }
            }
		}
		else if(truckdeliver == 2)
		{
			SendClientMessageEx(playerid, COLOR_LIGHTBLUE,"* Xe cua ban dang van chuyen Luong thuc va Nuoc uong.");
			new szMessage[1480];
			for(new i = 5; i < sizeof( BizzInfo ); i++)
			{
			    if(BizzInfo[i][bType] == 6)
				{
			        format(szMessage, sizeof(szMessage), "%s%s (ID %d), Hue Hong Thu Mua San Pham Cho Ban la %d$.\n",szMessage, BizzInfo[i][bMessage], i, BizzInfo[i][bGiaMua]);
                    ShowPlayerDialog(playerid,DIALOG_THUMUALT,DIALOG_STYLE_LIST,"Hue Hong Thu Mua San Pham Cho Ban", szMessage,"Chon","huy bo");
                    //SetPVarInt(playerid, "ThuMuaVL", i);
                }
            }
		}
		else if(truckdeliver == 3)
		{
			SendClientMessageEx(playerid, COLOR_LIGHTBLUE,"* Xe cua ban dang van chuyen Luong thuc va Nuoc uong.");
			new szMessage[1480];
			for(new i = 5; i < sizeof( BizzInfo ); i++)
			{
			    if(BizzInfo[i][bType] == 6)
				{
			        format(szMessage, sizeof(szMessage), "%s%s (ID %d), Hue Hong Thu Mua San Pham Cho Ban la %d$.\n",szMessage, BizzInfo[i][bMessage], i, BizzInfo[i][bGiaMua]);
                    ShowPlayerDialog(playerid,DIALOG_THUMUALT,DIALOG_STYLE_LIST,"Hue Hong Thu Mua San Pham Cho Ban", szMessage,"Chon","huy bo");
                    //SetPVarInt(playerid, "ThuMuaVL", i);
                }
            }
		}
		else if(truckdeliver == 4)
		{
			SendClientMessageEx(playerid, COLOR_LIGHTBLUE,"* Xe cua ban dang van chuyen Quan ao.");
			new szMessage[1480];
			for(new i = 40; i < sizeof( BizzInfo ); i++)
			{
			    if(BizzInfo[i][bType] == 2)
				{
			        format(szMessage, sizeof(szMessage), "%s%s (ID %d), Hue Hong Thu Mua San Pham Cho Ban la %d$.\n",szMessage, BizzInfo[i][bMessage], i, BizzInfo[i][bGiaMua]);
                    ShowPlayerDialog(playerid,DIALOG_THUMUAQA,DIALOG_STYLE_LIST,"Hue Hong Thu Mua San Pham Cho Ban", szMessage,"Chon","huy bo");
                    //SetPVarInt(playerid, "ThuMuaVL", i);
                }
            }
		}
		else if(truckdeliver == 5)
		{
			SendClientMessageEx(playerid, COLOR_LIGHTBLUE,"* Xe cua ban dang van chuyen Quan ao.");
			new szMessage[1480];
			for(new i = 40; i < sizeof( BizzInfo ); i++)
			{
			    if(BizzInfo[i][bType] == 2)
				{
			        format(szMessage, sizeof(szMessage), "%s%s (ID %d), Hue Hong Thu Mua San Pham Cho Ban la %d$.\n",szMessage, BizzInfo[i][bMessage], i, BizzInfo[i][bGiaMua]);
                    ShowPlayerDialog(playerid,DIALOG_THUMUAQA,DIALOG_STYLE_LIST,"Hue Hong Thu Mua San Pham Cho Ban", szMessage,"Chon","huy bo");
                    //SetPVarInt(playerid, "ThuMuaVL", i);
                }
            }
		}
		else if(truckdeliver == 6)
		{
			SendClientMessageEx(playerid, COLOR_LIGHTBLUE,"* Xe cua ban dang van chuyen Quan ao.");
			new szMessage[1480];
			for(new i = 40; i < sizeof( BizzInfo ); i++)
			{
			    if(BizzInfo[i][bType] == 2)
				{
			        format(szMessage, sizeof(szMessage), "%s%s (ID %d), Hue Hong Thu Mua San Pham Cho Ban la %d$.\n",szMessage, BizzInfo[i][bMessage], i, BizzInfo[i][bGiaMua]);
                    ShowPlayerDialog(playerid,DIALOG_THUMUAQA,DIALOG_STYLE_LIST,"Hue Hong Thu Mua San Pham Cho Ban", szMessage,"Chon","huy bo");
                    //SetPVarInt(playerid, "ThuMuaVL", i);
                }
            }
		}
		else if(truckdeliver == 7)
		{
			SendClientMessageEx(playerid, COLOR_LIGHTBLUE,"* Xe cua ban dang van chuyen Vat Lieu.");
			new szMessage[1480];
			for(new i = 0; i < sizeof( BizzInfo ); i++)
			{
			    if(BizzInfo[i][bType] == 4)
				{
			        format(szMessage, sizeof(szMessage), "%s%s (ID %d), Gia Mua Vat Lieu la %d$.\n",szMessage, BizzInfo[i][bMessage], i, BizzInfo[i][bGiaMua]);
                    ShowPlayerDialog(playerid,DIALOG_THUMUAVLHP,DIALOG_STYLE_LIST,"Gia Thu Mua Vat Lieu", szMessage,"Chon","huy bo");
                    //SetPVarInt(playerid, "ThuMuaVl", i);
                }
            }
			//SetPlayerCheckpoint(playerid, 2197.721923, -1975.567260, 13.359717, 5);
		}
		else if(truckdeliver == 8)
		{
			SendClientMessageEx(playerid, COLOR_LIGHTBLUE,"* Xe cua ban dang van chuyen mat hang 24/7.");
			new szMessage[1480];
			for(new i = 15; i < sizeof( BizzInfo ); i++)
			{
			    if(BizzInfo[i][bType] == 1)
				{
			        format(szMessage, sizeof(szMessage), "%s%s (ID %d), Gia Mua Vat Lieu la %d$.\n",szMessage, BizzInfo[i][bMessage], i, BizzInfo[i][bGiaMua]);
                    ShowPlayerDialog(playerid,DIALOG_THUMUAVL247,DIALOG_STYLE_LIST,"Gia Thu Mua Vat Lieu", szMessage,"Chon","huy bo");
                    //SetPVarInt(playerid, "ThuMuaVl", i);
                }
            }
		}
		else if(truckdeliver == 9)
		{
			SendClientMessageEx(playerid, COLOR_LIGHTBLUE,"* Xe cua ban dang van chuyen mat hang 24/7.");
			new szMessage[1480];
			for(new i = 15; i < sizeof( BizzInfo ); i++)
			{
			    if(BizzInfo[i][bType] == 1)
				{
			        format(szMessage, sizeof(szMessage), "%s%s (ID %d), Gia Mua Vat Lieu la %d$.\n",szMessage, BizzInfo[i][bMessage], i, BizzInfo[i][bGiaMua]);
                    ShowPlayerDialog(playerid,DIALOG_THUMUAVL247,DIALOG_STYLE_LIST,"Gia Thu Mua Vat Lieu", szMessage,"Chon","huy bo");
                    //SetPVarInt(playerid, "ThuMuaVl", i);
                }
            }
		}
		else if(truckdeliver == 10)
		{
			SendClientMessageEx(playerid, COLOR_LIGHTBLUE,"* Xe cua ban dang van chuyen mat hang 24/7.");
			new szMessage[1480];
			for(new i = 15; i < sizeof( BizzInfo ); i++)
			{
			    if(BizzInfo[i][bType] == 1)
				{
			        format(szMessage, sizeof(szMessage), "%s%s (ID %d), Gia Mua Vat Lieu la %d.\n",szMessage, BizzInfo[i][bMessage], i, BizzInfo[i][bGiaMua]);
                    ShowPlayerDialog(playerid,DIALOG_THUMUAVL247,DIALOG_STYLE_LIST,"Gia Thu Mua Vat Lieu", szMessage,"Chon","huy bo");
                    //SetPVarInt(playerid, "ThuMuaVl", i);
                }
            }
		}
		else if(truckdeliver >= 11 && truckdeliver <= 15)
		{
			SendClientMessageEx(playerid, COLOR_LIGHTBLUE,"* Xe cua ban dang van chuyen  vat lieu che tao Vu khi bat hop phap.");
            GivePlayerCash(playerid, -5000);
            new szMessage[1480];
			for(new i; i < sizeof( BizzInfo ); i++)
			{
			    if(BizzInfo[i][bType] == 4)
				{
			        format(szMessage, sizeof(szMessage), "%s%s (ID %d), Gia Mua Vat Lieu la %d. \n",szMessage, BizzInfo[i][bMessage], i, BizzInfo[i][bGiaMua]);
                    ShowPlayerDialog(playerid,DIALOG_THUMUAVL,DIALOG_STYLE_LIST,"Gia Thu Mua Vat Lieu", szMessage,"Chon","huy bo");
                }
            }
			//SetPlayerCheckpoint(playerid, 2781.596435, -2494.261230, 13.457942, 5);
		}
		else if(truckdeliver >= 16 && truckdeliver <= 20)
		{
			SendClientMessageEx(playerid, COLOR_LIGHTBLUE,"* Xe cua ban dang van chuyen Ma tuy.");
			GivePlayerCash(playerid, -5000);
			SetPlayerCheckpoint(playerid, 2443.682373, -1426.901489, 23.796508, 5);
		}
		else if(truckdeliver >= 21 && truckdeliver <= 25)
		{
			SendClientMessageEx(playerid, COLOR_LIGHTBLUE,"* Xe cua ban dang van chuyen Vat Lieu Bat hop phap.");
			GivePlayerCash(playerid, -5000);
			SetPlayerCheckpoint(playerid, 2166.486083, -2273.158935, 13.166786, 5);
		}

		SendClientMessageEx(playerid, COLOR_WHITE, "HINT: Giao hang hoa cho vi tri quy dinh (Nhin tren ban do).");
		SendClientMessageEx(playerid, COLOR_REALRED, "Canh Bao: Can than voi chiec xe tai, nguoi choi khac co the chiem quyen dieu khien xe cua ban.");
		if(truckdeliver >= 11)
		{
			SendClientMessageEx(playerid, COLOR_REALRED, "CANH CAO #2: Ban dang van chuyen hang hoa bat hop phap,neu ban bi canh sat bat co the se vao tu,va hop dong la dat coc 5000$.");
		}
		SetPVarInt(playerid, "tpTruckRunTimer", 30);
		SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_TPTRUCKRUNTIMER);
	}
	return 1;
}
Код:
//biz system
enum bInfo
{
    bSQLId,
    bOwned,
    bRadio,
	bOwner[255],
	bMessage[255],
	bPickupID,
	bIconID,
	bIconType,
	bVirWorld,
	bExtortion[255],
	Float:bEntranceX,
	Float:bEntranceY,
	Float:bEntranceZ,
	Float:bDeliverX,
	Float:bDeliverY,
	Float:bDeliverZ,
	Float:bExitX,
	Float:bExitY,
	Float:bExitZ,
	bLevelNeeded,
	bBuyPrice,
	bEntranceCost,
	bBizBank,
	bLocked,
	bInteriorID,
	bExteriorID,
	bInterior,
	bProducts,
	bDelivProd,
	bPercent,
	bType,
	BusinessProdPrice[26],
	BusinessPrice,
	BusinessPickup,
	Text3D:BusinessLabel,
	BusinessFee,
	BusinessProducts,
	bPriceProd,
	bMaxProducts,
	bGiaSP1,
	bGiaSP2,
	bGiaSP3,
	bGiaSP4,
	bGiaSP5,
	bGiaSP6,
	bGiaSP7,
	bGiaSP8,
	bGiaSP9,
	bGiaSP10,
	bGiaSP11,
	bGiaSP12,
	bGiaSP13,
	bGiaSP14,
	bGiaSP15,
	bPickkupModel,
	bWeapons1,
	bWeapons2,
	bWeapons3,
	bWeapons4,
	bWeapons5,
	bWeapons6,
	bWeapons7,
	bWeapons8,
	bWeapons9,
	bWeapons10,
	bVatLieu,
	bGiaMua,
	bLuong[ 6 ],
	bBaoKe,
};
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)