Problem with server remvoing vehicle?!
#7

Quote:
Originally Posted by MEW273
Посмотреть сообщение
Have you searched your gamemode (using ctrl+F) for terms such as "DestroyVehicle"?

Is there any code under OnPlayerEnterVehicle?

It is difficult to point you in the right direction without seeing any of your code.
This is the code Under "OnPlayerEnterVehicle"
Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
	if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_CARRY)
	{
	    new
	        Float:x,
	        Float:y,
	        Float:z;
	    GetPlayerPos(playerid, x, y, z);
	    SetPlayerPos(playerid, x, y, z + 0.5);
	    ClearAnimations(playerid);
	}

	if((!ispassenger) && (PlayerInfo[playerid][pCuffed] || PlayerInfo[playerid][pInjured]))
	{
	    new
	        Float:x,
	        Float:y,
	        Float:z;
	    GetPlayerPos(playerid, x, y, z);
	    SetPlayerPos(playerid, x, y, z + 0.5);
	    ClearAnimations(playerid);
	}

	if(!ispassenger)
	{
	    if((pizzaVehicles[0] <= vehicleid <= pizzaVehicles[5]) && !PlayerHasJob(playerid, JOB_PIZZAMAN))
	    {
	        SendClientMessage(playerid, COLOR_GREY, "You cannot operate this vehicle as you are not a Pizzaman.");
	        ClearAnimations(playerid);
	    }
	    if((courierVehicles[0] <= vehicleid <= courierVehicles[6]) && !PlayerHasJob(playerid, JOB_COURIER))
	    {
	        SendClientMessage(playerid, COLOR_GREY, "You cannot operate this vehicle as you are not a Courier.");
	        ClearAnimations(playerid);
	    }
	    if((sweeperVehicles[0] <= vehicleid <= sweeperVehicles[3]) && !PlayerHasJob(playerid, JOB_SWEEPER))
	    {
	        SendClientMessage(playerid, COLOR_GREY, "You cannot operate this vehicle as you are not a Street Sweeper.");
	        ClearAnimations(playerid);
	    }
	    if((taxiVehicles[0] <= vehicleid <= taxiVehicles[3]) && !PlayerHasJob(playerid, JOB_TAXIDRIVER))
	    {
	        SendClientMessage(playerid, COLOR_GREY, "You cannot operate this vehicle as you are not a Taxi Driver.");
	        ClearAnimations(playerid);
	    }
	    if((testVehicles[0] <= vehicleid <= testVehicles[2]) && !PlayerInfo[playerid][pDrivingTest])
	    {
	        SendClientMessage(playerid, COLOR_GREY, "You cannot operate this vehicle as you are not taking your drivers test.");
	        ClearAnimations(playerid);
	    }
	    if(VehicleInfo[vehicleid][vFactionType] != FACTION_NONE && GetFactionType(playerid) != VehicleInfo[vehicleid][vFactionType])
	    {
	        SendClientMessage(playerid, COLOR_GREY, "You cannot operate this vehicle as it doesn't belong to your faction.");
	        ClearAnimations(playerid);
	    }
	    if(VehicleInfo[vehicleid][vGang] >= 0 && PlayerInfo[playerid][pGang] != VehicleInfo[vehicleid][vGang])
	    {
	        SendClientMessage(playerid, COLOR_GREY, "You cannot operate this vehicle as it doesn't belong to your gang.");
	        ClearAnimations(playerid);
	    }
	    if(VehicleInfo[vehicleid][vJob] >= 0 && PlayerInfo[playerid][pJob] != VehicleInfo[vehicleid][vJob])
	    {
	        SendClientMessageEx(playerid, COLOR_GREY, "You cannot operate this vehicle as you are not a %s.", GetJobName(VehicleInfo[vehicleid][vJob]));
	        ClearAnimations(playerid);
	    }
	}

	return 1;
}
Edit:
I found the fault, it had a DestroyVehicle(i); under the fueltimer so when the fuel went down from 100 to 99 it destroyed the vehicle, thanks for your help kind sir
Reply


Messages In This Thread
Problem with server remvoing vehicle?! - by kevann - 25.12.2017, 11:12
Re: Problem with server remvoing vehicle?! - by MEW273 - 25.12.2017, 12:48
Re: Problem with server remvoing vehicle?! - by kevann - 25.12.2017, 12:49
Re: Problem with server remvoing vehicle?! - by MEW273 - 25.12.2017, 12:55
Re: Problem with server remvoing vehicle?! - by kevann - 25.12.2017, 13:10
Re: Problem with server remvoing vehicle?! - by MEW273 - 25.12.2017, 13:11
Re: Problem with server remvoing vehicle?! - by kevann - 25.12.2017, 13:39

Forum Jump:


Users browsing this thread: 2 Guest(s)