Help me with this FS
#1

Hello ! I have this FS I have created it , It is FS trucker job .But when I connect the server does not have any vehicles and checkpoint created !!
What happned ? Please help me!
Sorry because my english !
Reply
#2

It is complete code
Код:
#include <a_samp>

#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
	print("\n--------------------------------------");
	print(" Blank Filterscript by your name here");
	print("--------------------------------------\n");
	return 1;
}

#define	TYPE_TPTRUCKRUNTIMER 10

// Trucker Job
#define DIALOG_LOADTRUCK 18301
#define DIALOG_LOADTRUCKL 18302
#define DIALOG_LOADTRUCKI 18303
#define TRUCKERJOB 10033
#define CHECKPOINT_LOADTRUCK 97651
#define CHECKPOINT_RETURNTRUCK 97652
#define MAX_PLAYERS 100
#define MAX_VEHICLES 1000



// Trucker Job
new INVALID_BAR_ID;
new INVALID_VEHICLE_ID;
new LoadTruckBar[MAX_PLAYERS] = INVALID_BAR_ID;
new LoadTruckTime[MAX_PLAYERS];
new TruckDeliver[MAX_PLAYERS];
new TruckUsed[MAX_PLAYERS] = INVALID_VEHICLE_ID;
new TruckContents[MAX_VEHICLES] = 0;

new TruckerVehicles[19];
new GetPlayerVehicleID;
new IsPlayerInRangeOfPoint;

OnGameModeInit()
{

	TruckerVehicles[0] = AddStaticVehicleEx(414,997.40002441,-1458.80004883,13.69999981,0.00000000,-1,-1,15); //Mule
	TruckerVehicles[1] = AddStaticVehicleEx(414,1001.90002441,-1458.90002441,13.69999981,0.00000000,-1,-1,15); //Mule
	TruckerVehicles[2] = AddStaticVehicleEx(414,1006.40002441,-1459.09997559,13.69999981,0.00000000,-1,-1,15); //Mule
	TruckerVehicles[3] = AddStaticVehicleEx(414,1010.50000000,-1458.90002441,13.69999981,0.00000000,-1,-1,15); //Mule
	TruckerVehicles[4] = AddStaticVehicleEx(414,1014.59997559,-1459.09997559,13.69999981,0.00000000,-1,-1,15); //Mule
	TruckerVehicles[5] = AddStaticVehicleEx(414,1019.20001221,-1459.09997559,13.69999981,0.00000000,-1,-1,15); //Mule
	TruckerVehicles[6] = AddStaticVehicleEx(414,1023.70001221,-1459.00000000,13.69999981,0.00000000,-1,-1,15); //Mule
	TruckerVehicles[7] = AddStaticVehicleEx(456,981.70001221,-1435.69995117,13.80000019,181.00000000,-1,-1,15); //Yankee
	TruckerVehicles[8] = AddStaticVehicleEx(456,986.90002441,-1435.90002441,13.80000019,180.99969482,-1,-1,15); //Yankee
	TruckerVehicles[9] = AddStaticVehicleEx(456,992.40002441,-1435.80004883,13.80000019,180.99426270,-1,-1,15); //Yankee
	TruckerVehicles[10] = AddStaticVehicleEx(456,997.00000000,-1435.80004883,13.80000019,180.99426270,-1,-1,15); //Yankee
	TruckerVehicles[11] = AddStaticVehicleEx(456,1001.79998779,-1435.90002441,13.80000019,180.99426270,-1,-1,15); //Yankee
	TruckerVehicles[12] = AddStaticVehicleEx(456,1006.70001221,-1436.00000000,13.80000019,180.99426270,-1,-1,15); //Yankee
	TruckerVehicles[13] = AddStaticVehicleEx(456,1012.00000000,-1435.69995117,13.80000019,180.99426270,-1,-1,15); //Yankee
	TruckerVehicles[14] = AddStaticVehicleEx(456,1017.09997559,-1436.00000000,13.80000019,180.99426270,-1,-1,15); //Yankee
	TruckerVehicles[15] = AddStaticVehicleEx(456,1022.59997559,-1435.90002441,13.80000019,180.99426270,-1,-1,15); //Yankee
	CreateDynamic3DTextLabel("Trucker Job \nType /join to become one",COLOR_RED,1031.87, -1442.67, 13.55+0.5,4.0);// Trucker Job (LS)
	CreatePickup(1239, 23, 1031.87, -1442.67, 13.55, -1); //Trucker Registration (LS)


public SurfingFix(playerid)
{
}
forward IsAtTruckDeliveryPoint(playerid);
IsAtTruckDeliveryPoint(playerid)
{
  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, 1837.636108, -1832.414062, 13.385854) ||
	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))
	{ return true; }
	return false;
}

