SA-MP Forums Archive
Lock driver's door only - 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: Lock driver's door only (/showthread.php?tid=275378)



Lock driver's door only - Blowfish - 09.08.2011

Hi,

I've been trying to close the driver's door of a vehicle only
for quite a while now, but I am unable to find a pleasant
solution.
So could anybody tell me what's the most effective way to
prevent players from entering a vehicle through the driver's
door, which does NOT include freezing the player, please?

Thanks,
Blowfish


Re: Lock driver's door only - MadeMan - 09.08.2011

You can remove the player from vehicle after entering.


AW: Lock driver's door only - Blowfish - 09.08.2011

Yeah, I've done that before, but I don't think it's a very pleasant solution
Thanks anyway


Re: Lock driver's door only - Sascha - 09.08.2011

well there is no way to lock the driver's door only.. (except freeze or just remove the player again as said before)


Respuesta: Lock driver's door only - FranciscoSmitch - 09.08.2011

You can use OnPlayerEnterVehicle, if is driver (ispassenger == 0) lock the car, else if the passenger (ispassenger == 1) unlock the car.


AW: Lock driver's door only - Blowfish - 09.08.2011

What the hell? oO
I'm pretty sure that this did not work a couple of months ago.
I just tried it again and it works perfectly.
Thanks a lot, Francisco.


Re: Lock driver's door only - KoczkaHUN - 09.08.2011

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
if (!ispassenger && IsLocked(vehicleid, playerid)) ClearAnimations(playerid, 1);
return 1;
}


Re: Lock driver's door only - DRIFT_HUNTER - 09.08.2011

Quote:
Originally Posted by KoczkaHUN
Посмотреть сообщение
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
if (!ispassenger && IsLocked(vehicleid, playerid)) ClearAnimations(playerid, 1);
return 1;
}
There is a bug in samp

If player try to enter as driver in vehicle that is already have a driver and you try to stop player entering vehicle you will stop him but player that is a driver will not see that player that is entering stopped he will see that he is jacked :/
I worked on my own locking vehicle system and i gave up until these bug is fixed

I tryed everything from freeze to setplayerpos...i tryed every combination...most useful is a slap + freeze and unfreeze (at same time) sometimes its bugged but mostly its working


Re: Lock driver's door only - KoczkaHUN - 09.08.2011

just put back the driver using PutPlayerInVehicle ...


AW: Lock driver's door only - Blowfish - 09.08.2011

Even better Thanks a lot man