SA-MP Forums Archive
[HELP] Making a car non enterable - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [HELP] Making a car non enterable (/showthread.php?tid=65113)



[HELP] Making a car non enterable - Tito_Johnson - 10.02.2009

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.


Re: [HELP] Making a car non enterable - Backwardsman97 - 10.02.2009

SetVehicleParamsForPlayer


Re: [HELP] Making a car non enterable - Tito_Johnson - 10.02.2009

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?


Re: [HELP] Making a car non enterable - ICECOLDKILLAK8 - 10.02.2009

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


Re: [HELP] Making a car non enterable - Tito_Johnson - 10.02.2009

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.


Re: [HELP] Making a car non enterable - ICECOLDKILLAK8 - 10.02.2009

lol remove public LockCar, that is what locks the cars


Re: [HELP] Making a car non enterable - Backwardsman97 - 10.02.2009

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"


Re: [HELP] Making a car non enterable - Tito_Johnson - 10.02.2009

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



Re: [HELP] Making a car non enterable - ICECOLDKILLAK8 - 10.02.2009

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


Re: [HELP] Making a car non enterable - Tito_Johnson - 10.02.2009

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...