[HELP] Making a car non enterable
#1

Ok, so I know theres a way to make it so people can't enter a certain car, unless they are part of a faction, where it disables the "enter" key. Now, what I need to know, is what would this command be? I believe its keeping me from editing the Wasted Roleplay script, because I can't enter several cars. (( Standard Civil Cars ))

Any help would be apperciated.

Thanks in advanced.
Reply
#2

SetVehicleParamsForPlayer
Reply
#3

Ok, I found this under "Car check"
Код:
	    SetVehicleParamsForPlayer(99, j, 0, 0);
	    SetVehicleParamsForPlayer(100, j, 0, 0);
	    SetVehicleParamsForPlayer(101, j, 0, 0);
	    SetVehicleParamsForPlayer(102, j, 0, 0);
	    SetVehicleParamsForPlayer(103, j, 0, 0);
	    SetVehicleParamsForPlayer(104, j, 0, 0);
	    SetVehicleParamsForPlayer(105, j, 0, 0);
	    SetVehicleParamsForPlayer(106, j, 0, 0);
	    SetVehicleParamsForPlayer(107, j, 0, 0);
	    SetVehicleParamsForPlayer(108, j, 0, 0);
	    SetVehicleParamsForPlayer(109, j, 0, 0);
Would I remove it? I believe the 101,102,103 etc are the actual vehicle numbers, correct?
Reply
#4

Quote:
Originally Posted by James_Geist
Ok, I found this under "Car check"
Код:
	    SetVehicleParamsForPlayer(99, j, 0, 0);
	    SetVehicleParamsForPlayer(100, j, 0, 0);
	    SetVehicleParamsForPlayer(101, j, 0, 0);
	    SetVehicleParamsForPlayer(102, j, 0, 0);
	    SetVehicleParamsForPlayer(103, j, 0, 0);
	    SetVehicleParamsForPlayer(104, j, 0, 0);
	    SetVehicleParamsForPlayer(105, j, 0, 0);
	    SetVehicleParamsForPlayer(106, j, 0, 0);
	    SetVehicleParamsForPlayer(107, j, 0, 0);
	    SetVehicleParamsForPlayer(108, j, 0, 0);
	    SetVehicleParamsForPlayer(109, j, 0, 0);
Would I remove it? I believe the 101,102,103 etc are the actual vehicle numbers, correct?
Best to just remove it all, All it does is locks cars, But that code is to Unlock cars i think 0.o
Reply
#5

I also have some other misc code with SetVehicleParamsForPlayer.

Код:
	for(new c = 1; c < 254; c++)
	{
		for(new i = 0; i < MAX_PLAYERS; i++)
		{
			if(IsPlayerConnected(i))
			{
				if (PlayerInfo[i][pJob] == 5)
				{
					SetVehicleParamsForPlayer(c, i, 0, 0);
				}
			}
		}
		if (gLastDriver[c] == 301)
		{
			CarRespawn©;
		}
		if (gLastDriver[c] >= 300)
		{
			gLastDriver[c]++;
		}
		//foundowner = -1;
	}
	return 1;
}
Код:
public LockCar(carid)
{
	for(new i = 0; i < MAX_PLAYERS; i++)
	{
		if(IsPlayerConnected(i))
		{
			SetVehicleParamsForPlayer(carid,i,0,1);
		}
	}
}

public UnLockCar(carid)
{
	for(new i = 0; i < MAX_PLAYERS; i++)
	{
		if(IsPlayerConnected(i))
		{
			if(!IsAPlane(carid))
			{
				SetVehicleParamsForPlayer(carid,i,0,0);
			}
		}
	}
}
I'll remove the SetVehicleParamsForPlayer(99, j, 0, 0); etc, to see if that works.
Reply
#6

lol remove public LockCar, that is what locks the cars
Reply
#7

Quote:
Originally Posted by James_Geist
I also have some other misc code with SetVehicleParamsForPlayer.

Код:
	for(new c = 1; c < 254; c++)
	{
		for(new i = 0; i < MAX_PLAYERS; i++)
		{
			if(IsPlayerConnected(i))
			{
				if (PlayerInfo[i][pJob] == 5)
				{
					SetVehicleParamsForPlayer(c, i, 0, 0);
				}
			}
		}
		if (gLastDriver[c] == 301)
		{
			CarRespawn©;
		}
		if (gLastDriver[c] >= 300)
		{
			gLastDriver[c]++;
		}
		//foundowner = -1;
	}
	return 1;
}
Код:
public LockCar(carid)
{
	for(new i = 0; i < MAX_PLAYERS; i++)
	{
		if(IsPlayerConnected(i))
		{
			SetVehicleParamsForPlayer(carid,i,0,1);
		}
	}
}

public UnLockCar(carid)
{
	for(new i = 0; i < MAX_PLAYERS; i++)
	{
		if(IsPlayerConnected(i))
		{
			if(!IsAPlane(carid))
			{
				SetVehicleParamsForPlayer(carid,i,0,0);
			}
		}
	}
}
I'll remove the SetVehicleParamsForPlayer(99, j, 0, 0); etc, to see if that works.
It won't. Setting the params to 0 unlocks them. So you would remove the part that unlocks it. You need to remove the public function that is called "LockCar"
Reply
#8

So, if I remove this, will I still be able to lock cars?
Reply
#9

Quote:
Originally Posted by James_Geist
So, if I remove this, will I still be able to lock cars?
No, Its best to find what locks them, It should be in OnPlayerConnect somewhere, But editing it might fuck other things up :S
Reply
#10

Taking a look now, seriously Wasted Roleplay is a great script, except for the shitty bugs.

EDIT: Nothing what so ever, about cars being locked or unlocked...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)