Problem
#1

Hello...
I use an Edit United Roleplay gm and i have a problem with cars...
When i take a car and when i get down from car in 2 seconds that car respawned...
How can I do that all the no respawning ?

I try with 999999 at AddStaticVehicle but don`t work..
I putted 9999999 ,but when i exit from car i wait 2 minutes and the car respawning.. And with -1 at final don`t work...
[Fix 2 minutes]
I deleted all SetVehicleToRespawn and don`t work...
[Sorry for my bad english]
Reply
#2

Post the codes for OnPlayerExitVehicle and/or OnPlayerStateChange
Reply
#3

Код:
public OnPlayerExitVehicle(playerid, vehicleid)
{
	if(PlayerSeatbelt[playerid] == 1)
	{
	        new string[128];
	    	new sendername[24];
			PlayerSeatbelt[playerid] = 0;
			GetPlayerName(playerid, sendername, sizeof(sendername));
  		  	format(string, sizeof(string), " %s unclips the seatbelt slowly While opening the door and leaving the vehicle", sendername);
	 		ProxDetector(15.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
 	}
    if(vehicleid >= PizzaBike[0] && vehicleid <= PizzaBike[4])
    {
		if(PlayerInfo[playerid][pPRoute] == 1)
		{
		    SendClientMessage(playerid, COLOR_WHITE,"Pizza-Bike Radio : Take the Pizza to the House-Door");
    		SetPlayerAttachedObject( playerid, 0, 1582, 1, -0.064613, 0.520760, 0.000000, 0.000000, 84.217391, 0.000000, 1.000000, 1.000000, 1.000000 );
	 		ApplyAnimation(playerid,"CARRY","crry_prtial",4.1,1,0,0,1,1);
	 	}
	 }
	 StopAudioStreamForPlayer(playerid);
	 return 1;
}
Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
	new string[128];
	if(newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER)
	{
	    //new newcar = GetPlayerVehicleID(playerid);
	    ShowSpeed[playerid] = 1;
	 	/*if(GetVehicleModel(newcar) != 509 && GetVehicleModel(newcar) != 481)  // BMX & Bike
	    {
	        RadioChoose(playerid, Radio[newcar]);
		}*/
	}
	/*if(newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER)
	{
		new vehicleid = GetPlayerVehicleID(playerid),
			playingid = v_VehicleInfo[vehicleid][RadioPlaying];
		#if USE_TEXTDRAW_SET == 2
			new string[50];
			format(string,sizeof(string),"Listening to: ~n~~w~%s",r_RadioInfo[playingid][r_Name]);
			TextDrawSetString(v_VehicleInfo[vehicleid][r_Draw],string);
		#else
			TextDrawSetString(v_VehicleInfo[vehicleid][r_Draw],r_RadioInfo[playingid][r_Name]);
		#endif
		TextDrawShowForPlayer(playerid,v_VehicleInfo[vehicleid][r_Draw]);
		SetPVarInt(playerid,"ID_HideRadioTextdraw",SetTimerEx("HideRadioTextdraw",TEXTDRAW_DISAPPEAR_TIME,false,"ii",playerid,vehicleid));
		PlayAudioStreamForPlayer(playerid,r_RadioInfo[playingid][r_Link]);
		SetPVarInt(playerid,"ID_OldVehicle",vehicleid);
		return 1;
	}
	if(oldstate == PLAYER_STATE_DRIVER || oldstate == PLAYER_STATE_PASSENGER)
	{
		new vehicleid = GetPVarInt(playerid,"ID_OldVehicle"),
			timer = GetPVarInt(playerid,"ID_HideRadioTextdraw");
		if(timer != -1)
		{
			TextDrawHideForPlayer(playerid,v_VehicleInfo[vehicleid][r_Draw]);
			KillTimer(timer);
		}
		StopAudioStreamForPlayer(playerid);
	}*/
	/*if(newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER)
	{
	    new gastext[41];
	    new vid = GetPlayerVehicleID(playerid);
     	format(gastext, sizeof(gastext), "Vehicle Fuel : %d", Gas[vid]);
	    TextDrawSetString(GasAmount, gastext);
	    TextDrawShowForPlayer(playerid, GasAmount);
	}
		if(oldstate == PLAYER_STATE_DRIVER || oldstate == PLAYER_STATE_PASSENGER)
	{
		TextDrawHideForPlayer(playerid, GasAmount);
	}*/
		if(newstate == PLAYER_STATE_PASSENGER)
	{
		if(GetPlayerVehicleID(playerid) == NPCBlueBus)
		{
		    SetPlayerVirtualWorld(playerid, 2);
		    SetPlayerPos(playerid, 2021.9740,2235.6626,2103.9536);
		    SetPlayerFacingAngle(playerid, 355.3504);
		    SetCameraBehindPlayer(playerid);
		    SetPlayerInterior(playerid, 1);
		    BusID[playerid] = 1;
		    GameTextForPlayer(playerid, "~w~Bus A-1", 3000, 1);
		    costtimer = SetTimerEx("CostTimer", 30000, 1, "d", playerid);
			SendClientMessage(playerid, -1,"You have entered the bus - Please take a seat");
		    BusCost[playerid] += 20;
		}
		else if(GetPlayerVehicleID(playerid) == NPCBlackBus)
		{
            SetPlayerVirtualWorld(playerid, 3);
		    SetPlayerPos(playerid, 2021.9740,2235.6626,2103.9536);
		    SetPlayerFacingAngle(playerid, 355.3504);
		    SetCameraBehindPlayer(playerid);
		    SetPlayerInterior(playerid, 1);
		    BusID[playerid] = 2;
		    GameTextForPlayer(playerid, "~w~Bus A-2", 3000, 1);
		    SendClientMessage(playerid, -1,"You have entered the bus - Please take a seat");
		    costtimer = SetTimerEx("CostTimer", 30000, 1, "d", playerid);
		    BusCost[playerid] += 20;
		}
	}
	if(newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER)
        {
        new vehicleid = GetPlayerVehicleID(playerid),
        playingid = v_VehicleInfo[vehicleid][RadioPlaying];
        if(USE_TEXTDRAW_SET == 2)
            {
            format(string,sizeof(string),"Listening to: ~n~~w~%s",r_RadioInfo[playingid][r_Name]);
            TextDrawSetString(v_VehicleInfo[vehicleid][r_Draw],string);
            }
        else
            {
            TextDrawSetString(v_VehicleInfo[vehicleid][r_Draw],r_RadioInfo[playingid][r_Name]);
            }
        TextDrawShowForPlayer(playerid,v_VehicleInfo[vehicleid][r_Draw]);
        SetPVarInt(playerid,"ID_HideRadioTextdraw",SetTimerEx("HideRadioTextdraw",TEXTDRAW_DISAPPEAR_TIME,false,"ii",playerid,vehicleid));
        PlayAudioStreamForPlayer(playerid,r_RadioInfo[playingid][r_Link]);
        SetPVarInt(playerid,"ID_OldVehicle",vehicleid);
        }
    	if(oldstate == PLAYER_STATE_DRIVER || oldstate == PLAYER_STATE_PASSENGER)
        {
        new vehicleid = GetPVarInt(playerid,"ID_OldVehicle"),
            timer = GetPVarInt(playerid,"ID_HideRadioTextdraw");
        if(timer != -1)
            {
            TextDrawHideForPlayer(playerid,v_VehicleInfo[vehicleid][r_Draw]);
            KillTimer(timer);
            }
        StopAudioStreamForPlayer(playerid);
    }
 	if(newstate == PLAYER_STATE_DRIVER)
	{
 		new vehicleid = GetPlayerVehicleID(playerid);
		GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
		if(engine == VEHICLE_PARAMS_OFF || engine == VEHICLE_PARAMS_UNSET)
		{
        	SendClientMessage(playerid, COLOR_WHITE,"< Pentru a porni/opri motorul scrie {800040}/engine{FFFFFF} - pentru comenzile de radio scrie - {800040}/radiohelp{FFFFFF} >");
		}
	}
	if(oldstate == PLAYER_STATE_DRIVER)
	{
		new model = GetVehicleModel(gLastCar[playerid]);
	    if(IsACopCar(gLastCar[playerid]) || model == 457)
		{
			SetPlayerWeapons(playerid);
		}
	}
	if(newstate == PLAYER_STATE_DRIVER)
	{
     if(GetPlayerVehicleID(playerid) >= PizzaBike[0] && GetPlayerVehicleID(playerid) <= PizzaBike[4])
		{
			if(PlayerInfo[playerid][pPRoute] == 1)
			{
			    SendClientMessage(playerid, COLOR_WHITE,"< Pizza-Bike Radio : Take the Bike to the Next House to Deliver their Pizza >");
      			PlayerInfo[playerid][pPizza] ++;
				switch(PlayerInfo[playerid][pPizza])
				    {
				    case 1:
						{
							SetPlayerCheckpoint(playerid,2384.8545,-1346.4927,24.3511, 3.0);
							SendClientMessage(playerid, COLOR_WHITE,"< Pizza-Bike Radio : Take the Bike to the Next House to Deliver their Pizza >");
						}
					case 2:
					    {
							SetPlayerCheckpoint(playerid,2230.8303,-1285.8970,25.3672, 3.0);
							SendClientMessage(playerid, COLOR_WHITE,"< Pizza-Bike Radio : Take the Bike to the Next House to Deliver Their Pizza >");
						}
					case 3:
					    {
					        SetPlayerCheckpoint(playerid,2086.1628,-1185.8599,25.5327, 3.0);
							SendClientMessage(playerid, COLOR_WHITE,"< Pizza-Bike Radio : Take the Bike to the Next House to Deliver Their Pizza >");
						}
					case 4:
					    {
					        SetPlayerCheckpoint(playerid,1246.5656,-1101.0764,26.6719, 3.0);
							SendClientMessage(playerid, COLOR_WHITE,"< Pizza-Bike Radio : Take the Bike to the Next House to Deliver Their Pizza >");
						}
					case 5:
					    {
					        SetPlayerCheckpoint(playerid,961.8271,-1825.1824,13.3194, 3.0);
					        SendClientMessage(playerid, COLOR_WHITE,"< Pizza-Bike Radio : Take the Bike to the Next House to Deliver Their Pizza >");
					    }
					case 6:
					    {
					        SetPlayerCheckpoint(playerid,2695.2781,-2018.0885,13.5292, 3.0);
							SendClientMessage(playerid, COLOR_WHITE,"< Pizza-Bike Radio : Take the Bike to the Next House to Deliver Their Pizza >");
						}
					case 7:
					    {
					        SetPlayerCheckpoint(playerid,2114.3188,-1774.2660,13.3923, 3.0);
					        SendClientMessage(playerid, COLOR_WHITE,"< Pizza-Bike Radio : Take the Pizza-Bike Back to the HQ and Park it to Take your Paycheck >");
							CP[playerid] = 1703;
						}
					}
				}
			}
		}
	if (newstate == 2)
	{
	    if (oldstate == 1)
	    {
	        new
				vID = GetPlayerVehicleID(playerid);
	    	if (IsRentableCar(vID))
	    	{
				if (!IsRentedCar(vID))
				{
				    new
						String[128];
				    format(String, 128, "~p~~n~rent cost: ~b~%d~n~~w~type ~b~/rentcar~n~~w~to exit it type~n~~p~/exitrental", RENT_COST);
				    GameTextForPlayer(playerid, String, 30000, 4);
				    SendClientMessage(playerid, COLOR_YELLOW,"Type {3399CC}/rentcar{FFFFFF} to rent this car");
				    SendClientMessage(playerid, -1, "Type {3399CC}/exitrental{FFFFFF} to exit this rental car.");
				    TogglePlayerControllable(playerid, 0);
				}
				else if (IsRentedCar(vID))
				{
				    if (GetPVarInt(playerid, "CarRentID") == vID)
				    {
			    		return SendClientMessage(playerid, -1, "{3399CC}Welcome{FFFFFF} to your rented car.");
					}
					else if (GetPVarInt(playerid, "CarRentID") != vID)
					{
						new
							String[128];
						format(String, 128, "This vehicle is rented by: {3399CC}%s{FFFFFF}", RentedBy[vID]);
						SendClientMessage(playerid, -1, String);
	    				SendClientMessage(playerid, -1, "Use {3399CC}/exitrental{FFFFFF} to exit this vehicle.");
       					return 1;
					}
				}
			}
		}
	}
	if(newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER)
    {
        new newcar = GetPlayerVehicleID(playerid);
		new x = 0;
		while(x != MAX_PLAYERS)
		{
	    	if(IsPlayerConnected(x) && GetPlayerState(x) == PLAYER_STATE_SPECTATING && SpectatedID[x] == playerid)
   			{
   		    	PlayerSpectateVehicle(x,newcar);
			}
			x++;
		}
    }
	if(newstate == PLAYER_STATE_ONFOOT)
	{
	    new x = 0;
	    //RadioChoose(playerid, 255);
		while(x != MAX_PLAYERS)
		{
	    	if(IsPlayerConnected(x) && GetPlayerState(x) == PLAYER_STATE_SPECTATING && SpectatedID[x] == playerid)
   			{
   		    	PlayerSpectatePlayer(x,playerid);
			}
			x++;
		}
	    if(TransportDuty[playerid] > 0)
		{
		    if(TransportDuty[playerid] == 1)
			{
		        TaxiDrivers -= 1;
			}
			else if(TransportDuty[playerid] == 2)
			{
			    BusDrivers -= 1;
			}
			TransportDuty[playerid] = 0;
			format(string, sizeof(string), "* You are now Off Duty and earned $%d.", TransportMoney[playerid]);
			SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
			PlayerInfo[playerid][pCash] = PlayerInfo[playerid][pCash]+TransportMoney[playerid];
			GivePlayerMoney(playerid, TransportMoney[playerid]);
			TransportValue[playerid] = 0; TransportMoney[playerid] = 0;
			SetPlayerColor(playerid, TCOLOR_WHITE);
			PlayerPlaySound(playerid,1055,0.0,0.0,0.0);
		}
		if(TransportCost[playerid] > 0 && TransportDriver[playerid] < 999)
		{
		    if(IsPlayerConnected(TransportDriver[playerid]))
			{
			    TransportMoney[TransportDriver[playerid]] += TransportCost[playerid];
			    TransportTime[TransportDriver[playerid]] = 0;
			    TransportCost[TransportDriver[playerid]] = 0;
			    format(string, sizeof(string), "~w~The ride cost~n~~r~$%d",TransportCost[playerid]);
			    GameTextForPlayer(playerid, string, 5000, 1);
			    format(string, sizeof(string), "~w~Passenger left the taxi~n~~g~Earned $%d",TransportCost[playerid]);
			    GameTextForPlayer(TransportDriver[playerid], string, 5000, 1);
			    PlayerInfo[playerid][pCash] = PlayerInfo[playerid][pCash]-TransportCost[playerid];
				GivePlayerMoney(playerid, -TransportCost[playerid]);
				TransportCost[playerid] = 0;
				TransportTime[playerid] = 0;
				TransportDriver[playerid] = 999;
				PlayerPlaySound(playerid,1083,0.0,0.0,0.0);
			}
		}
		new oldcar = gLastCar[playerid];
		if(oldcar >= Trucks[0] && oldcar <= Trucks[7])
		{
		    if(PlayerInfo[playerid][pJob] == 19)
		    {
			    if(CP[playerid] >= 1340 && CP[playerid] <= 1347)
				{
					DisablePlayerCheckpoint(playerid);
					CP[playerid] = 0;
					SendClientMessage(playerid, -1,"    To finish delivery, get back in the truck.");
				}
			}
		}
	}
	if(newstate == PLAYER_STATE_PASSENGER) // TAXI & BUSSES
	{
	    new name[MAX_PLAYER_NAME];
	    GetPlayerName(playerid, name, sizeof(name));
	    new vehicleid = GetPlayerVehicleID(playerid);
	    ////foreach(Player, i)
        for(new i; i<MAX_PLAYERS; i++)
	    {
	        if(IsPlayerConnected(i))
	        {
	            if(IsPlayerInVehicle(i, vehicleid) && GetPlayerState(i) == 2 && TransportDuty[i] > 0)
	            {
	                if(PlayerInfo[playerid][pCash] < 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), "* You paid $%d to the Taxi Driver.", TransportValue[i]);
							SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
							if(PlayerInfo[i][pMask] == 1)
							{
							    format(string, sizeof(string), "* Stranger has entered your taxi.");
							}
							else
							{
								format(string, sizeof(string), "* %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_LIGHTBLUE, string);
							if(PlayerInfo[i][pMask] == 1)
							{
							    format(string, sizeof(string), "* Stranger has entered your bus.");
							}
							else
							{
								format(string, sizeof(string), "* %s has entered your bus.", name);
							}
							SendClientMessage(i, COLOR_LIGHTBLUE, string);
	                    }
						PlayerInfo[playerid][pCash] = PlayerInfo[playerid][pCash]-TransportValue[i];
						GivePlayerMoney(playerid, - TransportValue[i]);
						TransportMoney[i] += TransportValue[i];
	                }
	            }
	        }
	    }
	}
	if(newstate == PLAYER_STATE_WASTED) //PLAYER DIES
	{
	    if(PlayerInfo[playerid][pJailed] == 0)
	    {
			PlayerInfo[playerid][pHospital] = 1;
	    }
	}
	if(newstate == PLAYER_STATE_DRIVER)
	{
		if(GetPlayerVehicleID(playerid) >= LicCar[0] && GetPlayerVehicleID(playerid) <= LicCar[3])
		{
		    if(DrivingTest[playerid] == 1)
			{
				SendClientMessage(playerid, COLOR_WHITE, "   INFO: Go though the checkpoints to finish the test.");
				SendClientMessage(playerid,COLOR_LIGHTBLUE,"|| To pass the test, go though the designated area's, without banging up the car to badly. ||");
		 		SetPlayerCheckpoint(playerid, 1971.5177,-1930.0858,13.3958, 5.0);
				DrivingStep[playerid] = 1;
			}
			else
			{
   				SendClientMessage(playerid, COLOR_LIGHTRED, "  You are not taking the driving test !");
			    RemovePlayerFromVehicle(playerid);
			    TogglePlayerControllable(playerid, 1);
			}
		}
	}
	if(newstate == PLAYER_STATE_DRIVER)
	{
		if(GetPlayerVehicleID(playerid) >= SailingCar[0] && GetPlayerVehicleID(playerid) <= SailingCar[1])
		{
		    if(SailingTest[playerid] == 1)
			{
				SendClientMessage(playerid, COLOR_WHITE, "   INFO: Go though the checkpoints to finish the test.");
				SendClientMessage(playerid,COLOR_LIGHTBLUE,"|| To pass the test, go though the designated area's, without damaging the boat to badly. ||");
		 		SetPlayerCheckpoint(playerid, 112.0620,-1837.4271,-0.0493, 5.0);
				SailingStep[playerid] = 1;
			}
			else
			{
   				SendClientMessage(playerid, COLOR_LIGHTRED, "  You are not taking the Sailing test !");
			    RemovePlayerFromVehicle(playerid);
			    TogglePlayerControllable(playerid, 1);
			}
		}
	}
	if(oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER)
	{
	    new Float:V1X, Float:V1Y, Float:V1Z;
		new newcar = GetPlayerVehicleID(playerid);
		new Model = GetVehicleModel(newcar);
		new oldcar = gLastCar[playerid];
		new type = FactionInfo[PlayerInfo[playerid][pMember]][FactionType];
		if(IsABoat(newcar))
		{
		    if(PlayerInfo[playerid][pBoatLic] < 1 && SailingTest[playerid] == 0)
			{
			    SendClientMessage(playerid, COLOR_GREY, "   You don't know how to Sail yet, so you left the Boat !");
			    RemovePlayerFromVehicle(playerid);
			}
		}
		else
		{
			if(PlayerInfo[playerid][pCarLic] < 1)
			{
				SendClientMessage(playerid, COLOR_GREY, "You don't have a Driving License - Take care of the Cops [You can obtain one at the DMV]");
			}
		}
		/*if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 525)
		{
			GameTextForPlayer(playerid, "~w~press ~r~~k~~TOGGLE_SUBMISSIONS~~w~ to tow a car.", 3000, 4);
		}*/
		if(GetPlayerVehicleID(playerid) >= Trashmaster[0] && GetPlayerVehicleID(playerid) <= Trashmaster[2])
		{
		    if(PlayerInfo[playerid][pTRoute] == 0)
		    {
		    	SendClientMessage(playerid, COLOR_WHITE, "Trash-Master Radio : Type /loadtrash to start your Working Route");
	    	}
		}
		if(GetPlayerVehicleID(playerid) >= FedexC[0] && GetPlayerVehicleID(playerid) <= FedexC[12])
		{
		    if(PlayerInfo[playerid][pvLoaded] == 0)
		    {
		    	SendClientMessage(playerid, COLOR_WHITE, "Radio : Type /loadvan to start loading the goods");
	    	}
		}
		if(GetPlayerVehicleID(playerid) >= PizzaBike[0] && GetPlayerVehicleID(playerid) <= PizzaBike [4])
		{
		    if(PlayerInfo[playerid][pPRoute] == 0)
		    {
		        SendClientMessage(playerid, COLOR_WHITE, "Pizza-Bike Radio : Type /startpizza to start Delivering Pizza to The houses");
      		}
		 }
		if(GetPlayerVehicleID(playerid) >= Trucks[0] && GetPlayerVehicleID(playerid) <= Trucks[7])
		{
		    SendClientMessage(playerid, -1, "   Type /loadtruck to load the goods on your truck.");
		}
		if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 519)
		{
			GameTextForPlayer(playerid, "~w~use ~r~(/int)ercom~w~ to speak with your passengers.", 3000, 4);
		}
		if(IsACopCar(newcar))
		{
		    if(type == 1)
			{
			}
		    else
			{
				SendClientMessage(playerid, COLOR_GREY, "You don't have the keys for this vehicle [Hint : LSPD-SASD-FBI Vehicles]");
				ClearAnimations(playerid);
			}
		}
		if(IsANGCar(newcar))
		{
		if(type == 3) { }
		    else{ SendClientMessage(playerid, COLOR_GREY, "You don't have the Keys for this vehicle [Hint : DoC Members Vehicles]"); ClearAnimations(playerid); }
		}
		else if(IsANewsCar(newcar))
		{
		   if(type == 7) { }
		    else { SendClientMessage(playerid,COLOR_GREY,"   You don't have the keys for this vehicle [SA-News Agency Vehicles]"); ClearAnimations(playerid); }
		}
		else if(IsAnAmbulance(newcar))
		{
		    if(type == 8) { }
		    else { SendClientMessage(playerid,COLOR_GREY,"   You don't have the keys for this vehicle [E.M.S Vehicles]!"); ClearAnimations(playerid); }
		}
		else if(newcar >= SSVehicles[0] && newcar <= SSVehicles[5])
		{
		   	if(!(PlayerInfo[playerid][pMember] == 7))
			{
		        SendClientMessage(playerid,COLOR_GREY,"   You don't have the keys for this vehicle [Secret Service Vehicles]!");
				ClearAnimations(playerid);
			}
		}
		else if(newcar >= Trucks[0] && newcar <= Trucks[7])
		{
		    if(PlayerInfo[playerid][pJob] == 19)
		    {
				if(CP[playerid] == 0 && TruckGoods[newcar] == 0)
				{
					if(TruckGoods[newcar] == 1)
					{
						SetPlayerCheckpoint(playerid, 1499.6423,-1589.6134,13.3828, 3.0);
			 			CP[playerid] = 1340;
					}
					if(TruckGoods[newcar] == 2)
					{
					    SetPlayerCheckpoint(playerid, 1194.1232,-1323.2413,13.3984, 3.0);
					    CP[playerid] = 1341;
					}
					if(TruckGoods[newcar] == 3)
					{
					    SetPlayerCheckpoint(playerid, 816.3569,-1391.6063,13.4065, 3.0);
					    CP[playerid] = 1342;
					}
					if(TruckGoods[newcar] == 4)
					{
					    SetPlayerCheckpoint(playerid, 481.9336,-1499.8834,20.3204, 3.0);
					    CP[playerid] = 1343;
					}
					if(TruckGoods[newcar] == 5)
					{
						SetPlayerCheckpoint(playerid, 1360.2253,-1279.8677,13.3828, 3.0);
						CP[playerid] = 1344;
					}
					if(TruckGoods[newcar] == 6)
					{
					    SetPlayerCheckpoint(playerid, 1099.5890,-1210.1484,17.3746, 3.0);
					    CP[playerid] = 1345;
					}
					if(TruckGoods[newcar] == 7)
					{
					    SetPlayerCheckpoint(playerid, 1361.7418,-1650.9559,13.3828, 3.0);
					    CP[playerid] = 1346;
					}
					if(TruckGoods[newcar] == 8)
					{
					    SetPlayerCheckpoint(playerid, 1897.3386,-1866.8689,13.1412, 3.0);
					    CP[playerid] = 1347;
					}
				}
				else
				{
				    SendClientMessage(playerid, COLOR_GRAD2, "  This truck is loaded, but you already have an active checkpoint");
				    SendClientMessage(playerid, -1, "   To finish this delivery, lose the old checkpoint first or destroy it(/destroycp)");
				}
			}
			else
			{
			    SendClientMessage(playerid,COLOR_GREY,"   You're not a trucker!");
				RemovePlayerFromVehicle(playerid);
			}
		}
////////CARS
		if(oldcar != PlayerVehicleID1[playerid])
		{
		    UnLockCar(oldcar);
		}
		else if(oldcar != PlayerVehicleID2[playerid])
		{
		    UnLockCar(oldcar);
		}
		else if(oldcar != PlayerVehicleID3[playerid])
		{
		    UnLockCar(oldcar);
		}
		else if(oldcar != PlayerVehicleID4[playerid])
		{
		    UnLockCar(oldcar);
		}
		else if(oldcar != PlayerVehicleID5[playerid])
		{
		    UnLockCar(oldcar);
		}
		new Float:playerhp;
		if(VehicleInfo[newcar][VehicleDealership] == 1)
		{
			if(newcar == PlayerVehicleID1[playerid] || newcar == PlayerVehicleID2[playerid] || newcar == PlayerVehicleID3[playerid] || newcar == PlayerVehicleID4[playerid] || newcar == PlayerVehicleID5[playerid])
			{
				format(string,sizeof(string),"	You are the owner of this %s.",vehName[Model-400]);
				SendClientMessage(playerid,COLOR_GREY,string);
				return 1;
			}
			else
			{
				if(VehicleInfo[newcar][VehicleLock] == 2)
			   	{
					if(VehicleInfo[newcar][VehicleLocked] == 1)
					{
						GetVehiclePos(newcar,V1X,V1Y,V1Z);
						SetPlayerPos(playerid, V1X,V1Y,V1Z+2);
						GetPlayerHealth(playerid,playerhp);
						SetPlayerHealth(playerid,playerhp-15.0);
						GameTextForPlayer(playerid, "~r~STUNNED", 4000, 3);
					}
	       			else
					{
						format(string,sizeof(string),"	Warning: This Vehicle Is Owned By: %s.",VehicleInfo[newcar][VehicleOwner]);
						SendClientMessage(playerid,COLOR_GREY,string);
					}
				}
				else
				{
					format(string,sizeof(string),"	Warning: This Vehicle Is Owned By: %s.",VehicleInfo[newcar][VehicleOwner]);
					SendClientMessage(playerid,COLOR_GREY,string);
				}
			}
		}
		for(new i = 0; i < sizeof(CarInfo); i++)
		{
			if(CarInfo[i][CarID] == newcar)
			{
				if(CarInfo[i][DealerShipCar] == 1)
				{
					new carstring[256];
					format(carstring,sizeof(carstring),"Would you like to buy this %s ?\n This vehicles costs $%d",vehName[CarInfo[i][CarModel]-400],CarInfo[i][CarPrice]);
					ShowPlayerDialog(playerid, 9001, DIALOG_STYLE_MSGBOX, "For Sale!", carstring, "Buy", "Cancel");
					TempCarID[playerid] = i;
				}
			}
		}
		if(Model == 427 && !IsACop(playerid)) // enforcer armor exploit fix
    	{
			SetPlayerArmour(playerid, StoreArmour[playerid]);
		}
		gLastCar[playerid] = newcar;
	}
	if(newstate == PLAYER_STATE_SPAWNED)
	{
	    if(PlayerInfo[playerid][pWantedLevel] > 0)
		{
		    new points = PlayerInfo[playerid][pWantedLevel];
		    new wlevel;
		    if(points == 1) { wlevel = 1; }
		    else if(points == 2) { wlevel = 2; }
		    else if(points == 3) { wlevel = 3; }
		    else if(points == 4) { wlevel = 4; }
		    else if(points == 5) { wlevel = 5; }
		    else if(points == 6) { wlevel = 6; SetPlayerColor(playerid, TCOLOR_WANTED); }
		    SetPlayerWantedLevel(playerid, wlevel);
		}
	}
	if(newstate == PLAYER_STATE_PASSENGER)
	{
	    SendClientMessage(playerid, COLOR_WHITE,"< To Turn on the Vehicle Radio - Use{800040}Y {FFFFFF}or {800040}N{FFFFFF} >");
	}
	return 1;
}


forward CarCheck();
Reply
#4

Lol...Anybody ?

Please,i need urgent !
Reply
#5

Lol...Anyone know ? I need urgent...I don`t know what can i do for this problem... [It`s U-RP edit]
Reply
#6

Anybody ?
Reply
#7

Lol...anyone know or not
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)