forward CancelTruckDelivery(playerid);
CancelTruckDelivery(playerid)
{
	new vehicleid = GetPlayerVehicleID(playerid);
	if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
	{
		if(IsATruckerCar(vehicleid)) SetVehicleToRespawn(vehicleid);
	}
	DestroyProgressBar(LoadTruckBar[playerid]);
	LoadTruckBar[playerid] = INVALID_BAR_ID;
	LoadTruckTime[playerid] = 0;
	DeletePVar(playerid, "TruckDeliver");
	TruckContents[TruckUsed[playerid]] = 0;
	TruckUsed[playerid] = INVALID_VEHICLE_ID;
	gPlayerCheckpointStatus[playerid] = CHECKPOINT_NONE;
	DisablePlayerCheckpoint(playerid);
	return 1;
}

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
		if(IsATruckerCar(vehicleid))
		{
			if(PlayerInfo[playerid][pJob] == 20 || PlayerInfo[playerid][pJob2] == 20)
			{
				new string[128];

				new truckcontents = TruckContents[vehicleid];
				new truckcontentname[50];
				if(truckcontents == 0)
				{ format(truckcontentname, sizeof(truckcontentname), "None"); }
				else if(truckcontents >= 1 && truckcontents <= 3)
				{ format(truckcontentname, sizeof(truckcontentname), "{00F70C}Food & beverages");}
				else if(truckcontents >= 4 && truckcontents <= 6)
				{ format(truckcontentname, sizeof(truckcontentname), "{00F70C}Clothing"); }
				else if(truckcontents == 7)
				{ format(truckcontentname, sizeof(truckcontentname), "{00F70C}Legal materials"); }
				else if(truckcontents >= 8 && truckcontents <= 10)
				{ format(truckcontentname, sizeof(truckcontentname), "{00F70C}24/7 items"); }
				else if(truckcontents >= 11 && truckcontents <= 15)
				{ format(truckcontentname, sizeof(truckcontentname), "{FF0606}Illegal weapons"); }
				else if(truckcontents >= 16 && truckcontents <= 20)
				{ format(truckcontentname, sizeof(truckcontentname), "{FF0606}Illegal drugs"); }
				else if(truckcontents >= 21 && truckcontents <= 25)
				{ format(truckcontentname, sizeof(truckcontentname), "{FF0606}Illegal materials"); }

				format(string, sizeof(string), "TRUCKER JOB: (Truck registration: %s %d) - (Content: %s{FFFF00})", GetVehicleName(vehicleid), vehicleid, truckcontentname);
				SendClientMessageEx(playerid, COLOR_YELLOW, string);

				if(IsACop(playerid) && truckcontents >= 11)
				{
					SendClientMessageEx(playerid, COLOR_YELLOW, "TRUCKER JOB: To remove the illegal goods type /cleartruck near the Truck.");
				}
				if(truckcontents > 0 && TruckUsed[playerid] == INVALID_VEHICLE_ID)
				{
					SendClientMessageEx(playerid, COLOR_YELLOW, "TRUCKER JOB: To deliver the goods type /hijacktruck as the driver.");
				}
				else if(TruckUsed[playerid] == INVALID_VEHICLE_ID)
				{
					SendClientMessageEx(playerid, COLOR_YELLOW, "TRUCKER JOB: To get goods type /loadtruck as the driver.");
				}
				else if(TruckUsed[playerid] == vehicleid && gPlayerCheckpointStatus[playerid] == CHECKPOINT_RETURNTRUCK)
				{
					SendClientMessageEx(playerid, COLOR_YELLOW, "TRUCKER JOB: This is your Truck, you have not returned it to the docks yet for your pay.");
				}
				else if(TruckUsed[playerid] == vehicleid)
				{
					SendClientMessageEx(playerid, COLOR_YELLOW, "TRUCKER JOB: This is your Truck, you have not delivered your goods yet.");
				}
				else if(TruckUsed[playerid] != INVALID_VEHICLE_ID)
				{
					SendClientMessageEx(playerid, COLOR_YELLOW, "TRUCKER JOB: You are already on another delivery, type /cancel truck to cancel that delivery.");
				}
			}
			else
			{
				RemovePlayerFromVehicle(playerid);
				new Float:slx, Float:sly, Float:slz;
				GetPlayerPos(playerid, slx, sly, slz);
				SetPlayerPos(playerid, slx, sly, slz);
				NOPCheck(playerid);
				SendClientMessageEx(playerid, COLOR_GRAD2, "You are not a Trucker!");
			}
		}
		return 1;
}
IsATruckerCar(carid)
{
	for(new v = 0; v < sizeof(TruckerVehicles); v++)
	{
		if(carid == TruckerVehicles[v]) return 1;
	}
	return 0;
}
public OnPlayerConnect(playerid)
{

LoadTruckBar[playerid] = INVALID_BAR_ID; LoadTruckTime[playerid] = 0; TruckDeliver[playerid] = 0; TruckUsed[playerid] = INVALID_VEHICLE_ID;
LoadTruckBar[playerid] = INVALID_BAR_ID; LoadTruckTime[playerid] = 0; TruckDeliver[playerid] = 0; TruckUsed[playerid] = INVALID_VEHICLE_ID;

}
public OnPlayerEnterCheckpoint(playerid)
{
	if(GetPVarInt(playerid, "TruckDeliver") > 0 && gPlayerCheckpointStatus[playerid] != CHECKPOINT_RETURNTRUCK)
	{
		new vehicleid = GetPlayerVehicleID(playerid);
		if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER)
		{
			SendClientMessageEx(playerid, COLOR_WHITE, "You are not in a Truck!");
			return 1;
		}
		if(TruckUsed[playerid] != INVALID_VEHICLE_ID && vehicleid != TruckUsed[playerid])
		{
			SendClientMessageEx(playerid, COLOR_WHITE, "This is not your Truck with the goods you are suppose to deliver!");
			return 1;
		}

		if(!IsAtTruckDeliveryPoint(playerid))
		{// In the case the player finds a way to exploit the checkpoint to different location
			CancelTruckDelivery(playerid);
			SendClientMessageEx(playerid, COLOR_REALRED, "ERROR: Wrong checkpoint entered. Truck delivery canceled completely.");
			return 1;
		}

		if(GetPVarInt(playerid, "tpTruckRunTimer") != 0)
		{
  			new string[128];
			format(string, sizeof(string), "{AA3333}AdmWarning{FFFF00}: %s (ID %d) is possibly teleport truckrunning.", GetPlayerNameEx(playerid), playerid);
  			ABroadCast( COLOR_YELLOW, string, 2 );
    		format(string, sizeof(string), "%s (ID %d) is possibly teleport truckrunning.", GetPlayerNameEx(playerid), playerid);
	    	Log("logs/hack.log", string);
		}
		new truckdeliver = GetPVarInt(playerid, "TruckDeliver");
		TruckContents[vehicleid] = 0;

		if(truckdeliver >= 1 && truckdeliver <= 3)
		{
			SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "* You delivered the food & beverages, return the truck to the Los Santos to collect your pay.");
		}
		else if(truckdeliver >= 4 && truckdeliver <= 6)
		{
			SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "* You delivered the clothing, return the truck to the Los santos to collect your pay.");
		}
		else if(truckdeliver == 7)
		{
			SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "* You delivered the materials, return the truck to the Los Santos to collect your pay.");
		}
		else if(truckdeliver >= 8 && truckdeliver <= 10)
		{
			SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "* You delivered the 24/7 items, return the truck to the Los Santos to collect your pay.");
		}
		else if(truckdeliver >= 11 && truckdeliver <= 15)
		{
			SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "* You delivered the weapons, return the truck to the Los Santos to collect your pay.");
		}
		else if(truckdeliver >= 16 && truckdeliver <= 20)
		{
			SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "* You delivered the drugs, return the truck to the Los Santos to collect your pay.");
		}
		else if(truckdeliver >= 21 && truckdeliver <= 25)
		{
			SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "* You delivered the illegal materials, return the truck to the Los Santos to collect your pay.");
		}
		DisablePlayerCheckpoint(playerid);

		gPlayerCheckpointStatus[playerid] = CHECKPOINT_RETURNTRUCK;
		SetPlayerCheckpoint(playerid, 1031.86,-1451.62, 13.55, 5);
		GameTextForPlayer(playerid, "~w~Waypoint set ~r~Los Santos", 5000, 1);
		SendClientMessageEx(playerid, COLOR_WHITE, "HINT: Return to the Los Santos (see checkpoint on radar).");

		SetPVarInt(playerid, "tpTruckRunTimer", 30);
		SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_TPTRUCKRUNTIMER);
		return 1;
	}
	return 1;
}
forward OtherTimerEx(playerid, type);
public OtherTimerEx(playerid, type)
{
	if(type == TYPE_TPTRUCKRUNTIMER)
	{
    	if(GetPVarInt(playerid, "tpTruckRunTimer") > 0)
		{
			SetPVarInt(playerid, "tpTruckRunTimer", GetPVarInt(playerid, "tpTruckRunTimer")-1);
			SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_TPTRUCKRUNTIMER);
		}
	}
}

