SA-MP Forums Archive
[Question] Vehicle locks. - 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)
+--- Thread: [Question] Vehicle locks. (/showthread.php?tid=321017)



[Question] Vehicle locks. - tony_fitto - 25.02.2012

Hey everyone,

I just a quick question I got the other day, If I lock a vehicle everyone know that you can exit the vehicle in game, but is it possible to make so a player wont be able to exit a vehicle if the vehicle is locked?

If so under what catecory or how should I create it?

Kind Regards,
Tony


Re: [Question] Vehicle locks. - emokidx - 25.02.2012

wondering
pawn Код:
public OnPlayerExitVehicle(playerid, vehicleid)
{
    if(lock == 1)
    {
       PutPlayerInVehicle(vehicleid);
    }
    return 1;
}



Re: [Question] Vehicle locks. - tony_fitto - 26.02.2012

Quote:
Originally Posted by emokidx111
Посмотреть сообщение
wondering
pawn Код:
public OnPlayerExitVehicle(playerid, vehicleid)
{
    if(lock == 1)
    {
       PutPlayerInVehicle(vehicleid);
    }
    return 1;
}
Sweet, but wont that put the player in the driver seat?
What if the player are exit from the back seat or something?


Re: [Question] Vehicle locks. - Voldemort - 26.02.2012

PutPlayerInVehicle(playerid,vehicleid,seatid); have seats params aswell

but if player is driver you need to put part where you put player in the vehicle uder OnPlayerStateChange, actualy also passengers can put OnPlayerStateChange, else server still think player is in a car and wont put him back.


Re: [Question] Vehicle locks. - emokidx - 26.02.2012

you can just check which seat is the player in

pawn Код:
new Seat = GetPlayerVehicleSeat(playerid);
PutPlayerInVehicle(playerid, vehicleid, Seat);
i think will work
also read this
https://sampwiki.blast.hk/wiki/GetPlayerVehicleSeat
Код:
Note: Sometimes the result can be 128 which is an invalid seat ID. Circumstances of this are not yet known, but it is best to discard information when returned seat number is 128.



Re: [Question] Vehicle locks. - tony_fitto - 26.02.2012

Oh man, Sweet. Thanks alot for the help!

Love people like you who helps out!