Jump to content

Problema job Trucker/Garbage


.CristiaN
 Share

Recommended Posts

Salut, am si eu o problema. Am masinile la garbage/trucker sunt facute pentru job 9 si 10 asa au id-urile job-ul truck si garbage insa cand urca in cel de garbage de exemplu si dau /collecttrash spune ca nu sunt intr-o masina de gunoi. In gm am /collecttrash si tot. Vorba este ca inainte mi-a mers si nu am umblat la ele.

La jobul trucker cand urc intr-un tir nu apare checkpoint-ul sa incep munca insa daca cobor spune Job Failed. In gm am puse coordonatele, dialog-urile si tot.

Ma puteti ajuta? Raman dator.

Link to comment
Share on other sites

OnPlayerStateChange posteaza tot.

public OnPlayerStateChange(playerid, newstate, oldstate) {
	#if defined DEBUG
	    printf("[debug] OnPlayerStateChange(%d, %d, %d)", playerid, newstate, oldstate);
	#endif

	if(newstate == PLAYER_STATE_DRIVER)
	{
		if(playerVariables[playerid][pFirstPerson] == 1)
		{
			new p = GetPlayerVehicleID(playerid);
			pObj[playerid] = CreatePlayerObject(playerid,19300, 0.0000, -1282.9984, 10.1493, 0.0000, -1, -1, 100);
			AttachPlayerObjectToVehicle(playerid,pObj[playerid],p,-0.314999, -0.195000, 0.510000, 0.000000, 0.000000, 0.000000);
			AttachCameraToPlayerObject(playerid,pObj[playerid]);
		}
	}
	else if(playerVariables[playerid][pFirstPerson] == 0)
	{
		SetCameraBehindPlayer(playerid);
		DestroyPlayerObject(playerid,pObj[playerid]);
	}
	if(newstate == PLAYER_STATE_ONFOOT)
	{
		if(playerVariables[playerid][pFirstPerson] == 1)
		{
			SetCameraBehindPlayer(playerid);
			DestroyPlayerObject(playerid,pObj[playerid]);
		}
	}
	foreach(Player, x)
	{
		if(playerVariables[x][pSpectating] != INVALID_PLAYER_ID && playerVariables[x][pSpectating] == playerid)
		{
			if(newstate == 2 && oldstate == 1 || newstate == 3 && oldstate == 1)
			{
				new string[500];
				new Float: health;
				GetPlayerHealth(playerid, health);

				new Float:health2;
		    	new veh = GetPlayerVehicleID(playerid);
		    	GetVehicleHealth(veh, health2);

		    	new Speed = GetSpeed(playerid);



				format(string, 500,"%s [~r~%i~w~] - L ~r~%i~w~", playerVariables[playerid][pNormalName], playerid,playerVariables[playerid][pLevel]);
				TextDrawSetString(info[x], string);

				format(string, 500,"Health: ~r~%.0f~w~", health);
				TextDrawSetString(viata[x], string);

				format(string, 500,"W: ~r~%d~w~ - Jail: ~r~%d~w~ minutes", playerVariables[playerid][pWarrants], playerVariables[playerid][pPrisonTime] / 60);
				TextDrawSetString(wantedjail[x], string);

				format(string, 500,"Car ~r~%d~w~ [~r~%.0f~w~ HP]", GetPlayerVehicleID(playerid), health2);
				TextDrawSetString(carinfo[x], string);

				format(string, 500,"Speed: ~g~%d KM/H~w~", Speed);
				TextDrawSetString(carspeed[x], string);

				TextDrawShowForPlayer(x, info[x]);
				TextDrawShowForPlayer(x, carspeed[x]);
				TextDrawShowForPlayer(x, carinfo[x]);
				TextDrawShowForPlayer(x, viata[x]);
				TextDrawShowForPlayer(x, wantedjail[x]);

				PlayerSpectateVehicle(x, GetPlayerVehicleID(playerid));
			}
			else
			{
				new string[500];
				new Float: health;
				GetPlayerHealth(playerid, health);

				format(string, 500,"%s [~r~%i~w~] - L ~r~%i~w~", playerVariables[playerid][pNormalName], playerid,playerVariables[playerid][pLevel]);
				TextDrawSetString(info[x], string);

				format(string, 500,"Health: ~r~%.0f~w~", health);
				TextDrawSetString(viata[x], string);

				format(string, 500,"W: ~r~%d~w~ - Jail: ~r~%d~w~ minutes", playerVariables[playerid][pWarrants], playerVariables[playerid][pPrisonTime] / 60);
				TextDrawSetString(wantedjail[x], string);
				TextDrawShowForPlayer(x, info[x]);
				TextDrawShowForPlayer(x, viata[x]);
				TextDrawShowForPlayer(x, wantedjail[x]);
				TextDrawHideForPlayer(x, carinfo[x]);
				TextDrawHideForPlayer(x, carspeed[x]);
				PlayerSpectatePlayer(x, playerid);
			}
		}
	}

	new vehicleid = GetPlayerVehicleID(playerid);
	if(newstate == PLAYER_STATE_DRIVER)
	{


	    new newcar = GetPlayerVehicleID(playerid);
    	new plane = GetVehicleModel(newcar);
    	if(plane == 487 || plane == 497 || plane == 469)
    	{
    	    if(playerVariables[playerid][pFlyLicense] == 0)
    	    {
    	    	if(TakingLesson[playerid] == 0)
				{
					RemovePlayerFromVehicle(playerid);
					SendClientMessage(playerid, COLOR_WHITE, "You don't have the fly license.");
				}
    	    }
    	}
    	new boat = GetVehicleModel(newcar);
    	if(boat == 430 || boat == 446 || boat == 452 || boat == 453 || boat == 454 || boat == 472 || boat == 473 || boat == 484  || boat == 493 || boat == 595)
    	{
    	    if(playerVariables[playerid][pBoatLicense] == 0)
    	    {
    	    	if(TakingLesson[playerid] == 0)
				{
					RemovePlayerFromVehicle(playerid);
					SendClientMessage(playerid, COLOR_WHITE, "You don't have the boat license.");
				}
    	    }
    	}
	    if(IsABike(vehicleid))
		{
			new vid = GetPlayerVehicleID(playerid);
			GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
			SetVehicleParamsEx(vid,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
		}
		if(newcar == 218 || newcar == 114 || newcar == 77 || newcar == 116 || newcar == 122)
		{
			if(HireCar[playerid] != newcar)
			{
				new vehicles,string[256];
				vehicles = GetVehicleModel(newcar) - 400;
                format(string,sizeof(string),"{72BABA}Model: \t{D2CDD2}%s \n\n{72BABA}Pret: %d$",aVehicleNames[vehicles],businessVariables[18][bEnterPrice]);
			    ShowPlayerDialog(playerid, 266, DIALOG_STYLE_MSGBOX, "{0DC013}Rent car:", string, "Rent", "Cancel");
			}
		}
	    if(IsADmvCar(vehicleid))
	    {
	        if(TakingLesson[playerid] == 1 || playerVariables[playerid][pDriveLicense] == 0)
	        {
				CPR[playerid] = 100;
                SetPlayerRaceCheckpoint(playerid, 0,checkexam[0][0],checkexam[0][1],checkexam[0][2],checkexam[1][0],checkexam[1][1],checkexam[1][2],5.0);
	            SendClientMessage(playerid, COLOR_WHITE, "Urmeaza checkpoint-urile pentru a lua licenta de condus.");
				TextDrawSetString(DMV2[playerid], "Checkpoints: 0/11");
				TextDrawShowForPlayer(playerid, DMV1[playerid]);
				TextDrawShowForPlayer(playerid, DMV2[playerid]);
	        }
	        else
	        {
	            RemovePlayerFromVehicle(playerid);
	            SendClientMessage(playerid, COLOR_GREY, "You cannot drive this vehicle.");
	        }
	    }
	}
	if(newstate == PLAYER_STATE_WASTED)
	{
		if(playerVariables[playerid][pWarrants] >= 1)
		{
		    new string[256];
		    new wakaname[MAX_PLAYER_NAME];
		    new wakaname2[MAX_PLAYER_NAME];
		    new price = playerVariables[playerid][pWarrants] * 5000;
			new count = 0;
			GetPlayerName(playerid, wakaname, MAX_PLAYER_NAME);
			foreach(Player, i)
			{
				if(IsPlayerConnected(i))
				{
				    if((playerVariables[i][pGroup] == 1 || playerVariables[i][pGroup] == 2 || playerVariables[i][pGroup] == 3 || playerVariables[i][pGroup] == 5) && CrimInRange(50.0, playerid,i))
				    {
				        GetPlayerName(i, wakaname2, MAX_PLAYER_NAME);
						count = 1;
						format(string, sizeof(string), "~w~Running suspect bonus!");
						GameTextForPlayer(i, string, 5000, 1);
						playerVariables[i][pMoney] += price;
						PlayerPlaySound(i, 1058, 0.0, 0.0, 0.0);
						format(szMessage, sizeof(szMessage), "Ai primit $%d pentru prinderea suspectului %s!",price, wakaname);
						SCM(i,COLOR_BLUE,szMessage);
					}
				}
			}
			if(count == 1)
			{
				playerVariables[playerid][pMoney] -= 500;
				playerVariables[playerid][pPrisonID] = 3;
				format(szMessage, sizeof(szMessage), "* %s is now in jail! Thanks to: %s!", wakaname, wakaname2);
				nearByMessage(playerid, COLOR_PURPLE, szMessage);
			    playerVariables[playerid][pPrisonTime] = (playerVariables[playerid][pWarrants])*(300);
			    format(string, sizeof(string), "* You where killed and arrested for %d seconds and lost you %d$.", playerVariables[playerid][pPrisonTime], price);
			    SendClientMessage(playerid, COLOR_LIGHTRED, string);

			    format(szMessage, sizeof(szMessage), "DisPatch: %s [ID:%d] has been killed by %s and will be in jail for %d seconds.",wakaname, playerid, wakaname2, playerVariables[playerid][pPrisonTime]);
				sendDepartmentMessage(COLOR_RADIOCHAT, szMessage);

			    playerVariables[playerid][pWarrants] = 0;
				SetPlayerWantedLevel(playerid, 0);
				format(playerVariables[playerid][pCrimeReason], 250, "");

			}
		}
	}
	if(newstate == PLAYER_STATE_PASSENGER || newstate == PLAYER_STATE_DRIVER)
	{
	    new VID;
		VID = GetPlayerVehicleID(playerid);
	    if(Radio[VID] >= 1)
	    {
	        if(Radio[VID] == 1)
	        {
	             GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~g~ASCULTI RADIO BANDIT", 4000, 5);
               	 PlayAudioStreamForPlayer(playerid,"http://rbandit.dyndns.tv:8000");
	        }
	        if(Radio[VID] == 2)
	        {
  	 			GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~g~ASCULTI RADIO PRO FM", 4000, 5);
  	 			PlayAudioStreamForPlayer(playerid,"http://stream.profm.ro:8012/profm.mp3");
	        }
	        if(Radio[VID] == 3)
	        {
	             GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~g~ASCULTI RADIO TARAF", 4000, 5);
               	 PlayAudioStreamForPlayer(playerid,"http://radiotaraf.no-ip.biz:7100");
	        }
	        if(Radio[VID] == 4)
	        {
	             GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~g~ASCULTI RADIO ZU", 4000, 5);
               	 PlayAudioStreamForPlayer(playerid,"http://stream.radiozu.ro:8020/");
	        }
	        if(Radio[VID] == 5)
	        {
	             GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~g~ASCULTI KISS FM", 4000, 5);
               	 PlayAudioStreamForPlayer(playerid,"http://80.86.106.136:80");
	        }
	        if(Radio[VID] == 6)
	        {
	             GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~g~ASCULTI RADIO HOT STYLE", 4000, 5);
               	 PlayAudioStreamForPlayer(playerid,"http://live.radiohot.ro:8000/");
	        }
			if(Radio[VID] == 7)
	        {
	             GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~g~ASCULTI RADIO GANGSTA DANCE", 4000, 5);
               	 PlayAudioStreamForPlayer(playerid,"http://dance.radiogangsta.ro:8800");
	        }
			if(Radio[VID] == 8)
            {
				GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~g~Radio Romanian Hip-Hop", 4000, 5);
			    PlayAudioStreamForPlayer(playerid,"http://radioromanian.net/hiphop.pls");
			}
			if(Radio[VID] == 9)
            {
				GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~g~Radio Romanian Manele", 4000, 5);
			    PlayAudioStreamForPlayer(playerid,"http://radioromanian.net/manele.pls");
			}
			if(Radio[VID] == 10)
            {
				GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~g~Radio Romanian Popular", 4000, 5);
			    PlayAudioStreamForPlayer(playerid,"http://radioromanian.net/popular.pls");
			}
			if(Radio[VID] == 11)
            {
				GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~g~Radio GMusic Rock", 4000, 5);
			    PlayAudioStreamForPlayer(playerid, "http://www.radiogmusic.com/rock.m3u");
			}
			if(Radio[VID] == 12)
			{
				GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~g~Radio Mafia", 4000, 5);
			    PlayAudioStreamForPlayer(playerid,"http://www.radiomafia.ro/listen.m3u");
			}
			if(Radio[VID] == 13)
            {
				GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~g~Radio Greu de Difuzat", 4000, 5);
			    PlayAudioStreamForPlayer(playerid,"http://www.greudedifuzat.eu/greudedifuzat.m3u");
			}
			if(Radio[VID] == 14)
            {
				GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~g~Radio Radio Bandit", 4000, 5);
			    PlayAudioStreamForPlayer(playerid,"http://rbandit.dyndns.tv:8000");
			}
			if(Radio[VID] == 15)
            {
				GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~g~Radio Hot", 4000, 5);
			    PlayAudioStreamForPlayer(playerid,"http://live.radiohot.ro:8000");
			}
			if(Radio[VID] == 16)
            {
				GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~g~Radio GangSta", 4000, 5);
			    PlayAudioStreamForPlayer(playerid,"http://dance.radiogangsta.ro:8000");
			}
	    }
	}
	if(newstate == PLAYER_STATE_PASSENGER)
	{
	    new name[MAX_PLAYER_NAME];
	    new string[256];
	    GetPlayerName(playerid, name, sizeof(name));
	    foreach(Player, i)
	    {
	        if(IsPlayerConnected(i))
	        {
	            if(IsPlayerInVehicle(i, vehicleid) && GetPlayerState(i) == 2 && TransportDuty[i] > 0)
             	{
             		if(playerVariables[playerid][pMoney] < TransportValue[i])
	                {
	                    format(string, sizeof(string), "* You need $%d to enter.", TransportValue[i]);
						SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
						RemovePlayerFromVehicle(playerid);
	                }
	                else
	                {
	                    if(TransportDuty[i] == 1)
	                    {
							format(string, sizeof(string), "* Passenger %s has entered your Taxi.", name);
							SendClientMessage(i, COLOR_LIGHTBLUE, string);
							TransportTime[i] = 1;
	                    	TransportTime[playerid] = 1;
	                    	TransportCost[playerid] = TransportValue[i];
	                    	TransportCost[i] = TransportValue[i];
	                    	TransportDriver[playerid] = i;
	                    }
	                    else if(TransportDuty[i] == 2)
	                    {
	                        format(string, sizeof(string), "* You paid $%d to the bus driver.", TransportValue[i]);
							SendClientMessage(playerid, COLOR_WHITE, string);
							format(string, sizeof(string), "* Passenger %s has entered your bus.", name);
							SendClientMessage(i, COLOR_WHITE, string);
							playerVariables[i][pMoney] += TransportValue[i];
							playerVariables[playerid][pMoney] -= TransportValue[i];
	                    }
	                    TransportMoney[i] += TransportValue[i];
	           	    }
	            }
	        }
	    }
	}
	if(newstate == PLAYER_STATE_ONFOOT)
	{

		JustStarted[playerid] = 0;
	    GunoierVar[playerid] = 0;
	    PlayerIsSweeping[playerid] = 0;
	    StopAudioStreamForPlayer(playerid);
	    Bus[playerid] = 0;
	    if(TransportDuty[playerid] > 0)
		{
		    if(TransportDuty[playerid] == 1)
			{
		        TaxiDrivers -= 1;
			}
			TransportDuty[playerid] = 0;
		    TransportValue[playerid] = 0;
			TransportMoney[playerid] = 0;
			TransportTime[playerid] = 0;
		}
		if(TransportCost[playerid] > 0 && TransportDriver[playerid] < 999)
		{
      if(IsPlayerConnected(TransportDriver[playerid]))
			{
			    new string[64];
			    TransportMoney[TransportDriver[playerid]] += TransportCost[playerid];
			    TransportTime[TransportDriver[playerid]] = 0;
			    TransportCost[TransportDriver[playerid]] = 0;
			    format(string, sizeof(string), "~w~Passenger left~n~~g~Earned $%d",TransportCost[playerid]);
			    GameTextForPlayer(TransportDriver[playerid], string, 5000, 1);
			}
		}
		if(TransportCost[playerid] > 0 && TransportDriver[playerid] < 999)
		{
		    if(IsPlayerConnected(TransportDriver[playerid]))
			{
				    new name[MAX_PLAYER_NAME],name2[MAX_PLAYER_NAME];
				    GetPlayerName(playerid, name, sizeof(name));
				    GetPlayerName(TransportDriver[playerid], name2, sizeof(name2));
				    format(szMessage, sizeof(szMessage), "# %s gets off the cab and pays %d$ to %s", name, TransportCost[playerid],name2);
				    nearByMessage(playerid, COLOR_PURPLE, szMessage);
					TransportCost[playerid] = 0;
					TransportTime[playerid] = 0;
					TransportDriver[playerid] = 999;
					playerVariables[TransportDriver[playerid]][pMoney] += TransportCost[playerid];
					playerVariables[playerid][pMoney] -= TransportCost[playerid];
			}
		}
	}
 	if(newstate == PLAYER_STATE_DRIVER)
	{
		new newcar = GetPlayerVehicleID(playerid);
		if(vehicleVariables[newcar][vVehicleJob] == 7 && playerVariables[playerid][pJob] == 7)
		{
			Sweeps[playerid] = 2;
			SCM(playerid, COLOR_YELLOW, "Mergi cu tractorul 2 minute pentru a fi platit. ");
			MowerMoney[playerid] = 120;
			mowertimer[playerid] = SetTimerEx("SetMower", 1000, 1, "d", playerid);
		}
		if(vehicleVariables[newcar][vVehicleJob] == 9 && playerVariables[playerid][pJob] == 9)
		{
		    SendClientMessage(playerid, COLOR_YELLOW, "Use /collecttrash to start your job.");
		}
		if(vehicleVariables[newcar][vVehicleJob] == 10 && playerVariables[playerid][pJob] == 10)
		{
		    SendClientMessage(playerid, COLOR_YELLOW, "Go to checkpoint to start your job.");
		    SetPlayerCheckpoint(playerid, -54.6322,-1461.7084,6.8239,5.0);
		}
   		if((playerVariables[playerid][pGroupRank] < vehicleVariables[newcar][vVehicleGroupRank]) && (playerVariables[playerid][pGroup] == vehicleVariables[newcar][vVehicleGroup]))
		{
			if(playerVariables[playerid][pAdminLevel] >= 1 && playerVariables[playerid][pAdminDuty] >= 1)
			{
				format(szMessage, sizeof(szMessage), "Aceasta masina poate fi condusa doar de membrii cu rank %d+.",vehicleVariables[newcar][vVehicleGroupRank]);
				SendClientMessage(playerid, COLOR_GREY,szMessage);

			}
			else
			{
				format(szMessage, sizeof(szMessage), "Aceasta masina poate fi condusa doar de membrii cu rank %d+.",vehicleVariables[newcar][vVehicleGroupRank]);
				SendClientMessage(playerid, COLOR_GREY,szMessage);
			    RemovePlayerFromVehicle(playerid);
			}
		}
 	}
	if(newstate == PLAYER_STATE_DRIVER)
	{
	    if(IsABike(vehicleid))
  		{
  		    TakingLesson[playerid] = 1;
		}
		if(!IsADmvCar(vehicleid))
		{
	 			if(playerVariables[playerid][pDriveLicense] == 0)
				{
				    if(TakingLesson[playerid] == 0)
				    {
						RemovePlayerFromVehicle(playerid);
						SendClientMessage(playerid, COLOR_GREY, "You don't have a driving license.");
					}
				}
		}
	}
 		if(newstate == 2)
 	{
		for(new i = 0; i < MAX_VEHICLES; i++)
		{
		    if(vehicleVariables[i][vVehicleScriptID] == GetPlayerVehicleID(playerid) && vehicleVariables[i][vVehicleGroup] != 0 && vehicleVariables[i][vVehicleGroup] != playerVariables[playerid][pGroup])
			{
				if(playerVariables[playerid][pAdminLevel] >= 1 && playerVariables[playerid][pAdminDuty] >= 1)
				{
					format(szMessage, sizeof(szMessage), "This %s [Model %d, ID %d) is locked to group %s [%d].", VehicleNames[GetVehicleModel(i) - 400], GetVehicleModel(i), i, groupVariables[vehicleVariables[i][vVehicleGroup]][gGroupName], vehicleVariables[i][vVehicleGroup]);
					SendClientMessage(playerid, COLOR_GREY, szMessage);
					return 1;
				}
				else
				{
				    format(szMessage, sizeof(szMessage), "Aceasta masina poate fi condusa doar de membrii %s.", groupVariables[vehicleVariables[i][vVehicleGroup]][gGroupName]);
					SendClientMessage(playerid, COLOR_GREY, szMessage);
					RemovePlayerFromVehicle(playerid);
					return 1;
				}
			}
			if(vehicleVariables[i][vVehicleScriptID] == GetPlayerVehicleID(playerid) && vehicleVariables[i][vVehicleJob] != 0 && vehicleVariables[i][vVehicleJob] != playerVariables[playerid][pJob])
			{
				if(playerVariables[playerid][pAdminLevel] >= 1 && playerVariables[playerid][pAdminDuty] >= 1)
				{
					format(szMessage, sizeof(szMessage), "This %s [Model %d, ID %d] is locked to job %s [%d].", VehicleNames[GetVehicleModel(i) - 400], GetVehicleModel(i), i, jobVariables[vehicleVariables[i][vVehicleJob]][jJobName], vehicleVariables[i][vVehicleJob]);
					SendClientMessage(playerid, COLOR_GREY, szMessage);
					return 1;
				}
				else
				{
					format(szMessage, sizeof(szMessage), "Aceasta masina poate fi condusa doar de cei care detin jobul %s.", jobVariables[vehicleVariables[i][vVehicleJob]][jJobName]);
					SendClientMessage(playerid, COLOR_GREY, szMessage);
					RemovePlayerFromVehicle(playerid);
					return 1;
				}
			}
        }
		foreach(Player, x)
		{
			if(playerVariables[x][pCarID1] == GetPlayerVehicleID(playerid))
			{
				new query[500];
				mysql_format(handle, query, sizeof(query), "SELECT `playerCar1Days` FROM `playeraccounts` WHERE `playeraccounts`.`playerID` = '%d'", playerVariables[x][pInternalID]);
				new Cache: result690 = mysql_query(handle, query);
				new query2[256];
				new days;
				cache_get_field_content(0, "playerCar1Days", query2);
				days = strval(query2);
				cache_delete(result690);

				if(playerVariables[x][pCarLock] == 1 && playerVariables[x][pAdminLevel] < 1)
				{
					RemovePlayerFromVehicle(playerid);
					SendClientMessage(playerid, COLOR_GREY, "This vehicle is locked.");
				}
				else if(playerVariables[x][pCarLock] == 1 && playerVariables[x][pAdminLevel] > 0)
				{

					SendClientMessage(playerid, COLOR_GREY, "This vehicle is locked.");
					format(szMessage, sizeof(szMessage), "This %s [ID:%d] is owned by %s. | Age: %d days | Odometer: %d km | Insurance: $%s [%d points]", VehicleNames[playerVariables[x][pCarModel1] - 400],playerVariables[x][pCarID1], playerVariables[x][pNormalName], days,playerVariables[x][pCarKM],NumberFormat(playerVariables[x][pInsurance]),playerVariables[x][pInsurancePoints]);
					SendClientMessage(playerid, COLOR_GREY, szMessage);
				}
				else
				{
				    if(playerVariables[x][pInsurancePoints] > 0)
				    {
						format(szMessage, sizeof(szMessage), "This %s [ID:%d] is owned by %s. | Age: %d days | Odometer: %d km | Insurance: $%s [%d points]", VehicleNames[playerVariables[x][pCarModel1] - 400],playerVariables[x][pCarID1], playerVariables[x][pNormalName], days,playerVariables[x][pCarKM],NumberFormat(playerVariables[x][pInsurance]),playerVariables[x][pInsurancePoints]);
						SendClientMessage(playerid, COLOR_GREY, szMessage);
					}
					else
					{
		 				SCM(x,-1,"Nu poti folosi masina deoarece detinatorul nu a platit asigurarea.");
		 				RemovePlayerFromVehicle(x);
					}
				}
				if(playerVariables[playerid][pNormalName] != playerVariables[x][pNormalName])
				{
					format(szMessage, 256, "Player %s (%d) has entered your vehicle and the alarm starts. Use [/stopalarm 1] to stop the alarm.", GetName(playerid), playerid);
					SCM(x, COLOR_ATTACK,szMessage);
					alarmed[playerVariables[x][pCarID1]] = 1;
					SetTimerEx("beeper",BEEP_INTERVAL*1000, false, "i", playerVariables[x][pCarID1]);
				}
			}
			if(playerVariables[x][pCarID2] == GetPlayerVehicleID(playerid))
			{
				new query[500];
				mysql_format(handle, query, sizeof(query), "SELECT `playerCar2Days` FROM `playeraccounts` WHERE `playeraccounts`.`playerID` = '%d'", playerVariables[x][pInternalID]);
				new Cache: result690 = mysql_query(handle, query);
				new query2[256];
				new days;
				cache_get_field_content(0, "playerCar2Days", query2);
				days = strval(query2);
				cache_delete(result690);

				if(playerVariables[x][pCarLock2] == 1 && playerVariables[x][pAdminLevel] < 1)
				{
					RemovePlayerFromVehicle(playerid);
					SendClientMessage(playerid, COLOR_GREY, "This vehicle is locked.");
				}
				else if(playerVariables[x][pCarLock2] == 1 && playerVariables[x][pAdminLevel] > 0)
				{

					SendClientMessage(playerid, COLOR_GREY, "This vehicle is locked.");
					format(szMessage, sizeof(szMessage), "This %s [ID:%d] is owned by %s. | Age: %d days | Odometer: %d km | Insurance: $%s [%d points]", VehicleNames[playerVariables[x][pCarModel2] - 400],playerVariables[x][pCarID2], playerVariables[x][pNormalName], days,playerVariables[x][pCarKM2],NumberFormat(playerVariables[x][pInsurance2]),playerVariables[x][pInsurancePoints2]);
					SendClientMessage(playerid, COLOR_GREY, szMessage);
				}
				else
				{
				    if(playerVariables[x][pInsurancePoints2] > 0)
				    {
						format(szMessage, sizeof(szMessage), "This %s [ID:%d] is owned by %s. | Age: %d days | Odometer: %d km | Insurance: $%s [%d points]", VehicleNames[playerVariables[x][pCarModel2] - 400],playerVariables[x][pCarID2], playerVariables[x][pNormalName], days,playerVariables[x][pCarKM2],NumberFormat(playerVariables[x][pInsurance2]),playerVariables[x][pInsurancePoints2]);
						SendClientMessage(playerid, COLOR_GREY, szMessage);
					}
					else
					{
					    SCM(x,-1,"Nu poti folosi masina deoarece detinatorul nu a platit asigurarea.");
					    RemovePlayerFromVehicle(x);
					}
				}
				if(playerVariables[playerid][pNormalName] != playerVariables[x][pNormalName])
				{
					format(szMessage, 256, "Player %s [%d] has entered your vehicle and the alarm starts. Use [/stopalarm 2] to stop the alarm.", GetName(playerid), playerid);
					SCM(x, COLOR_ATTACK,szMessage);
					alarmed[playerVariables[x][pCarID2]] = 1;
					SetTimerEx("beeper",BEEP_INTERVAL*1000, false, "i", playerVariables[x][pCarID2]);
				}
			}
			if(playerVariables[x][pCarID3] == GetPlayerVehicleID(playerid))
			{
				new query[500];
				mysql_format(handle, query, sizeof(query), "SELECT `playerCar3Days` FROM `playeraccounts` WHERE `playeraccounts`.`playerID` = '%d'", playerVariables[x][pInternalID]);
				new Cache: result690 = mysql_query(handle, query);
				new query2[256];
				new days;
				cache_get_field_content(0, "playerCar3Days", query2);
				days = strval(query2);
				cache_delete(result690);

				if(playerVariables[x][pCarLock3] == 1 && playerVariables[x][pAdminLevel] < 1)
				{
					RemovePlayerFromVehicle(playerid);
					SendClientMessage(playerid, COLOR_GREY, "This vehicle is locked.");
				}
				else if(playerVariables[x][pCarLock3] == 1 && playerVariables[x][pAdminLevel] > 0)
				{

					SendClientMessage(playerid, COLOR_GREY, "This vehicle is locked.");
					format(szMessage, sizeof(szMessage), "This %s [ID:%d) is owned by %s. | Age: %d days | Odometer: %d km.", VehicleNames[playerVariables[x][pCarModel3] - 400],playerVariables[x][pCarID3], playerVariables[x][pNormalName], days,playerVariables[x][pCarKM3],NumberFormat(playerVariables[x][pInsurance3]),playerVariables[x][pInsurancePoints3]);
					SendClientMessage(playerid, COLOR_GREY, szMessage);
				}
				else
				{
				    if(playerVariables[x][pInsurancePoints3] > 0)
				    {
						format(szMessage, sizeof(szMessage), "This %s [ID:%d] is owned by %s. | Age: %d days | Odometer: %d km | Insurance: $%s [%d points]", VehicleNames[playerVariables[x][pCarModel3] - 400],playerVariables[x][pCarID3], playerVariables[x][pNormalName], days,playerVariables[x][pCarKM3],NumberFormat(playerVariables[x][pInsurance3]),playerVariables[x][pInsurancePoints3]);
						SendClientMessage(playerid, COLOR_GREY, szMessage);

					}
					else
					{
					    SCM(x,-1,"Nu poti folosi masina deoarece detinatorul nu a platit asigurarea.");
					    RemovePlayerFromVehicle(x);
					}

				}
				if(playerVariables[playerid][pNormalName] != playerVariables[x][pNormalName])
				{
					format(szMessage, 256, "Player %s [%d] has entered your vehicle and the alarm starts. Use [/stopalarm 3] to stop the alarm.", GetName(playerid), playerid);
					SCM(x, COLOR_ATTACK,szMessage);
					alarmed[playerVariables[x][pCarID3]] = 1;
					SetTimerEx("beeper",BEEP_INTERVAL*1000, false, "i", playerVariables[x][pCarID3]);
				}
			}
			if(playerVariables[x][pCarID4] == GetPlayerVehicleID(playerid))
			{
				new query[500];
				mysql_format(handle, query, sizeof(query), "SELECT `playerCar4Days` FROM `playeraccounts` WHERE `playeraccounts`.`playerID` = '%d'", playerVariables[x][pInternalID]);
				new Cache: result690 = mysql_query(handle, query);
				new query2[256];
				new days;
				cache_get_field_content(0, "playerCar4Days", query2);
				days = strval(query2);
				cache_delete(result690);

				if(playerVariables[x][pCarLock4] == 1 && playerVariables[x][pAdminLevel] < 1)
				{
					RemovePlayerFromVehicle(playerid);
					SendClientMessage(playerid, COLOR_GREY, "This vehicle is locked.");
				}
				else if(playerVariables[x][pCarLock4] == 1 && playerVariables[x][pAdminLevel] > 0)
				{

					SendClientMessage(playerid, COLOR_GREY, "This vehicle is locked.");
					format(szMessage, sizeof(szMessage), "This %s [ID:%d] is owned by %s. | Age: %d days | Odometer: %d km | Insurance: $%s [%d points]", VehicleNames[playerVariables[x][pCarModel4] - 400],playerVariables[x][pCarID4], playerVariables[x][pNormalName], days,playerVariables[x][pCarKM4],NumberFormat(playerVariables[x][pInsurance4]),playerVariables[x][pInsurancePoints4]);
					SendClientMessage(playerid, COLOR_GREY, szMessage);
				}
				else
				{
    				if(playerVariables[x][pInsurancePoints4] > 0)
				    {
						format(szMessage, sizeof(szMessage), "This %s [ID:%d] is owned by %s. | Age: %d days | Odometer: %d km | Insurance: $%s [%d points]", VehicleNames[playerVariables[x][pCarModel4] - 400],playerVariables[x][pCarID4], playerVariables[x][pNormalName], days,playerVariables[x][pCarKM4],NumberFormat(playerVariables[x][pInsurance4]),playerVariables[x][pInsurancePoints4]);
						SendClientMessage(playerid, COLOR_GREY, szMessage);
					}
					else
					{
					    SCM(x,-1,"Nu poti folosi masina deoarece detinatorul nu a platit asigurarea.");
					    RemovePlayerFromVehicle(x);
					}
				}
				if(playerVariables[playerid][pNormalName] != playerVariables[x][pNormalName])
				{
					format(szMessage, 256, "Player %s [%d] has entered your vehicle and the alarm starts. Use [/stopalarm 4] to stop the alarm.", GetName(playerid), playerid);
					SCM(x, COLOR_ATTACK,szMessage);
					alarmed[playerVariables[x][pCarID4]] = 1;
					SetTimerEx("beeper",BEEP_INTERVAL*1000, false, "i", playerVariables[x][pCarID4]);
				}
			}
		}
    }
	return 1;
}

@Zoron, am in baza asa. Si le am trecut pe job id 9 adica garbage, respectiv 10 trucker.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.