CMD:join(playerid, params[])
{
            if (PlayerInfo[playerid][pJob] == 0 && GetPlayerState(playerid) == 1 && IsPlayerInRangeOfPoint(playerid,3.0,-77.7288,-1136.3896,1.0781)) {
                SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "* If you are sure to become a Trucker, type /accept job.");
                GettingJob[playerid] = 16;
                return 1;
{
        else if (PlayerInfo[playerid][pJob] == 0 && GetPlayerState(playerid) == 1 && IsPlayerInRangeOfPoint(playerid,3.0,1031.87, -1442.67, 13.55)) {
				if(PlayerInfo[playerid][pLevel] >= 1)
				{
  					SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "* If you are sure to become a Trucker, type /accept job.");
    				GettingJob[playerid] = 20;
      				return 1;
	{
				else return SendClientMessageEx(playerid, COLOR_GREY, "You must be atleast level 2 to become a Trucker.");
			}
        else if (PlayerInfo[playerid][pJob2] == 0 && GetPlayerState(playerid) == 1 && IsPlayerInRangeOfPoint(playerid, 3.0, -77.7288,-1136.3896,1.0781)) {
                SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "* If you are sure to become a Trucker, type /accept job.");
                SendClientMessageEx(playerid, COLOR_YELLOW, "VIP: You are getting a secondary job. Only VIPs can do this.");
                GettingJob2[playerid] = 16;
                return 1;
            }
             else if (PlayerInfo[playerid][pJob2] == 0 && GetPlayerState(playerid) == 1 && IsPlayerInRangeOfPoint(playerid, 3.0, 1031.87, -1442.67, 13.55)) {
				if(PlayerInfo[playerid][pLevel] >= 1)
				{
  					SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "* If you are sure to become a Trucker, type /accept job.");
    				GettingJob2[playerid] = 20;
      				return 1;
				}
				else return SendClientMessageEx(playerid, COLOR_GREY, "You must be atleast level 2 to become a Trucker.");
            }
            else {
                SendClientMessageEx(playerid, COLOR_GREY, "You are not even near a place to get a Job!");
            }
        }
        else {
            SendClientMessageEx(playerid, COLOR_GREY, "You already have 2 Jobs, use /quitjob first!");
        }
    }
    else {
    else if (PlayerInfo[playerid][pJob] == 0 && GetPlayerState(playerid) == 1 && IsPlayerInRangeOfPoint(playerid,3.0,-77.7288,-1136.3896,1.0781)) {
            SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "* If you are sure to become a Trucker, type /accept job.");
            GettingJob[playerid] = 16;
            return 1;
		{
        else if (PlayerInfo[playerid][pJob] == 0 && GetPlayerState(playerid) == 1 && IsPlayerInRangeOfPoint(playerid,3.0,1031.87, -1442.67, 13.55)) {
			if(PlayerInfo[playerid][pLevel] >= 2)
			{
  				SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "* If you are sure to become a Trucker, type /accept job.");
    			GettingJob[playerid] = 20;
      			return 1;
			}
			else return SendClientMessageEx(playerid, COLOR_GREY, "You must be atleast level 2 to become a Trucker.");
        }
        else if (PlayerInfo[playerid][pJob] > 0) {
            SendClientMessageEx(playerid, COLOR_GREY, "You already have a Job, use /quitjob first!");
            SendClientMessageEx(playerid, COLOR_YELLOW, "VIP: Only VIPs can get two jobs!");
        }
    }
    return 1;
}


CMD:checktruck(playerid, params[])
{
	if(PlayerInfo[playerid][pJob] != 20 && PlayerInfo[playerid][pJob2] != 20 && !IsACop(playerid))
	{
		SendClientMessageEx(playerid, COLOR_GRAD2, "You are not a Trucker or a Cop!");
		return 1;
	}

	new carid = GetPlayerVehicleID(playerid);
	new closestcar = GetClosestCar(playerid, carid);
	if(IsPlayerInRangeOfVehicle(playerid, closestcar, 6.0) && IsATruckerCar(closestcar))
	{
		new string[128];

		new truckcontents = TruckContents[closestcar];
		new truckcontentname[50];
		if(truckcontents == 0)
		{ format(truckcontentname, sizeof(truckcontentname), "None"); }
		else if(truckcontents >= 1 && truckcontents <= 3)
		{ format(truckcontentname, sizeof(truckcontentname), "{00F70C}Food & beverages");}
		else if(truckcontents >= 4 && truckcontents <= 6)
		{ format(truckcontentname, sizeof(truckcontentname), "{00F70C}Clothing"); }
		else if(truckcontents == 7)
		{ format(truckcontentname, sizeof(truckcontentname), "{00F70C}Legal materials"); }
		else if(truckcontents >= 8 && truckcontents <= 10)
		{ format(truckcontentname, sizeof(truckcontentname), "{00F70C}24/7 items"); }
		else if(truckcontents >= 11 && truckcontents <= 15)
		{ format(truckcontentname, sizeof(truckcontentname), "{FF0606}Illegal weapons"); }
		else if(truckcontents >= 16 && truckcontents <= 20)
		{ format(truckcontentname, sizeof(truckcontentname), "{FF0606}Illegal drugs"); }
		else if(truckcontents >= 21 && truckcontents <= 25)
		{ format(truckcontentname, sizeof(truckcontentname), "{FF0606}Illegal materials"); }

		SendClientMessageEx(playerid, COLOR_GREEN,"________________ Los Santos Rodeo TRUCK ________________");
		if(IsPlayerInVehicle(playerid, closestcar))
		{
			SendClientMessageEx(playerid, COLOR_WHITE, "There is a player in that Truck. In order to check the content of the Truck the driver must be removed.");
			return 1;
		}

		format(string, sizeof(string), "Vehicle registration: %s (%d)", GetVehicleName(closestcar), closestcar);
		SendClientMessageEx(playerid, COLOR_WHITE, string);
		format(string, sizeof(string), "Content: %s", truckcontentname);
		SendClientMessageEx(playerid, COLOR_WHITE, string);

		if(IsACop(playerid) && truckcontents >= 11)
		{
			SendClientMessageEx(playerid, COLOR_YELLOW, "To remove the illegal goods type /cleartruck near the Truck.");
		}

		if(PlayerInfo[playerid][pJob] == 20 || PlayerInfo[playerid][pJob2] == 20)
		{
			if(truckcontents > 0 && TruckUsed[playerid] == INVALID_VEHICLE_ID)
			{
				SendClientMessageEx(playerid, COLOR_YELLOW, "To deliver the goods type /hijacktruck as the driver.");
			}
			else if(TruckUsed[playerid] == INVALID_VEHICLE_ID)
			{
				SendClientMessageEx(playerid, COLOR_YELLOW, "To get goods type /loadtruck as the driver.");
			}
			else if(TruckUsed[playerid] == closestcar && gPlayerCheckpointStatus[playerid] == CHECKPOINT_RETURNTRUCK)
			{
				SendClientMessageEx(playerid, COLOR_YELLOW, "This is your Truck, you have not returned it to the docks yet for your pay.");
			}
			else if(TruckUsed[playerid] == closestcar)
			{
				SendClientMessageEx(playerid, COLOR_YELLOW, "This is your Truck, you have not delivered your goods yet.");
			}
			else if(TruckUsed[playerid] != INVALID_VEHICLE_ID)
			{
				SendClientMessageEx(playerid, COLOR_YELLOW, "You are already on another delivery, type /cancel truck to cancel that delivery.");
			}
		}
		SendClientMessageEx(playerid, COLOR_GREEN,"_________________________________________________________");
	}
	else
	{
		SendClientMessageEx(playerid, COLOR_GRAD1, "You are not near a Los Santos Rodeo Truck.");
	}
	return 1;
}

