Lock driver's door only
#1

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
Reply
#2

You can remove the player from vehicle after entering.
Reply
#3

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

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

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

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

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

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
Reply
#9

just put back the driver using PutPlayerInVehicle ...
Reply
#10

Even better Thanks a lot man
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)