Locking cars/Make them not able to /engine
#1

Alright, I'm trying to set all the "useless" cars that are just for show, locked or take the ability to /engine them away.
I'd love to be able to lock them. But I'm unsure how... One way I haven't tried is OnPlayerEnterVehicle, I've tried to SetVehicleParamsForPlayer upon them spawning.. But it doesn't work.
My /engine command will Not allow cars (type 0) that are "useless" to be /engine'd.. (Meaning that part works, you can't start the engine of a car type 0, but when in an ownable car or a rentable car it is bugged.)
Код:
 	if(strcmp(cmd, "/engine", true) == 0)
	{
		if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
		{
			if(DynamicCars[GetPlayerVehicleID(playerid)][CarType] != 0)
			{
		  if(EngineStatus[GetPlayerVehicleID(playerid)] == 0)
			{
				TogglePlayerControllable(playerid,1);
				EngineStatus[GetPlayerVehicleID(playerid)] = 1;
				if(PlayerInfo[playerid][pSex] == 1)
				{
	  			PlayerActionMessage(playerid,15.0,"inserts his keys into the ignition and turns the engine on.");
	  			}
	  			else
	  			{
					PlayerActionMessage(playerid,15.0,"inserts her keys into the ignition and turns the engine on.");
	  			}
				} else
				{
				TogglePlayerControllable(playerid,0);
				EngineStatus[GetPlayerVehicleID(playerid)] = 0;

	  			if(PlayerInfo[playerid][pSex] == 1)
				{
	  				PlayerActionMessage(playerid,15.0,"has just put his car in park and turned the engine off.");
	  			}
	  			else
	  			{
					PlayerActionMessage(playerid,15.0,"has just put her car in park and turned the engine off.");
	  			}
				}
			} else {
			SendClientMessage(playerid, COLOR_WHITE, "You do not have keys to this car nor are there keys in the ignition.");
			}
		} else
		{
		  SendClientMessage(playerid,COLOR_LIGHTYELLOW2,"[ERROR:] You are not even in a car!");
		}
		return 1;
	}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)