CMD:cleartruck(playerid, params[])
{
	if(!IsACop(playerid))
	{
		SendClientMessageEx(playerid, COLOR_GRAD2, "You are not a Cop!");
		return 1;
	}

	new carid = GetPlayerVehicleID(playerid);
	new closestcar = GetClosestCar(playerid, carid);
	if(IsPlayerInRangeOfVehicle(playerid, closestcar, 6.0) && IsATruckerCar(closestcar))
	{
		new truckcontents = TruckContents[closestcar];
		if(truckcontents < 11)
		{
			SendClientMessageEx(playerid, COLOR_WHITE, "There are no illegal items in that Truck.");
			return 1;
		}
		new string[128];

		new truckcontentname[50];
		if(truckcontents >= 11 && truckcontents <= 15)
		{ format(truckcontentname, sizeof(truckcontentname), "{FF0606}illegal weapons"); }
		else if(truckcontents >= 16 && truckcontents <= 20)
		{ format(truckcontentname, sizeof(truckcontentname), "{FF0606}illegal drugs"); }
		else if(truckcontents >= 21 && truckcontents <= 25)
		{ format(truckcontentname, sizeof(truckcontentname), "{FF0606}illegal materials"); }
		foreach(Player, i)
		{
			if(TruckUsed[i] == closestcar)
			{
				DestroyProgressBar(LoadTruckBar[i]);
				LoadTruckBar[i] = INVALID_BAR_ID;
				LoadTruckTime[i] = 0;
				DeletePVar(i, "TruckDeliver");
				TruckUsed[i] = INVALID_VEHICLE_ID;
				TruckContents[closestcar] = 0;
				DisablePlayerCheckpoint(i);
				gPlayerCheckpointStatus[i] = CHECKPOINT_NONE;
				SendClientMessageEx(i, COLOR_WHITE, "Your Truck delivery has failed. Law enforcement has confiscated the illegal goods.");
			}
		}
		format(string, sizeof(string), "You removed the %s {FFFFFF}from the Truck.", truckcontentname);
		SendClientMessageEx(playerid, COLOR_WHITE, string);
		format(string, sizeof(string), "* %s has taken the illegal items from the Truck.", GetPlayerNameEx(playerid));
		ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
	}
	else
	{
		SendClientMessageEx(playerid, COLOR_GRAD1, "You are not near a Los Santos Rodeo Truck.");
	}
	return 1;
}
CMD:hijacktruck(playerid, params[])
{
	if(PlayerInfo[playerid][pJob] == 20 || PlayerInfo[playerid][pJob2] == 20)
	{
	    new vehicleid = GetPlayerVehicleID(playerid);
	    if(IsATruckerCar(vehicleid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
	    {
     		if(gPlayerCheckpointStatus[playerid] == CHECKPOINT_NONE || GetPVarInt(playerid, "Packages") >= 1 || TaxiAccepted[playerid] != 999 || EMSAccepted[playerid] != 999 || BusAccepted[playerid] != 999 || MedicAccepted[playerid] != 999 || MechanicCallTime[playerid] >= 1)
	        {
         		if(GetProgressBarValue(LoadTruckBar[playerid]) > 10)
	            {
	                SendClientMessageEx(playerid, COLOR_WHITE, "You are currently loading your Truck!");
					return 1;
	            }
	            if(TruckUsed[playerid] != INVALID_VEHICLE_ID)
	            {
	                SendClientMessageEx(playerid, COLOR_WHITE, "You are already on another delivery, type /cancel truck to cancel that delivery.");
					return 1;
	            }
				if(TruckContents[vehicleid] == 0)
				{
				    SendClientMessageEx(playerid, COLOR_WHITE, "This Truck is empty, it does not contain any goods!");
				    return 1;
				}
				if(IsPlayerInRangeOfPoint(playerid, 65, 1031.87, -1451.63, 13.55))
				{
				    SendClientMessageEx(playerid, COLOR_WHITE, "You can not hijack when that close to the Los Santos!");
					return 1;
				}

				SendClientMessageEx(playerid, COLOR_LIGHTBLUE,"* You are now attempting to hijack the truck, please wait....");

				TogglePlayerControllable(playerid, 0);
				SetPVarInt(playerid, "IsFrozen", 1);

 				LoadTruckBar[playerid] = CreateProgressBar(258.00, 137.00, 131.50, 3.19, COLOR_GREEN, 100.0);
				SetProgressBarValue(LoadTruckBar[playerid], 100.0);
				ShowProgressBarForPlayer(playerid, LoadTruckBar[playerid]);
				SetTimerEx("HijackTruck", 1000, 0, "dd", playerid);
	        }
	        else return SendClientMessageEx(playerid, COLOR_WHITE, "Please ensure that your current checkpoint is destroyed first (you either have material packages, or another existing checkpoint).");
	    }
	    else return SendClientMessageEx(playerid, COLOR_GREY, "You are not driving a Los Santos Rodeo Truck!");
	}
	else return SendClientMessageEx(playerid, COLOR_GREY, "You are not a Trucker!");
	return 1;
}


forward HijackTruck(playerid);
public HijackTruck(playerid)
{
	new vehicleid = GetPlayerVehicleID(playerid);
	LoadTruckTime[playerid]--;
	SetProgressBarValue(LoadTruckBar[playerid], GetProgressBarValue(LoadTruckBar[playerid])-10.0);
	UpdateProgressBar(LoadTruckBar[playerid], playerid);
	if(GetProgressBarValue(LoadTruckBar[playerid]) > 10) SetTimerEx("HijackTruck", 1000, 0, "d", playerid);

	if(GetProgressBarValue(LoadTruckBar[playerid]) == 50.0)
	{
		SetProgressBarColor(LoadTruckBar[playerid], COLOR_YELLOW);
		UpdateProgressBar(LoadTruckBar[playerid], playerid);
	}
	else if(GetProgressBarValue(LoadTruckBar[playerid]) == 20.0)
	{
		SetProgressBarColor(LoadTruckBar[playerid], COLOR_RED);
		UpdateProgressBar(LoadTruckBar[playerid], playerid);
	}
	else if(GetProgressBarValue(LoadTruckBar[playerid]) <= 10.0)
	{
		DeletePVar(playerid, "IsFrozen");
		TogglePlayerControllable(playerid, 1);
		DestroyProgressBar(LoadTruckBar[playerid]);
		LoadTruckBar[playerid] = INVALID_BAR_ID;

		if(!IsPlayerInVehicle(playerid, vehicleid))
		{
			DestroyProgressBar(LoadTruckBar[playerid]);
			LoadTruckBar[playerid] = INVALID_BAR_ID;
			LoadTruckTime[playerid] = 0;
			DeletePVar(playerid, "TruckDeliver");
			TruckUsed[playerid] = INVALID_VEHICLE_ID;
			gPlayerCheckpointStatus[playerid] = CHECKPOINT_NONE;
			DisablePlayerCheckpoint(playerid);
			SendClientMessageEx(playerid, COLOR_LIGHTBLUE,"* You failed to hijack the truck.");
			return 1;
		}


		foreach(Player, i)
		{
			if(TruckUsed[i] == vehicleid)
			{
				DestroyProgressBar(LoadTruckBar[i]);
				LoadTruckBar[i] = INVALID_BAR_ID;
				LoadTruckTime[i] = 0;
				DeletePVar(i, "TruckDeliver");
				TruckUsed[i] = INVALID_VEHICLE_ID;
				DisablePlayerCheckpoint(i);
				gPlayerCheckpointStatus[i] = CHECKPOINT_NONE;
				SendClientMessageEx(i, COLOR_WHITE, "Your Truck delivery has failed. Your Truck was hijacked.");
			}
		}

		new truckdeliver = TruckContents[vehicleid];
		SetPVarInt(playerid, "TruckDeliver", truckdeliver);
		TruckUsed[playerid] = vehicleid;

		if(truckdeliver == 1)
		{
			SendClientMessageEx(playerid, COLOR_LIGHTBLUE,"* Your hijacked a Truck filled with food & beverages.");
			SetPlayerCheckpoint(playerid, 920.421142, -1361.637084, 13.003659, 5);
		}
		else if(truckdeliver == 2)
		{
			SendClientMessageEx(playerid, COLOR_LIGHTBLUE,"* Your hijacked a Truck filled with food & beverages.");
			SetPlayerCheckpoint(playerid, 1197.744384, -886.373901, 42.819854, 5);
		}
		else if(truckdeliver == 3)
		{
			SendClientMessageEx(playerid, COLOR_LIGHTBLUE,"* Your hijacked a Truck filled with food & beverages.");
			SetPlayerCheckpoint(playerid, 2111.115722, -1783.749877, 13.188007, 5);
		}
		else if(truckdeliver == 4)
		{
			SendClientMessageEx(playerid, COLOR_LIGHTBLUE,"* Your hijacked a Truck filled with clothing.");
			SetPlayerCheckpoint(playerid, 2236.051757, -1690.114990, 13.744861, 5);
		}
		else if(truckdeliver == 5)
		{
			SendClientMessageEx(playerid, COLOR_LIGHTBLUE,"* Your hijacked a Truck filled with clothing.");
			SetPlayerCheckpoint(playerid, 454.168640, -1501.456909, 30.757781, 5);
		}
		else if(truckdeliver == 6)
		{
			SendClientMessageEx(playerid, COLOR_LIGHTBLUE,"* Your hijacked a Truck filled with clothing.");
			SetPlayerCheckpoint(playerid, 2111.877929, -1218.093139, 23.604995, 5);
		}
		else if(truckdeliver == 7)
		{
			SendClientMessageEx(playerid, COLOR_LIGHTBLUE,"* Your hijacked a Truck filled with materials.");
			SetPlayerCheckpoint(playerid, 2197.721923, -1975.567260, 13.359717, 5);
		}
		else if(truckdeliver == 8)
		{
			SendClientMessageEx(playerid, COLOR_LIGHTBLUE,"* Your hijacked a Truck filled with 24/7 items.");
			SetPlayerCheckpoint(playerid, 1339.484497, -1763.289916, 13.332603, 5);
		}
		else if(truckdeliver == 9)
		{
			SendClientMessageEx(playerid, COLOR_LIGHTBLUE,"* Your hijacked a Truck filled with 24/7 items.");
			SetPlayerCheckpoint(playerid, 1003.885925, -906.400634, 41.986915, 5);
		}
		else if(truckdeliver == 10)
		{
			SendClientMessageEx(playerid, COLOR_LIGHTBLUE,"* Your hijacked a Truck filled with 24/7 items.");
			SetPlayerCheckpoint(playerid, 1837.636108, -1832.414062, 13.385854, 5);
		}
		else if(truckdeliver >= 11 && truckdeliver <= 15)
		{
			SendClientMessageEx(playerid, COLOR_LIGHTBLUE,"* Your hijacked a Truck filled with weapons.");
			SetPlayerCheckpoint(playerid, 2781.596435, -2494.261230, 13.457942, 5);

			new level = PlayerInfo[playerid][pTruckSkill];
			if(level >= 0 && level <= 50)
			{ SetPVarInt(playerid, "TruckDeliver", 11); }
			else if(level >= 51 && level <= 100)
			{ SetPVarInt(playerid, "TruckDeliver", 12); }
			else if(level >= 101 && level <= 200)
			{ SetPVarInt(playerid, "TruckDeliver", 13); }
			else if(level >= 201 && level <= 400)
			{ SetPVarInt(playerid, "TruckDeliver", 14); }
			else if(level >= 401)
			{ SetPVarInt(playerid, "TruckDeliver", 15); }
		}
		else if(truckdeliver >= 16 && truckdeliver <= 20)
		{
			SendClientMessageEx(playerid, COLOR_LIGHTBLUE,"* Your hijacked a Truck filled with drugs.");
			SetPlayerCheckpoint(playerid, 2443.682373, -1426.901489, 23.796508, 5);

			new level = PlayerInfo[playerid][pTruckSkill];
			if(level >= 0 && level <= 50)
			{ SetPVarInt(playerid, "TruckDeliver", 16); }
			else if(level >= 51 && level <= 100)
			{ SetPVarInt(playerid, "TruckDeliver", 17); }
			else if(level >= 101 && level <= 200)
			{ SetPVarInt(playerid, "TruckDeliver", 18); }
			else if(level >= 201 && level <= 400)
			{ SetPVarInt(playerid, "TruckDeliver", 19); }
			else if(level >= 401)
			{ SetPVarInt(playerid, "TruckDeliver", 20); }
		}
		else if(truckdeliver >= 21 && truckdeliver <= 25)
		{
			SendClientMessageEx(playerid, COLOR_LIGHTBLUE,"* Your hijacked a Truck filled with illegal materials.");
			SetPlayerCheckpoint(playerid, 2166.486083, -2273.158935, 13.166786, 5);

			new level = PlayerInfo[playerid][pTruckSkill];
			if(level >= 0 && level <= 50)
			{ SetPVarInt(playerid, "TruckDeliver", 21); }
			else if(level >= 51 && level <= 100)
			{ SetPVarInt(playerid, "TruckDeliver", 22); }
			else if(level >= 101 && level <= 200)
			{ SetPVarInt(playerid, "TruckDeliver", 23); }
			else if(level >= 201 && level <= 400)
			{ SetPVarInt(playerid, "TruckDeliver", 24); }
			else if(level >= 401)
			{ SetPVarInt(playerid, "TruckDeliver", 25); }
		}

		SendClientMessageEx(playerid, COLOR_WHITE, "HINT: Deliver the goods to the specified location (see checkpoint on radar).");
		SendClientMessageEx(playerid, COLOR_REALRED, "WARNING: Watch out for truck hijackers, they can hijack your truck and get away with the goods.");
		if(truckdeliver >= 9)
		{
			SendClientMessageEx(playerid, COLOR_REALRED, "WARNING #2: You are transporting illegal goods so watch out for law enforcement.");
		}
		// If hijacked near delivery point it would send an inaccurate warning.
		/*SetPVarInt(playerid, "tpTruckRunTimer", 10);
		SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_TPTRUCKRUNTIMER);*/
	}
	return 1;
}

CMD:loadtruck(playerid, params[])
{
	if(PlayerInfo[playerid][pJob] == 20 || PlayerInfo[playerid][pJob2] == 20)
	{
	    new vehicleid = GetPlayerVehicleID(playerid);
	    if(IsATruckerCar(vehicleid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
	    {
	        if(gPlayerCheckpointStatus[playerid] == CHECKPOINT_NONE || GetPVarInt(playerid, "Packages") >= 1 || TaxiAccepted[playerid] != 999 || EMSAccepted[playerid] != 999 || BusAccepted[playerid] != 999 || MedicAccepted[playerid] != 999 || MechanicCallTime[playerid] >= 1)
	        {
	            if(GetProgressBarValue(LoadTruckBar[playerid]) > 10)
	            {
	                SendClientMessageEx(playerid, COLOR_WHITE, "You are currently loading your Truck!");
					return 1;
	            }
	            if(TruckUsed[playerid] != INVALID_VEHICLE_ID)
	            {
	                SendClientMessageEx(playerid, COLOR_WHITE, "You are already on another delivery, type /cancel truck to cancel that delivery.");
					return 1;
	            }
	            gPlayerCheckpointStatus[playerid] = CHECKPOINT_LOADTRUCK;
	            SetPlayerCheckpoint(playerid,1031.87, -1451.63, 13.55, 4);
	            GameTextForPlayer(playerid, "~w~Waypoint set ~r~Los Santos", 5000, 1);
	            SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "* Pick up some goods to transport with your Truck at Los Santos (see checkpoint on radar).");
	        }
	        else return SendClientMessageEx(playerid, COLOR_WHITE, "Please ensure that your current checkpoint is destroyed first (you either have material packages, or another existing checkpoint).");
	    }
	    else return SendClientMessageEx(playerid, COLOR_GREY, "You are not driving a Los Santos Truck!");
	}
	else return SendClientMessageEx(playerid, COLOR_GREY, "You are not a Trucker!");
	return 1;
}

forward LoadTruck(playerid);
public LoadTruck(playerid)
{
	LoadTruckTime[playerid]--;
	SetProgressBarValue(LoadTruckBar[playerid], GetProgressBarValue(LoadTruckBar[playerid])-10.0);
	UpdateProgressBar(LoadTruckBar[playerid], playerid);
	if(GetProgressBarValue(LoadTruckBar[playerid]) > 10) SetTimerEx("LoadTruck", 1000, 0, "d", playerid);

	if(GetProgressBarValue(LoadTruckBar[playerid]) == 50.0)
	{
		SetProgressBarColor(LoadTruckBar[playerid], COLOR_YELLOW);
		UpdateProgressBar(LoadTruckBar[playerid], playerid);
	}
	else if(GetProgressBarValue(LoadTruckBar[playerid]) == 20.0)
	{
		SetProgressBarColor(LoadTruckBar[playerid], COLOR_RED);
		UpdateProgressBar(LoadTruckBar[playerid], playerid);
	}
	else if(GetProgressBarValue(LoadTruckBar[playerid]) <= 10.0)
	{
		DeletePVar(playerid, "IsFrozen");
		TogglePlayerControllable(playerid, 1);
		DestroyProgressBar(LoadTruckBar[playerid]);
		LoadTruckBar[playerid] = INVALID_BAR_ID;

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

		if(truckdeliver == 1)
		{
			SendClientMessageEx(playerid, COLOR_LIGHTBLUE,"* Your Truck was filled with food & beverages.");
			SetPlayerCheckpoint(playerid, 920.421142, -1361.637084, 13.003659, 5);
		}
		else if(truckdeliver == 2)
		{
			SendClientMessageEx(playerid, COLOR_LIGHTBLUE,"* Your Truck was filled with food & beverages.");
			SetPlayerCheckpoint(playerid, 1197.744384, -886.373901, 42.819854, 5);
		}
		else if(truckdeliver == 3)
		{
			SendClientMessageEx(playerid, COLOR_LIGHTBLUE,"* Your Truck was filled with food & beverages.");
			SetPlayerCheckpoint(playerid, 2111.115722, -1783.749877, 13.188007, 5);
		}
		else if(truckdeliver == 4)
		{
			SendClientMessageEx(playerid, COLOR_LIGHTBLUE,"* Your Truck was filled with clothing.");
			SetPlayerCheckpoint(playerid, 2236.051757, -1690.114990, 13.744861, 5);
		}
		else if(truckdeliver == 5)
		{
			SendClientMessageEx(playerid, COLOR_LIGHTBLUE,"* Your Truck was filled with clothing.");
			SetPlayerCheckpoint(playerid, 454.168640, -1501.456909, 30.757781, 5);
		}
		else if(truckdeliver == 6)
		{
			SendClientMessageEx(playerid, COLOR_LIGHTBLUE,"* Your Truck was filled with clothing.");
			SetPlayerCheckpoint(playerid, 2111.877929, -1218.093139, 23.604995, 5);
		}
		else if(truckdeliver == 7)
		{
			SendClientMessageEx(playerid, COLOR_LIGHTBLUE,"* Your Truck was filled with materials.");
			SetPlayerCheckpoint(playerid, 2197.721923, -1975.567260, 13.359717, 5);
		}
		else if(truckdeliver == 8)
		{
			SendClientMessageEx(playerid, COLOR_LIGHTBLUE,"* Your Truck was filled with 24/7 items.");
			SetPlayerCheckpoint(playerid, 1339.484497, -1763.289916, 13.332603, 5);
		}
		else if(truckdeliver == 9)
		{
			SendClientMessageEx(playerid, COLOR_LIGHTBLUE,"* Your Truck was filled with 24/7 items.");
			SetPlayerCheckpoint(playerid, 1003.885925, -906.400634, 41.986915, 5);
		}
		else if(truckdeliver == 10)
		{
			SendClientMessageEx(playerid, COLOR_LIGHTBLUE,"* Your Truck was filled with 24/7 items.");
			SetPlayerCheckpoint(playerid, 1837.636108, -1832.414062, 13.385854, 5);
		}
		else if(truckdeliver >= 11 && truckdeliver <= 15)
		{
			SendClientMessageEx(playerid, COLOR_LIGHTBLUE,"* Your Truck was filled with weapons.");
			SetPlayerCheckpoint(playerid, 2781.596435, -2494.261230, 13.457942, 5);
		}
		else if(truckdeliver >= 16 && truckdeliver <= 20)
		{
			SendClientMessageEx(playerid, COLOR_LIGHTBLUE,"* Your Truck was filled with drugs.");
			SetPlayerCheckpoint(playerid, 2443.682373, -1426.901489, 23.796508, 5);
		}
		else if(truckdeliver >= 21 && truckdeliver <= 25)
		{
			SendClientMessageEx(playerid, COLOR_LIGHTBLUE,"* Your Truck was filled with illegal materials.");
			SetPlayerCheckpoint(playerid, 2166.486083, -2273.158935, 13.166786, 5);
		}

		SendClientMessageEx(playerid, COLOR_WHITE, "HINT: Deliver the goods to the specified location (see checkpoint on radar).");
		SendClientMessageEx(playerid, COLOR_REALRED, "WARNING: Watch out for truck hijackers, they can hijack your truck and get away with the goods.");
		if(truckdeliver >= 11)
		{
			SendClientMessageEx(playerid, COLOR_REALRED, "WARNING #2: You are transporting illegal goods so watch out for law enforcement.");
		}
		SetPVarInt(playerid, "tpTruckRunTimer", 30);
		SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_TPTRUCKRUNTIMER);
	}
	return 1;
}

CMD:cancel(playerid, params[])
{
	new string[128], choice[32];
	if(sscanf(params, "s[32]", choice))
	{
		SendClientMessageEx(playerid, COLOR_WHITE, "|__________________ Cancel __________________|");
		SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /cancel [name]");
		SendClientMessageEx(playerid, COLOR_GREY, "Available names: Truck);
		SendClientMessageEx(playerid, COLOR_WHITE, "|____________________________________________|");
		return 1;
	}
	if(strcmp(choice,"truck",true) == 0)
	{
		DestroyProgressBar(LoadTruckBar[playerid]);
		LoadTruckBar[playerid] = INVALID_BAR_ID;
		LoadTruckTime[playerid] = 0;
		DeletePVar(playerid, "TruckDeliver");
		TruckUsed[playerid] = INVALID_VEHICLE_ID;
		gPlayerCheckpointStatus[playerid] = CHECKPOINT_NONE;
		DisablePlayerCheckpoint(playerid);
	}
	else { return 1; }
	format(string, sizeof(string), "* You have canceled: %s.", choice);
	SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
	return 1;
}
if(dialogid == DIALOG_LOADTRUCK) // TRUCKER JOB LOAD TRUCK
	{
		if(response)
		{
			if(listitem == 0) // Legal goods
			{

				ShowPlayerDialog(playerid, DIALOG_LOADTRUCKL, DIALOG_STYLE_LIST, "What do you want to transport?","{00F70C}Food & beverages\n{00F70C}Clothing\n{00F70C}Materials\n{00F70C}24/7 Items", "Select", "Cancel");
			}
			if(listitem == 1) // Illegal goods
			{
				new level = PlayerInfo[playerid][pTruckSkill];
				if(level >= 0 && level <= 50)
				{
					ShowPlayerDialog(playerid, DIALOG_LOADTRUCKI, DIALOG_STYLE_LIST, "What do you want to transport?","{FF0606}Weapons 		{FFFFFF}(Level 1 Bonus: Free 9mm)\n{FF0606}Drugs 			{FFFFFF}(Level 1 Bonus: Free 2 pot, 1 crack)\n{FF0606}Illegal materials  	{FFFFFF}(Level 1 Bonus: Free 25 materials)", "Select", "Cancel");
				}
				else if(level >= 51 && level <= 100)
				{
					ShowPlayerDialog(playerid, DIALOG_LOADTRUCKI, DIALOG_STYLE_LIST, "What do you want to transport?","{FF0606}Weapons 		{FFFFFF}(Level 2 Bonus: Free Shotgun)\n{FF0606}Drugs 			{FFFFFF}(Level 2 Bonus: Free 4 pot, 2 crack)\n{FF0606}Illegal materials  	{FFFFFF}(Level 2 Bonus: Free 50 materials)", "Select", "Cancel");
				}
				else if(level >= 101 && level <= 200)
				{
					ShowPlayerDialog(playerid, DIALOG_LOADTRUCKI, DIALOG_STYLE_LIST, "What do you want to transport?","{FF0606}Weapons 		{FFFFFF}(Level 3 Bonus: Free MP5)\n{FF0606}Drugs 			{FFFFFF}(Level 3 Bonus: Free 6 pot, 3 crack)\n{FF0606}Illegal materials  	{FFFFFF}(Level 3 Bonus: Free 100 materials)", "Select", "Cancel");
				}
				else if(level >= 201 && level <= 400)
				{
					ShowPlayerDialog(playerid, DIALOG_LOADTRUCKI, DIALOG_STYLE_LIST, "What do you want to transport?","{FF0606}Weapons 		{FFFFFF}(Level 4 Bonus: Free Deagle)\n{FF0606}Drugs 			{FFFFFF}(Level 4 Bonus: Free 8 pot, 4 crack)\n{FF0606}Illegal materials  	{FFFFFF}(Level 4 Bonus: Free 150 materials)", "Select", "Cancel");
				}
				else if(level >= 401)
				{
					ShowPlayerDialog(playerid, DIALOG_LOADTRUCKI, DIALOG_STYLE_LIST, "What do you want to transport?","{FF0606}Weapons 		{FFFFFF}(Level 5 Bonus: Free AK-47 or M4)\n{FF0606}Drugs 			{FFFFFF}(Level 5 Bonus: Free 10 pot, 5 crack)\n{FF0606}Illegal materials  	{FFFFFF}(Level 5 Bonus: Free 200 materials)", "Select", "Cancel");
				}
			}
		}
		else
		{
			DeletePVar(playerid, "IsFrozen");
			TogglePlayerControllable(playerid, 1);
			SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You canceled the loading of the Truck, type /loadtruck to try again.");
		}
	}

	if(dialogid == DIALOG_LOADTRUCKL) // TRUCKER JOB LEGAL GOODS
	{
		if(response)
		{
			if(listitem == 0) // Food & beverages
			{
				new route = Random(1, 4);
				if(route == 1)
				{
					SetPVarInt(playerid, "TruckDeliver", 1);
				}
				if(route == 2)
				{
					SetPVarInt(playerid, "TruckDeliver", 2);
				}
				if(route == 3)
				{
					SetPVarInt(playerid, "TruckDeliver", 3);
				}
				SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "* Please wait a moment while the truck is being loaded with food & beverages....");
			}
			if(listitem == 1) // Clothing
			{
				new route = Random(1, 4);
				if(route == 1)
				{
					SetPVarInt(playerid, "TruckDeliver", 4);
				}
				if(route == 2)
				{
					SetPVarInt(playerid, "TruckDeliver", 5);
				}
				if(route == 3)
				{
					SetPVarInt(playerid, "TruckDeliver", 6);
				}
				SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "* Please wait a moment while the truck is being loaded with clothing....");
			}
			if(listitem == 2) // Materials
			{
				SetPVarInt(playerid, "TruckDeliver", 7);
				SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "* Please wait a moment while the truck is being loaded with materials....");
			}
			if(listitem == 3) // 24/7 Items
			{
				new route = Random(1, 4);
				if(route == 1)
				{
					SetPVarInt(playerid, "TruckDeliver", 8);
				}
				if(route == 2)
				{
					SetPVarInt(playerid, "TruckDeliver", 9);
				}
				if(route == 3)
				{
					SetPVarInt(playerid, "TruckDeliver", 10);
				}
				SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "* Please wait a moment while the truck is being loaded with 24/7 items....");
			}

			LoadTruckBar[playerid] = CreateProgressBar(258.00, 137.00, 131.50, 3.19, COLOR_GREEN, 100.0);
			SetProgressBarValue(LoadTruckBar[playerid], 100.0);
			ShowProgressBarForPlayer(playerid, LoadTruckBar[playerid]);
			SetTimerEx("LoadTruck", 1000, 0, "d", playerid);
		}
		else
		{
			DeletePVar(playerid, "IsFrozen");
			TogglePlayerControllable(playerid, 1);
			SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You canceled the loading of the Truck, type /loadtruck to try again.");
		}
	}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
	if(dialogid == DIALOG_LOADTRUCKI) // TRUCKER JOB ILLEGAL GOODS
	{
		if(response)
		{
			new level = PlayerInfo[playerid][pTruckSkill];
			if(listitem == 0) // Weapons
			{
				if(level >= 0 && level <= 50)
				{
					SetPVarInt(playerid, "TruckDeliver", 11); // Bonus: 9mm
				}
				else if(level >= 51 && level <= 100)
				{
					SetPVarInt(playerid, "TruckDeliver", 12); // Bonus: MP5
				}
				else if(level >= 101 && level <= 200)
				{
					SetPVarInt(playerid, "TruckDeliver", 13); // Bonus: Deagle
				}
				else if(level >= 201 && level <= 400)
				{
					SetPVarInt(playerid, "TruckDeliver", 14); // Bonus: AK-47
				}
				else if(level >= 401)
				{
					SetPVarInt(playerid, "TruckDeliver", 15); // Bonus: Ak-47 or M4
				}
				SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "* Please wait a moment while the truck is being loaded with weapons....");
			}
			if(listitem == 1) // Drugs
			{
				if(level >= 0 && level <= 50)
				{
					SetPVarInt(playerid, "TruckDeliver", 16); // Bonus: 10 pot, 5 crack
				}
				else if(level >= 51 && level <= 100)
				{
					SetPVarInt(playerid, "TruckDeliver", 17); // Bonus: 20 pot, 10 crack
				}
				else if(level >= 101 && level <= 200)
				{
					SetPVarInt(playerid, "TruckDeliver", 18); // Bonus: 30 pot, 15 crack
				}
				else if(level >= 201 && level <= 400)
				{
					SetPVarInt(playerid, "TruckDeliver", 19); // Bonus: 40 pot, 20 crack
				}
				else if(level >= 401)
				{
					SetPVarInt(playerid, "TruckDeliver", 20); // Bonus: 50 pot, 25 crack
				}
				SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "* Please wait a moment while the truck is being loaded with drugs....");
			}
			if(listitem == 2) // Illegal materials
			{
				if(level >= 0 && level <= 50)
				{
					SetPVarInt(playerid, "TruckDeliver", 21); // Bonus: 100 materials
				}
				else if(level >= 51 && level <= 100)
				{
					SetPVarInt(playerid, "TruckDeliver", 22); // Bonus: 300 materials
				}
				else if(level >= 101 && level <= 200)
				{
					SetPVarInt(playerid, "TruckDeliver", 23); // Bonus: 750 materials
				}
				else if(level >= 201 && level <= 400)
				{
					SetPVarInt(playerid, "TruckDeliver", 24); // Bonus: 1500 materials
				}
				else if(level >= 401)
				{
					SetPVarInt(playerid, "TruckDeliver", 25); // Bonus: 2500 materials
				}
				SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "* Please wait a moment while the truck is being loaded with illegal materials....");
			}

			LoadTruckBar[playerid] = CreateProgressBar(258.00, 137.00, 131.50, 3.19, COLOR_GREEN, 100.0);
			SetProgressBarValue(LoadTruckBar[playerid], 100.0);
			ShowProgressBarForPlayer(playerid, LoadTruckBar[playerid]);
			SetTimerEx("LoadTruck", 1000, 0, "d", playerid);
		}
		else
		{
			DeletePVar(playerid, "IsFrozen");
			TogglePlayerControllable(playerid, 1);
			SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You canceled the loading of the Truck, type /loadtruck to try again.");
		}
	}
	return 1;
}
Timer:VehicleUpdate[10000]()
{
	new engine,lights,alarm,doors,bonnet,boot,objective,modelid;
	for(new v = 0; v < MAX_VEHICLES; v++) if(GetVehicleModel(v)) {

		modelid = GetVehicleModel(v);
		GetVehicleParamsEx(v,engine,lights,alarm,doors,bonnet,boot,objective);
		switch(modelid) {
			case 520, 476, 593, 553, 513, 512, 577, 592, 511, 539, 464, 519: VehicleFuel[v] = 100;
			case 509, 481, 510: VehicleFuel[v] = 100, arr_Engine{v} = 1, SetVehicleParamsEx(v,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
		}
		if(engine == VEHICLE_PARAMS_ON) {
			if(VehicleFuel[v] > 0.0 && !IsVIPcar(v) && !IsATruckerCar(v))
			{
				VehicleFuel[v]-=0.25;
				if(VehicleFuel[v] <= 0.0) SetVehicleParamsEx(v,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
			}
			if(arr_Engine{v} == 0) SetVehicleParamsEx(v,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
		}
	}
}
#endif
Reply
#3

-

Don't forget to add at the top

#include <streamer>
#include <progress>
Reply
#4

Quote:
Originally Posted by Akira297
Посмотреть сообщение
-

Don't forget to add at the top

#include <streamer>
#include <progress>
Not working
Reply
#5

Help me !!!
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)